changing my floats to doubles solved it!! if anyone has the same pb, take this hint!
nice problem.
Search found 112 matches
- Sat Jul 08, 2006 8:45 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10012 - How Big Is It?
- Replies: 26
- Views: 14531
- Sat Jul 08, 2006 7:34 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10012 - How Big Is It?
- Replies: 26
- Views: 14531
- Tue Aug 16, 2005 10:56 am
- Forum: Volume 103 (10300-10399)
- Topic: 10344 - 23 out of 5
- Replies: 81
- Views: 36739
- Sun Aug 14, 2005 6:30 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10344 - 23 out of 5
- Replies: 81
- Views: 36739
- Sun Aug 14, 2005 10:52 am
- Forum: Volume 103 (10300-10399)
- Topic: 10344 - 23 out of 5
- Replies: 81
- Views: 36739
- Sat Aug 13, 2005 3:44 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10344 - 23 out of 5
- Replies: 81
- Views: 36739
hello frankhuhu, i have compiled your code and compared its output with mine or 10,000 random test cases. both programs produce exactly the same output. also i tested with 0's and they still behave the same. i have also modified my code to print the operation (when possible) and check it, and found ...
- Sat Aug 13, 2005 11:28 am
- Forum: Volume 103 (10300-10399)
- Topic: 10344 - 23 out of 5
- Replies: 81
- Views: 36739
i don't know if it's of any interest, but take a look at this case: 1 2 3 4 35 (((1 - 4) - 3) * 2) + 35 = 23 here you get negative numbers along the way. also, if you add the restriction that all results must be positive, then there is no solution. unfortunately, i submitted the modified code and st...
- Sat Aug 13, 2005 10:52 am
- Forum: Volume 103 (10300-10399)
- Topic: 10344 - 23 out of 5
- Replies: 81
- Views: 36739
hello, i'm having trouble with this problem as well. i use recursion, so i work things in reverse order from you. my code is much shorter too but i cant see where the problem is. #include <stdio.h> int possible(int *t, int len, int res) { int i, j, tmp; if (len == 1) return (*t == res); len--; for (...
- Tue Jul 27, 2004 2:34 pm
- Forum: Volume 1 (100-199)
- Topic: 164 - String Computer
- Replies: 120
- Views: 20933
hello, i solved this problem a long time ago. someone suggested your string should not exceed the maximum length (20 i think) at any moment. this might be true. some other people talked about the judge only accepting backtracking in a certain order (DCI or whatever). i dont think so. maybe their bac...
- Tue Jul 27, 2004 2:11 pm
- Forum: Volume 2 (200-299)
- Topic: 256 - Quirksome Squares
- Replies: 30
- Views: 8186
- Mon Jul 26, 2004 8:41 pm
- Forum: Volume 2 (200-299)
- Topic: 256 - Quirksome Squares
- Replies: 30
- Views: 8186
NO NO NO
NO NO NO precomputation is lame, and you may have noticed that NO problem here requires it. about this one, i have lost my sources unfortunately, but i just remembered how i solved it. there is indeed a very easy and fast solution that doesnt require brute force. or rather, yes, you might call it a ...
- Fri Apr 16, 2004 5:54 am
- Forum: Volume 106 (10600-10699)
- Topic: 10626 - Buying Coke
- Replies: 23
- Views: 17675
haha i just got accepted, that was a silly mistake!!! i'm glad i finally solved this problem. miras: 2 1 0 0 is not a valid input, you cannot encounter such an input, because it is guaranteed that you have enough money to buy to cokes... so for 2 cokes you'd have at least 16 units. on a side note, i...
- Fri Apr 16, 2004 5:30 am
- Forum: Volume 106 (10600-10699)
- Topic: 10626 - Buying Coke
- Replies: 23
- Views: 17675
- Wed Nov 05, 2003 6:30 pm
- Forum: Volume 1 (100-199)
- Topic: 116 - Unidirectional TSP
- Replies: 226
- Views: 60353
- Sun Oct 26, 2003 8:02 pm
- Forum: Volume 1 (100-199)
- Topic: 193 - Graph Coloring
- Replies: 93
- Views: 33127
this problem is a bit harder than it seems. you have a test different possibilities (not all though) it might be a good idea to first color nodes that have a lot of connections. i found the following: 1) if a node is connected to a black node, it has to be white. otherwise: 2) if a node is connected...