## Search found 31 matches

- Sun May 07, 2006 6:26 pm
- Forum: Volume 4 (400-499)
- Topic: 490 - Rotating Sentences
- Replies:
**212** - Views:
**23786**

hi, check this input : my name is ankur jaiswal. i know many people by the name of ankur. hello people. Your program gave following output : him e y lk lnn ooa wm p e em oai pns ly e a .pn ek ou pr l ej a bi ys w ta hl e. n a m e o f a n k u r . i.e. your program does not print spaces at the end. I ...

- Sun May 07, 2006 6:07 pm
- Forum: Volume 4 (400-499)
- Topic: 443 - Humble Numbers
- Replies:
**82** - Views:
**8530**

- Sun May 07, 2006 12:22 pm
- Forum: Volume 4 (400-499)
- Topic: 443 - Humble Numbers
- Replies:
**82** - Views:
**8530**

### 443 WA i dont know why. smbd plz help

I am getting WA in this problem although i have done everything rite.

All the suffixes are correct and the values for different inputs is also correct.

But I dont know why its giving WA.

Plz help me.

All the suffixes are correct and the values for different inputs is also correct.

But I dont know why its giving WA.

Plz help me.

- Thu May 04, 2006 11:00 am
- Forum: Algorithms
- Topic: Sieve of Eratosthenes
- Replies:
**1** - Views:
**1240**

### Sieve of Eratosthenes

Can somebody tell me a very fast method to implement Sieve?

For example i want to generate all prime numbers upto 10^8. then what should i do?

For example i want to generate all prime numbers upto 10^8. then what should i do?

- Wed May 03, 2006 11:44 am
- Forum: Volume 109 (10900-10999)
- Topic: 10994 - Simple Addition
- Replies:
**41** - Views:
**16302**

- Tue May 02, 2006 11:28 am
- Forum: Volume 102 (10200-10299)
- Topic: 10299 - Relatives
- Replies:
**57** - Views:
**15334**

### GOT IT ACCEPTED

thanx a lot everybody ... especially mamun

finally i got it accepted.

finally i got it accepted.

- Tue May 02, 2006 11:17 am
- Forum: Volume 102 (10200-10299)
- Topic: 10299 - Relatives
- Replies:
**57** - Views:
**15334**

### Solution

thanks a lot.

But now i am getting WA.

But now i am getting WA.

- Tue May 02, 2006 9:31 am
- Forum: Volume 102 (10200-10299)
- Topic: 10299 - Relatives
- Replies:
**57** - Views:
**15334**

### Terminating condition on (num==1)

When num!=1 (but i>3401) in the function relatives() and the for loop is done with, then i am keeping a check onto num (whether it is 1 or not).

If it is not 1 then it will obviously be a prime number... therefore i have done ans=(ans/num) *(num-1);

so i dont think that this condition is wrong.

If it is not 1 then it will obviously be a prime number... therefore i have done ans=(ans/num) *(num-1);

so i dont think that this condition is wrong.

- Mon May 01, 2006 6:01 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10299 - Relatives
- Replies:
**57** - Views:
**15334**

### Solution to 10299

I too have used Euler Phi function to solve this question.

But I first calculated prime numbers using Sieve so as to get the prime numbers in lesser time. But then too i am getting TLE. Plz give more hints to solve this problem.

But I first calculated prime numbers using Sieve so as to get the prime numbers in lesser time. But then too i am getting TLE. Plz give more hints to solve this problem.

- Mon May 01, 2006 12:45 am
- Forum: Volume 102 (10200-10299)
- Topic: 10299 - Relatives
- Replies:
**57** - Views:
**15334**

### 10299 TLE

I have used sieve to calculate the prime numbers. Then I used Euler's fonction to calculate the number of relatives.

Then too I am getting TLE.

Smbd help me.

Thanx in advance.

Code :

Removed after accpeted .

Then too I am getting TLE.

Smbd help me.

Thanx in advance.

Code :

Removed after accpeted .

- Sun Apr 02, 2006 6:08 am
- Forum: Algorithms
- Topic: nitk problem
- Replies:
**5** - Views:
**1426**

- Sat Apr 01, 2006 8:47 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies:
**235** - Views:
**41517**

### 10062

I am using the straightforward algo to solve this problem. However I am using an array of size just 97 (for storing the values from 32 to 128 as given in the question). Is this the problem. I also understood the question as follows : if the frequency of two or more characters is the same, then print...

- Sat Apr 01, 2006 4:10 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10994 - Simple Addition
- Replies:
**41** - Views:
**16302**

i got a direct formula for the second grp numbers (i.e the numbers not ending in 0) but i am not able to get the formula for the numbers ending in 0...So, i got TLE. my output is correct. i am using following code for the numbers ending in 0 - for(i=temp;i<=q;i+=10){ p=i; while(p%10==0) p/=10; ans+=...

- Sat Apr 01, 2006 9:35 am
- Forum: Volume 109 (10900-10999)
- Topic: 10959 - The Party, Part I
- Replies:
**37** - Views:
**18926**

### 10959 - The Party, Part I

For this question, i used BFS. But it's giving WA. Can smbd help me? Here is the code : #include<stdio.h> int main(){ int dance[1000][1000],i,j,p,d,t,k,a,b,don[1000],c[1000]; scanf("%d",&t); don[0]=0; for(i=0;i<t;i++){ scanf("%d%d",&d,&p); for(j=0;j<d;j++) for(k=0;k<d;k++) dance[j][k]=-1; for(j=0;j<...

- Sat Apr 01, 2006 6:40 am
- Forum: Volume 109 (10900-10999)
- Topic: 10959 - The Party, Part I
- Replies:
**37** - Views:
**18926**

### Problem in 10959

I too used BFS. but it is giving WA. Can smbd help me? Here is the code- #include<stdio.h> int main(){ int dance[1000][1000],i,j,p,d,t,k,a,b,don[1000],c[1000]; scanf("%d",&t); don[0]=0; for(i=0;i<t;i++){ scanf("%d%d",&d,&p); for(j=0;j<d;j++) for(k=0;k<d;k++) dance[j][k]=-1; for(j=0;j<d;j++) don[j]=c...