## Search found 81 matches

Sun Sep 14, 2008 5:26 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 22316

Here is my code: I got wA i don't know whats my problem. ples help me. #include<stdio.h> #include<math.h> #include<string.h> int gcd(int a,int b) { int c; if(b>a) { c=a; a=b; b=c; } if(b==0) return a; else return gcd(b,a%b); } int main() { int Case,j,i,len,val,d,k,val2,a,b,c,r,m; double e,f,val1,p,q...
Sun Sep 14, 2008 4:33 pm
Forum: Volume 4 (400-499)
Topic: 413 - Up and Down Sequences
Replies: 22
Views: 5911

### Re: help..help..hellllppp!!!! 413

I got it . it was a little mistake.
Sun Sep 14, 2008 4:29 pm
Forum: Volume 4 (400-499)
Topic: 413 - Up and Down Sequences
Replies: 22
Views: 5911

### Re: help..help..hellllppp!!!! 413

I got it . it was a little mistake.
Fri Sep 12, 2008 11:48 am
Forum: Volume 4 (400-499)
Topic: 413 - Up and Down Sequences
Replies: 22
Views: 5911

### Re: help..help..hellllppp!!!! 413

Here is some input-output. I got PE.ples help. input: 1 2 3 0 3 2 1 0 1 2 3 2 1 0 2 2 2 2 3 0 4 4 4 4 3 0 4 4 4 3 3 3 3 0 4 4 4 3 3 3 4 0 5 5 5 5 0 1 2 3 2 3 4 5 0 0 Output: Nr values = 3: 2.000000 0.000000 Nr values = 3: 0.000000 2.000000 Nr values = 5: 2.000000 2.000000 Nr values = 5: 4.000000 0.0...
Fri Apr 04, 2008 5:51 pm
Forum: Volume 6 (600-699)
Topic: 677 - All Walks of length "n" from the first node
Replies: 17
Views: 8472

i think there is problem in this section.

Code: Select all

``````
if(visit[i]==0)
{
ans[count]=i;
count++;
DfsVisit(i);
visit[i]=0;
count--;
}
``````
i think visit=0 when the loop is complete & u return to the previous node.
Fri Apr 04, 2008 2:44 pm
Forum: Volume 6 (600-699)
Topic: 615 - Is It A Tree?
Replies: 71
Views: 25485

### Re: Oh gosh-! I can`t solve this problem- (615)

try this input: 6 8 5 3 5 2 6 4 5 6 0 0 8 1 7 3 6 2 8 9 7 5 7 4 7 8 7 6 0 0 3 8 6 8 6 4 5 3 5 6 5 2 0 0 1 2 1 3 2 4 2 5 2 6 2 7 3 8 8 9 9 10 10 11 11 12 12 13 0 0 1 2 0 0 1 2 2 1 0 0 1 2 3 4 0 0 1 2 2 4 2 5 2 6 1 3 3 6 0 0 100008 200008 10008 30000 0 0 -1 -1 output: Case 1 is a tree. Case 2 is a tre...
Mon Mar 31, 2008 9:26 pm
Forum: Volume 114 (11400-11499)
Topic: 11408 - Count DePrimes
Replies: 12
Views: 6300

### 11408 - Count DePrimes

here is my code i got TLE. I don't know whats my problem. i use sieve for calculating the primes. ples help. #include<stdio.h> #include<math.h> char Array[5000000]; int prime[200000]; void primes() { int i,j,sN; sN = sqrt(5000000); for(i=2;i<=5000000;i++) { Array[i]='P'; } for(i=2;i<sN;i++) { if(Arr...
Mon Mar 31, 2008 9:20 pm
Forum: Volume 114 (11400-11499)
Topic: 11428 - Cubes
Replies: 64
Views: 18842
I GOT ac
thanks sclo
i have a problem with that.
Mon Mar 24, 2008 8:58 pm
Forum: Volume 103 (10300-10399)
Topic: 10397 - Connect the Campus
Replies: 75
Views: 27592
its a problem of mst.
u can use prims algo.
before that u have to set 0 to the given edge.
Fri Mar 21, 2008 11:11 pm
Forum: Volume 100 (10000-10099)
Topic: 10044 - Erdos Numbers
Replies: 102
Views: 41912
can some give me some special input-output? i got WA I ALSO check all the input which is given in this board. but i don't know whats my problem. is it ok to get the input format? or is it okk to run the loop until ':'; for(j=1;j<=x;j++) { gets(string); count=0; s=0; d=0; ch='2'; for(k=0;ch!=':';k++)...
Fri Mar 21, 2008 11:01 pm
Forum: Volume 101 (10100-10199)
Topic: 10171 - Meeting Prof. Miguel...
Replies: 68
Views: 25656
I CHECK the jackie's input. here i have given some input output including jackie's which is the last one. ples check whats my fault. input: 4 Y U A B 4 Y U C A 1 M U D B 6 M B C D 2 A D 2 Y U A B 10 M U C D 20 A D 6 Y U A Z 0 Y U C A 0 Y U A Y 0 M U D Z 0 M B C D 0 M B C Y 0 A D 2 Y U B D 0 M U B D ...
Fri Mar 21, 2008 4:57 pm
Forum: Volume 100 (10000-10099)
Topic: 10034 - Freckles
Replies: 101
Views: 35030
U got RTE with the signal of floating point error
there is no need to declare the array size 1000.
Fri Mar 21, 2008 4:39 pm
Forum: Volume 5 (500-599)
Topic: 567 - Risk
Replies: 46
Views: 18200
thanks a lot man.
i got AC by using BFS.
Fri Mar 21, 2008 9:28 am
Forum: Volume 7 (700-799)
Topic: 762 - We Ship Cheap
Replies: 51
Views: 21409
i got AC by using BFS.
THERE are two special case:

Code: Select all

``````input:
1
AA BB
AA DD

1
AA BB
AA AA

output:
No route

AA AA
``````
Thu Mar 20, 2008 9:20 pm
Forum: Volume 114 (11400-11499)
Topic: 11424 - GCD - Extreme (I)
Replies: 25
Views: 7488
Robert i use ur method & got AC in 11424 but TLE in 11426 here is my code: #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> int MAX=4000001; int *eular; int *a; int fi(int n) { int result = n,i; for(i=2;i*i <= n;i++) { if (n % i == 0) result -= result / i; while (n % i ==...