#include<cstdio>
#include<cmath>
#define max 1004
int prime[max+1];
int twin[max];
void sieve()
{
int i,j;
for(i=2; i <= max; i++)
prime = 1;
for(i=2; i <= sqrt(max);)
{
for(j = 2*i; j <= max; j += i)
{
prime[j]=0;
}
i++;
for(; !prime ; i++);
}
prime[1] = 1;
prime[2] = 1;
prime[0 ...
Search found 5 matches
- Sat Jan 12, 2013 9:08 pm
- Forum: Volume 4 (400-499)
- Topic: 406 - Prime Cuts
- Replies: 187
- Views: 60519
- Tue Nov 06, 2012 4:28 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11371 - Number Theory for Newbies
- Replies: 65
- Views: 34226
Re: 11371 - Number Theory for Newbies
Thank You Bro 

- Tue Oct 30, 2012 7:15 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11362 - Phone List
- Replies: 19
- Views: 13363
Re: 11362 - Phone List
why we sort
the array?
if we sort this
3
911
97625999
91125426
then it becomes
119
25679999
11224569
answer should be "Yes"
please anyone describe this.
Thanks in advance
the array?
if we sort this
3
911
97625999
91125426
then it becomes
119
25679999
11224569
answer should be "Yes"
please anyone describe this.
Thanks in advance

- Sun Oct 28, 2012 9:58 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11371 - Number Theory for Newbies
- Replies: 65
- Views: 34226
Re: 11371 - Number Theory for Newbies
To Mr. Sohel Hafiz
You said,
"The smallest one can be found by sorting in ascending order.. but there could be a case of leading 0. By swapping the smallest non zero digit with the first zero, this can be handled."
my Question is why we are using this logic?
is there any kind of rule for this ...
You said,
"The smallest one can be found by sorting in ascending order.. but there could be a case of leading 0. By swapping the smallest non zero digit with the first zero, this can be handled."
my Question is why we are using this logic?
is there any kind of rule for this ...
- Sun Apr 08, 2012 6:14 pm
- Forum: Volume 4 (400-499)
- Topic: 458 - The Decoder
- Replies: 71
- Views: 27408
Re: 458 Decoder , Why time limit exceede
Where is the problem in my code
It is showing compiler error
#include<iostream>
#include<String>
using namespace std;
int main()
{
string line;
int i;
while(cin >> line)
{
for(i =0; line != '\0' ; ++i)
{
if((line >= 'H' && line <= 'Z') || (line >= 'h' && line <= 'z'))
putchar(line - 7 ...
It is showing compiler error
#include<iostream>
#include<String>
using namespace std;
int main()
{
string line;
int i;
while(cin >> line)
{
for(i =0; line != '\0' ; ++i)
{
if((line >= 'H' && line <= 'Z') || (line >= 'h' && line <= 'z'))
putchar(line - 7 ...