What's a good way to hash? I use STL's <set>, but gets TLE. Should I write my own hash class?
I also use STL's<set>, but it is not enough; notice this
2. heuristic to estimate if a knight will meet other knight on the board, if it won't meet other, just add the number of it's reachable sqaure ...
Search found 16 matches
- Wed Oct 20, 2004 5:43 am
- Forum: Volume 107 (10700-10799)
- Topic: 10748 - Knights Roaming
- Replies: 16
- Views: 7814
- Tue Oct 19, 2004 4:37 pm
- Forum: Volume 107 (10700-10799)
- Topic: 10748 - Knights Roaming
- Replies: 16
- Views: 7814
May i see you code? I can not imagine yours is so fast!.. wrote:My idea is first dump out all the reachable squares by each knight, then use sorting to deduplicate. You can use other method to deduplicate.
Sorting is not fastet method, but it is quite easy to code.
Please send to wiltord@eyou.com, thanks!
- Tue Oct 19, 2004 11:38 am
- Forum: Volume 107 (10700-10799)
- Topic: 10748 - Knights Roaming
- Replies: 16
- Views: 7814
- Tue Oct 19, 2004 11:37 am
- Forum: Volume 107 (10700-10799)
- Topic: 10748 - Knights Roaming
- Replies: 16
- Views: 7814
- Tue Oct 19, 2004 11:15 am
- Forum: Volume 107 (10700-10799)
- Topic: 10745 - Dominant Strings
- Replies: 38
- Views: 23145
I don't know how to implement the trie, But get AC with divide and conquer algorithm. Divide the string set to two parts, then gets the dominant strings in the two parts respectively with recursion, i call the results as candidate dominant strings of part1 and candidate dominant strings of part2 ...
- Thu Dec 25, 2003 5:35 pm
- Forum: Volume 2 (200-299)
- Topic: 210 - Concurrency Simulator
- Replies: 16
- Views: 8518
Re: 210 - Concurrency Simulator
A is in the ready queue....A then executes an unlock statement.
Hi, junbin. I think you don't really understand the states of a program.
In this problem, a program may be in three states, running(being processed by cpu),waiting(in the ready queue),blocked(in the blocked queue). So,if A is in the ...
Hi, junbin. I think you don't really understand the states of a program.
In this problem, a program may be in three states, running(being processed by cpu),waiting(in the ready queue),blocked(in the blocked queue). So,if A is in the ...
- Wed Dec 03, 2003 12:39 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
I' got AC :lol: ;following is my approach:
First,use BFS to know whether there is a path from source to destination.If it exists,record the length,and if it is prime,then that is the result,otherwise it is the min composite number,in this case, we shall goto IDS procedure.
Then,I use IDS to search ...
First,use BFS to know whether there is a path from source to destination.If it exists,record the length,and if it is prime,then that is the result,otherwise it is the min composite number,in this case, we shall goto IDS procedure.
Then,I use IDS to search ...
- Wed Dec 03, 2003 11:07 am
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
- Wed Dec 03, 2003 10:02 am
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
- Tue Dec 02, 2003 4:12 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
10463 Aztec knights how to avoid tle
who can help me? I can't really find an effective way to avoid tle. thanks before.
- Mon Dec 01, 2003 4:20 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
I run a IDS (Iterative Deepening Search) keeping track of the cells I visit while searching within a certain depth. If this track is kept, then we are not going to explore the cells in that depth again if it leads to unsuccessful searches
please tell me more specificly,how to do with the keeping ...
please tell me more specificly,how to do with the keeping ...
- Mon Dec 01, 2003 11:25 am
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
- Mon Dec 01, 2003 6:21 am
- Forum: Volume 104 (10400-10499)
- Topic: 10463 - Aztec Knights
- Replies: 35
- Views: 14482
10463 Aztec knights
how to understand the second data set in the sample. i can't find a two steps move from (0,0) to (4,4).
- Mon Dec 01, 2003 5:53 am
- Forum: Volume 104 (10400-10499)
- Topic: 10457 - Magic Car
- Replies: 20
- Views: 12920
- Fri Nov 28, 2003 6:54 am
- Forum: Volume 104 (10400-10499)
- Topic: 10457 - Magic Car
- Replies: 20
- Views: 12920