Search found 9 matches
- Mon Jan 31, 2005 2:31 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 183040
- Tue Dec 21, 2004 4:38 am
- Forum: Algorithms
- Topic: USACO help again
- Replies: 5
- Views: 1935
- Mon Dec 20, 2004 3:38 pm
- Forum: Algorithms
- Topic: Deikstra with heap
- Replies: 5
- Views: 1766
Ah, thank you for the clearup. As for time complexity, I am aware that it is O(mlogn), but the OP referenced an O(nlogn) solution so I was just trying to be consistant in illustrating the difference in the algorithms (although I was wrong about the vector<> not being used as a heap structure, as I m...
- Mon Dec 20, 2004 1:21 pm
- Forum: Algorithms
- Topic: Finding stuff within a grid - aproaches
- Replies: 3
- Views: 1198
Be careful that you check for out-of bounds when you implement a dfs or bfs. Also, this problem can actually be implemented without a complicated algorithm (and is easier to code). Here is the explanation for only diagonal checks. Say there are two pieces named a and b, and you are trying to see wha...
- Mon Dec 20, 2004 1:11 pm
- Forum: Algorithms
- Topic: Deikstra with heap
- Replies: 5
- Views: 1766
That implementation of Dijsktra's algorithm is not O(nlgn) since you are using a vector instead of a heap to store your data (it is O(n^2)). You can implement this correctly with a heap using the normal priority_queue data structure, but multiply all costs by -1 so that the heap is sorted correctly....
- Thu Oct 07, 2004 7:35 pm
- Forum: Volume 1 (100-199)
- Topic: 102 - Ecological Bin Packing
- Replies: 485
- Views: 49677
Re: I'm a little disappointed...
There are quite some questions that may have many equally good answers. 102 is an example. For instance: 1 2 3 4 5 6 7 8 9 All 6 possible assigning schemes - GBC, GCB, CBG, CGB, BCG, BGC - will non-exceptionally generate the same moves - 30! So these solutions should be equally treated as correct. ...
- Tue Oct 05, 2004 7:11 am
- Forum: Other words
- Topic: What's wrong with my stats ?
- Replies: 14
- Views: 3652
- Sat Oct 02, 2004 8:53 am
- Forum: Volume 1 (100-199)
- Topic: 111 - History Grading
- Replies: 135
- Views: 22155
- Wed Sep 29, 2004 11:40 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 183040
ice_mountain, It doesn't matter in what format you input/output your code, so long as your output is correct and your program runs in the time limit. Don't think of the judge as a person with a keyboard and monitor, but rather two completely seperate streams (like file input/output), in which the in...