Search found 127 matches

by Subeen
Tue Sep 14, 2004 8:55 am
Forum: Volume 106 (10600-10699)
Topic: 10637 - Coprimes
Replies: 16
Views: 6506

getting WA

I got WA with this problem but tested with several inputs and failed to find the bug. Please help me to identify what's wrong in my code. Here it is: [cpp]#include <stdio.h> int X[50]; int s, t; void recurse(int k, int n, int sum) { int i, j, a, b, c; X[k] = n; if(k==t && sum==s) { printf("%d", X[1]...
by Subeen
Sat Aug 14, 2004 5:55 pm
Forum: Volume 104 (10400-10499)
Topic: 10479 - The Hendrie Sequence
Replies: 14
Views: 5391

tep, see the tree below: 0 | 1 / \ 0 2 / / | \ 1 0 0 3 now start traversing each level left to right hope it helps... but I got WA with my code :( some one please post some test cases.
by Subeen
Sat Aug 14, 2004 5:21 pm
Forum: Volume 101 (10100-10199)
Topic: 10111 - Find the Winning Move
Replies: 16
Views: 5103

I got WA with my code. some one please post some tests. or you can help me to find the bug in my program. here it is: [cpp]#include <stdio.h> char board[6][6]; char *str = "xo"; int game_over() { int i, j; for(i=0; i<4; i++) for(j=0; j<4; j++) if(board [j]=='.') return 0; return 1; } int wins(int pl...
by Subeen
Mon Jul 26, 2004 5:03 pm
Forum: Volume 104 (10400-10499)
Topic: 10479 - The Hendrie Sequence
Replies: 14
Views: 5391

I think the input is not a valid one.

Code: Select all

Each test case consists of a single line containing the integer n ( 0 < n < 2^63) 
by Subeen
Tue Jul 20, 2004 1:34 pm
Forum: Volume 104 (10400-10499)
Topic: 10479 - The Hendrie Sequence
Replies: 14
Views: 5391

I got WA with this problem. Please help me to find my bug. [cpp]#include <stdio.h> #include <math.h> int depth, ans; long long int serial, current; int recurse(int n, int d) { int i, tempDepth; long long int tempCurrent; if(d==depth) { if(serial==current+1) { ans = n; return 1; } else return 0; } fo...
by Subeen
Thu Mar 25, 2004 7:33 am
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 32405

If judge gives your program output limit exceeded. then change

Code: Select all

while(scanf("%d",&n)) 
into

Code: Select all

while(1==scanf("%d",&n))
and after that you may get answers other the OLE :wink:
by Subeen
Wed Mar 24, 2004 10:40 am
Forum: Volume 101 (10100-10199)
Topic: 10110 - Light, more light
Replies: 76
Views: 26133

rlatif119, I think you are making any mistake in your submission. If you change the datatype into unsigned long then your program gets accepted. You have to use %lu for unsigned data type and do not typecast into long. ( you don't need any typecast here )
by Subeen
Sat Mar 20, 2004 11:34 am
Forum: Volume 100 (10000-10099)
Topic: 10015 - Joseph's Cousin
Replies: 23
Views: 5011

thanks for output. I got it AC. :)
by Subeen
Sat Mar 20, 2004 9:49 am
Forum: Volume 104 (10400-10499)
Topic: 10446 - The Marriage Interview :-)
Replies: 17
Views: 9615

I spend a lot of time but can't get this problem AC yet. What's the problem is my code? Here is it:
[c]now AC[/c]

please help me to identify my problem...
by Subeen
Sat Mar 20, 2004 9:46 am
Forum: Volume 104 (10400-10499)
Topic: 10446 - The Marriage Interview :-)
Replies: 17
Views: 9615

Subeen wrote:I spend a lot of time but can't get this problem AC yet. What's the problem is my code? Here is it:
[c]now AC[/c]

please help me to identify my problem...
by Subeen
Sat Mar 20, 2004 9:25 am
Forum: Volume 101 (10100-10199)
Topic: 10199 - Tourist Guide
Replies: 57
Views: 31037

I also got WA. My program passed all previous sample in/out s in this thread. Please help me to identify my problem. here is the code: [c]#include <stdio.h> #include <string.h> #include <stdlib.h> #define min(a, b) (a < b) ? a : b #define MAXV 105 #define MAXE 5100 int adj[MAXV][MAXV], dfn[MAXV], L[...
by Subeen
Fri Mar 19, 2004 8:32 am
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 43916

apply dynamic programming here:

1. first store all the answers in a table ( here two dimensional array )
2. just read input and write output

see that, if you calculate factorial of n then you must calculate factorials of 1 to n-1, hope it will help :)
by Subeen
Wed Mar 17, 2004 2:22 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 20054

My code got WA. Please help me to find the bug in my code:- [c]#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> long gcd(long a, long b) { if(!b) return a; else return gcd(b, a%b); } void main() { int j, k, len, kase=1; long num, denom, g; double x, a, b; char ara[20]; wh...
by Subeen
Sun Mar 14, 2004 1:16 pm
Forum: Off topic (General chit-chat)
Topic: Are you an ACM member?
Replies: 10
Views: 4538

I am also a student member of ACM.
by Subeen
Thu Mar 11, 2004 12:22 pm
Forum: Volume 100 (10000-10099)
Topic: 10034 - Freckles
Replies: 101
Views: 32415

jandujar, my acepted program prints the following output for your given input:

Code: Select all

0.41

0.00

23.94

0.00

20.06

18.22

9.62

12.42

0.00

9.52

Go to advanced search