Search found 16 matches

by wiltord
Wed Oct 20, 2004 5:43 am
Forum: Volume 107 (10700-10799)
Topic: 10748 - Knights Roaming
Replies: 16
Views: 5758

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 direc...
by wiltord
Tue Oct 19, 2004 4:37 pm
Forum: Volume 107 (10700-10799)
Topic: 10748 - Knights Roaming
Replies: 16
Views: 5758

.. 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.
May i see you code? I can not imagine yours is so fast!
Please send to wiltord@eyou.com, thanks!
by wiltord
Tue Oct 19, 2004 11:38 am
Forum: Volume 107 (10700-10799)
Topic: 10748 - Knights Roaming
Replies: 16
Views: 5758

I don't know how you can come up with 100 000000 such a big number. Consider we have 50 knights where every one can walk 50 steps. Maximum number of covered square < 50 x 35000 = 1750000 Even you sort all the 1750000 squares in a qsort, the number of operation should be < 1 0000000 (although this i...
by wiltord
Tue Oct 19, 2004 11:37 am
Forum: Volume 107 (10700-10799)
Topic: 10748 - Knights Roaming
Replies: 16
Views: 5758

I don't know how you can come up with 100 000000 such a big number. Consider we have 50 knights where every one can walk 50 steps. Maximum number of covered square < 50 x 35000 = 1750000 Even you sort all the 1750000 squares in a qsort, the number of operation should be < 1 0000000 (although this i...
by wiltord
Tue Oct 19, 2004 11:15 am
Forum: Volume 107 (10700-10799)
Topic: 10745 - Dominant Strings
Replies: 38
Views: 16975

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. Th...
by wiltord
Thu Dec 25, 2003 5:35 pm
Forum: Volume 2 (200-299)
Topic: 210 - Concurrency Simulator
Replies: 16
Views: 4514

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 re...
by wiltord
Wed Dec 03, 2003 12:39 pm
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

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 t...
by wiltord
Wed Dec 03, 2003 11:07 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

sohel wrote: I used IDS.
Do you use 2,3,5,7 as the threshold and simplily do IDS?
by wiltord
Wed Dec 03, 2003 10:02 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

I also tried BFS,but still tle. Anything else I should do?
by wiltord
Tue Dec 02, 2003 4:12 pm
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

10463 Aztec knights how to avoid tle

who can help me? I can't really find an effective way to avoid tle. thanks before.
by wiltord
Mon Dec 01, 2003 4:20 pm
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

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 tr...
by wiltord
Mon Dec 01, 2003 11:25 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

I have found the way now,it is really i misunderstood the move rules.thank you! 8) [/quote][/cpp]
by wiltord
Mon Dec 01, 2003 6:21 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11059

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).
by wiltord
Mon Dec 01, 2003 5:53 am
Forum: Volume 104 (10400-10499)
Topic: 10457 - Magic Car
Replies: 20
Views: 10673

I have found the so called sophisticated structure in <<introduction to algorithms>>,open my eyes. :D
by wiltord
Fri Nov 28, 2003 6:54 am
Forum: Volume 104 (10400-10499)
Topic: 10457 - Magic Car
Replies: 20
Views: 10673

Alexander Grushetsky wrote: And for each step I use Dijkstra with complexity E*logV.
how could Dijkstra be complexity of E*logV?

Go to advanced search