Search found 16 matches
- Sun May 21, 2006 9:48 pm
- Forum: Volume 1 (100-199)
- Topic: 128 - Software CRC
- Replies: 62
- Views: 9120
this is a horrible problem
Try using unsigned int instead of int. 34942 << 16 = overflow
- Mon Aug 15, 2005 4:10 am
- Forum: Volume 7 (700-799)
- Topic: 775 - Hamiltonian Cycle
- Replies: 11
- Views: 3591
775 - Hamiltonian Cycle
Hi, I am trying to solve 775 using simple backtracking. I've also tried pruning using BFS to make sure there was still a path back to the start vertex at each step. I am getting TLE.. please help! ;) Thanks, - Andrew #include <iostream> #include <map> #include <stdio.h> #include <set> using namespac...
- Wed Aug 10, 2005 6:33 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10487 - Closest Sums
- Replies: 89
- Views: 32362
- Wed Aug 10, 2005 10:01 am
- Forum: Volume 104 (10400-10499)
- Topic: 10487 - Closest Sums
- Replies: 89
- Views: 32362
10487 WA
Hrrrmmm. Why am I getting WA? I've read all the other posts for this problem.. nothing helps 
Thanks! 
- Andrew

Code: Select all
code removed after AC :)

- Andrew
- Mon Aug 08, 2005 6:58 am
- Forum: Volume 8 (800-899)
- Topic: 824 - Coast Tracker
- Replies: 8
- Views: 6408
Jan, I don't think your sample input makes sense. For instance, your first test case looks like this: 110 011 110 with direction = 4. However, this is impossible - the direction must be 5 (giving a previous square of [0,2]). If the direction were indeed 4 then we would have a non-optimal previous sq...
- Sat Jul 30, 2005 10:07 am
- Forum: Volume 100 (10000-10099)
- Topic: 10054 - The Necklace
- Replies: 62
- Views: 33252
Hi Deneb I had much troubles with this part, and that's what makes my code so ugly and so slow :oops: The algorithm is as follows : /* I don't mention global variables used to mark the cycles and to store the eulerian cycle */ /* direct_cycle is the direct cycle you're processing */ construct_euler...
- Thu Jul 07, 2005 8:53 am
- Forum: Volume 100 (10000-10099)
- Topic: 10029 - Edit Step Ladders
- Replies: 70
- Views: 22952
10029 help! TLE
Hi, I've read the other posts on 10029, and from what I've read it seems to me my implementation should work. I think the culprit may be in my calcVariations() function, where I generate all possible edit steps for a string.. maybe STL string is too slow for this? In any case, I wrote my own linked ...
- Fri Jul 01, 2005 11:14 am
- Forum: Volume 105 (10500-10599)
- Topic: 10553 - Treasure Map
- Replies: 24
- Views: 7394
Hi!
I'm also having trouble with this problem. I got the solution for the sample input no problem, and also managed to calculate 1.29 for this testcase: 2 NE 2 S 1 -90 I'm pretty sure the problem is something to do with the way I handle angles.. I probably put too much faith in c++ trigonometric functio...
- Thu Jun 23, 2005 6:34 am
- Forum: C++
- Topic: Sorting arrays of pointers using <algorithm> sort()
- Replies: 1
- Views: 1614
Sorting arrays of pointers using <algorithm> sort()
Hi everyone! My question is pretty straightforward: I have an array of pointers that I would like to sort using the sort() function prvoided in <algorithm>. If it was an array of objects, I would do the following: #include <algorithm> struct s { const bool operator<(const s other) const { return tru...
- Sun Apr 18, 2004 10:35 am
- Forum: Volume 101 (10100-10199)
- Topic: 10160 - Servicing Stations
- Replies: 20
- Views: 14012
- Thu Apr 15, 2004 9:47 am
- Forum: Volume 101 (10100-10199)
- Topic: 10160 - Servicing Stations
- Replies: 20
- Views: 14012
- Tue Apr 13, 2004 8:23 am
- Forum: Volume 101 (10100-10199)
- Topic: 10160 - Servicing Stations
- Replies: 20
- Views: 14012
- Tue Dec 23, 2003 4:27 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10247 - Complete Tree Labeling
- Replies: 2
- Views: 3623
10247 - Complete Tree Labeling
Hi, I've been working on 10247, but I keep getting alternations between WA and TLE from our dear pal the judge. My program seems to work for the sample inputs. I also ran some other inputs on the program, and here's what I got: 3 6: 1562426428985838116716663847602053919993687706682744920691775 87449...
- Tue Dec 23, 2003 4:09 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10254 - The Priest Mathematician
- Replies: 10
- Views: 5832
Hi, I get the right answer for n = 64 and n = 28, but when I type in n = 9876 I get: 6964824117983874234650500427748868209542865000190576981818345 9167875096365227972472038355305206881965379346125792003500964 48775287769802767937463111146298807126530166456649252977 Some other test values I tried: n ...