Search found 25 matches

by jdmetz
Tue Jul 19, 2005 7:52 pm
Forum: Volume 106 (10600-10699)
Topic: 10608 - Friends
Replies: 75
Views: 26694

what is wrong with your code

You need to move all of b's friends to a's group or the other way, not just b or a:

Input:

Code: Select all

1
10 5
1 2
2 3
4 5
5 7
3 4
Output:

Code: Select all

6
by jdmetz
Thu Jul 14, 2005 8:18 pm
Forum: Other words
Topic: e-mail submissions not working?
Replies: 3
Views: 1553

e-mail submissions not working?

I have been submitting problems regularly for the past few weeks, but suddenly I get an e-mail back saying: Subject: PLEASE, SUBMIT ONLY FROM THE WEB Dear jdmetz: You only can submit problems from the web. Please see http://acm.uva.es/problemset/submit.php (or use alternatives like http://acm.uva.es...
by jdmetz
Thu Jul 14, 2005 1:18 pm
Forum: Volume 102 (10200-10299)
Topic: 10208 - Liar or Not Liar that is the...
Replies: 13
Views: 2931

some input to try

If you are still having trouble, try these input. Input: 884! 7816782! 9999991 9999971 9999965 9999895 9999819 9999729 9840769 9728161 Output: He is a liar. 11 23 67 79 151 163 167 223 227 239 251 263 271 283 443 463 467 479 487 491 499 503 523 547 563 571 587 599 607 619 631 643 647 659 683 691 719...
by jdmetz
Tue Jul 12, 2005 8:07 pm
Forum: Volume 101 (10100-10199)
Topic: 10189 - Minesweeper
Replies: 418
Views: 66760

indexing off the edges

Why don't you worry about the boundaries? Won't your code fail on the second of these two cases:

Code: Select all

4 4
****
****
****
****

3 3
...
...
...
by jdmetz
Tue Jul 12, 2005 7:03 pm
Forum: Volume 101 (10100-10199)
Topic: 10180 - Rope Crisis in Ropeland!
Replies: 39
Views: 21498

try getting rid of your epsilon

Ok - arif_pasha, I looked at your code, and I think your epsilon is too big. Try getting rid of it. At the limit when the line is just touching the circle, both methods should give the same answer, so I don't think you need to use an epsilon in that case. Here is a case that your code gives the wron...
by jdmetz
Mon Jul 11, 2005 4:21 pm
Forum: Volume 101 (10100-10199)
Topic: 10180 - Rope Crisis in Ropeland!
Replies: 39
Views: 21498

arif_pasha, my AC program gets the same results as you. I used doubles, and no epsilon by the way. Here are some more test cases. Input: 6 10.314 0 10.314 0 1.01 1.0 0 -1 0.0 1.0000 0 10000.00 0.0 -10000.0 10000 9999.9999885733332 0.0 -9999.9999885733332 0.0 9999.9999885733332 9999.9999885733333 0.0...
by jdmetz
Sun Jul 10, 2005 3:45 am
Forum: Volume 5 (500-599)
Topic: 587 - There's treasure everywhere!
Replies: 37
Views: 2614

sqrt and long double

sqrt() returns a double, not a long double, so you are printing a garbage distance. Use %.3lf for the distance printing.

Also, your SE comparison has a syntax error o the line following it:
(/x=x
should be just
(x=x
by jdmetz
Sat Jul 09, 2005 4:43 pm
Forum: Volume 5 (500-599)
Topic: 574 - Sum It Up
Replies: 46
Views: 13974

problem limits

n is always <= 12
t is always < 1000

These are as the problem statement says.

But, one of the xi is 999 (not < 100 as the problem says).

I tested using my AC solution.

It passes with exit conditions on n > 12, t >= 1000, and xi >= 1000. But, it fails with exit on n > 12, t >= 1000, and xi >= 999.
by jdmetz
Tue Jun 21, 2005 9:23 pm
Forum: Volume 3 (300-399)
Topic: 314 - Robot
Replies: 30
Views: 6455

here are some test cases

Notes: - It wasn't clear to me from the problem, but you cannot travel on the edges. - Note that coordinates are row col (y x) Here is some sample input: 9 10 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0...
by jdmetz
Tue May 31, 2005 11:41 pm
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10485

Re: WA, but I can't think of any reason...

/* no round off */ min_d *= 10000; min_d = (double)((long)min_d); min_d /= 10000; printf("%.4lf\n", min_d); Why do you assume no round off? If fixing the bug below doesn't work, I'd try changing this assumption. if (lfabs(p1->x-p2->y) >= MAX_DIST || lfabs(p1->y-p2->y) >= MAX_DIST) I think you want ...

Go to advanced search