Search found 26 matches

by Joe Smith
Fri Aug 22, 2003 3:09 am
Forum: Volume 105 (10500-10599)
Topic: 10535 - Shooter
Replies: 25
Views: 48886

can anyone see any problem with this? I get WA and I don''t know why. :cry: [cpp] int N, c[501][4], x, y; bool check(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { int x = (y1-y3)*(x4-x3) - (x1-x3)*(y4-y3); int y = (x3-x1)*(y2-y1) - (y3-y1)*(x2-x1); int z = (y4-y3)*(x2-x1) - (x4-x...
by Joe Smith
Wed Jul 31, 2002 5:35 am
Forum: Volume 1 (100-199)
Topic: 144 - Student Grants
Replies: 21
Views: 3549

Re: Could somebody give me sample input/output for 144 ?

I keep getting WA for 144.... It would be very helpful, if somebody could provide me a sample set of input/output. or if somebody could give me his ACCEPTED program for 144, so that I can compare my outputs. Thanks. I didn't test my solution much, so I'll just post the code. Enjoy... [cpp] #include...
by Joe Smith
Sun Jul 28, 2002 1:25 am
Forum: Volume 1 (100-199)
Topic: 114 - Simulation Wizardry
Replies: 80
Views: 7612

Your problem is here: for (int i=0; i<p; i++) { if (x+dir_x[dir]==b[i].x && y+dir_y[dir]==b[i].y) { ... You're getting overall complexity of O((numbers of bumpers)*(numbers of moves)) and it can be very large value. There is a way to check the collision of bumber and ball instantly. And AFAIR there...
by Joe Smith
Fri Jul 26, 2002 5:34 am
Forum: Volume 1 (100-199)
Topic: 114 - Simulation Wizardry
Replies: 80
Views: 7612

114 Simulation Wizardry (infinite loop)

I'm getting an infinite loop on this one. The problem statement is totally unclear. It's easy to see how an infinite loop could be caused... but since I can't understand the problem description, I have no idea what's wrong. Is it possible to have a bumper on the edge, where I'm assuming there's a wa...
by Joe Smith
Mon Jul 22, 2002 5:57 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22687

Re: i fix my code... but ....

i fix my code but it still WA!! can you say more clear??? i find the smallest number and change Is there any thing i didn't consider??? [cpp] #include<stdio.h> int in[5000],input,time=0,ins,min=0; main() { int i,j; while(scanf(" %d",&input)==1) { time=0; for(i=0;i<input;i++) scanf(" %d",&in ); for(...
by Joe Smith
Mon Jul 22, 2002 5:38 pm
Forum: Volume 1 (100-199)
Topic: 188 - Perfect Hash
Replies: 9
Views: 5004

188 - Perfect Hash

I don't understand why I'm getting WA here. The problem desc. says exactly what to do and it works on all the input i've tried. Can anyone see the problem? (I know my split function is fine, and i added the long long just as an extra precaution.) [cpp] while (gets(buf)) { printf("%s\n", buf); vector...
by Joe Smith
Sun Jul 21, 2002 11:36 pm
Forum: Volume 103 (10300-10399)
Topic: 10319 - Manhattan
Replies: 9
Views: 5747

I'm working with this problem now. I did use method similar with 2-SAT problem, (snip) I first construct a graph use following way: after that, I'll compute all reachbillity for all pair (i, j) then the final process is just to check whether each route can be assigned without any contridictions, if...
by Joe Smith
Tue Jul 16, 2002 9:37 pm
Forum: Volume 103 (10300-10399)
Topic: 10325 - The Lottery
Replies: 14
Views: 5994

A few things, dunno if these will help: 1. Shouldn't you be reading from stdin/stdout instead of those files? (I don't know, I don't use Pascal for my solutions.) 2. Your algorithm doesn't look correct to me, but I don't think I really understand what you're trying to do in it. There was a good hint...
by Joe Smith
Tue Jul 16, 2002 8:59 pm
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 32346

f(-1) is just undefined, period. It's not infinity, gogolplex, or anything; just undefined, period. That's because the factorial function f(n) is only defined for n={0,1,2,3,...}. The reasoning that f(-1) should be infinity, because C(4,5) should be 0 is faulty, because C(4,5) is undefined, not zer...
by Joe Smith
Tue Jul 09, 2002 6:43 am
Forum: Volume 101 (10100-10199)
Topic: 10101 - Bangla Numbers
Replies: 122
Views: 27929

Re: What is wrong? HELP NEEDED

Could someone tell me what are the proper answers for the followin input data: 1000000 10000000000 1000000000000101 I have the following answers: 1. 10 lakh (3 spaces before '1.', no spaces after lakh) 2. 1 hajar kuti 3. 10 kuti kuti 1 shata 1 is this wrong? I got WA :( PLEASE HELP!!!!! :cry: No, t...
by Joe Smith
Sat Jul 06, 2002 5:31 pm
Forum: Volume 103 (10300-10399)
Topic: 10319 - Manhattan
Replies: 9
Views: 5747

Re: 10319 - Manhattan

I try to formulate this problem as a two-coloring problem. My idea is that I treat each pair of input point as a single node. And for each pair of node, if their desired paths may conflict, they are joined by an edge. Then I just check this graph to see if it is two-colorable. But this idea seems n...
by Joe Smith
Sat Jul 06, 2002 5:08 pm
Forum: Volume 103 (10300-10399)
Topic: 10316 - Airline Hub
Replies: 25
Views: 7687

Re: No

Compare the problem statement of Waterloo contest and 50th contest. There is a slight difference :) Thanks. The problem was a roundoff error... I added an epsilon check and got AC. But I don't understand why floating point tricks like this have to be introduced, they have nothing to do with the ori...
by Joe Smith
Sat Jul 06, 2002 7:45 am
Forum: Volume 103 (10300-10399)
Topic: 10316 - Airline Hub
Replies: 25
Views: 7687

10316 - Airline Hub

I keep getting WA and this is such a simple problem. My solution works fine on the judge's data from the original Waterloo contest, and my solution is basically identical to theirs (modified to take multiple cases and return the last airport if there's a tie).
by Joe Smith
Sat Jul 06, 2002 3:00 am
Forum: Volume 103 (10300-10399)
Topic: 10320 - Cow Trouble! Help Please!!
Replies: 27
Views: 9979

are you sure it's not just a compile error because of redefining M_PI (if you include math.h). this is a good solution and it's very much a spoiler This is strange -- I get AC now. The only thing I remember changing from my most recent WA was I factored out a M_PI... but maybe that did it. Or maybe...
by Joe Smith
Fri Jul 05, 2002 5:57 pm
Forum: Volume 103 (10300-10399)
Topic: 10320 - Cow Trouble! Help Please!!
Replies: 27
Views: 9979

Does anyone see anything obviously wrong with this, or do you think it's floating point fuzz? I'm getting WA, but all the test cases I've tried including the ones posted here come out correct to all 10 decimal places. [cpp] #define M_PI 2.0*acos(0) int main() { double l, w, R, x, y, a, b, c, d; whil...

Go to advanced search