Hatena::Grouptopcoder

naoya_t@topcoder RSSフィード

2009-05-12

SRM440

22:39 | SRM440 - naoya_t@topcoder を含むブックマーク はてなブックマーク - SRM440 - naoya_t@topcoder SRM440 - naoya_t@topcoder のブックマークコメント

05.12.2009

続きを読む

トラックバック - https://topcoder-g-hatena-ne-jp.jag-icpc.org/n4_t/20090512

2009-05-06

トラックバック - https://topcoder-g-hatena-ne-jp.jag-icpc.org/n4_t/20090506

2009-05-05

SRM207 Div2 Hard: CaptureThemAll

| 21:05 | SRM207 Div2 Hard: CaptureThemAll - naoya_t@topcoder を含むブックマーク はてなブックマーク - SRM207 Div2 Hard: CaptureThemAll - naoya_t@topcoder SRM207 Div2 Hard: CaptureThemAll - naoya_t@topcoder のブックマークコメント

Algorithm Tutorials: How To Find a Solution (by Dumitru) より

Problem hints: At first sight this may seem like dynamic programming or backtracking. But as always, take a look into the text of the statement. After a while you should observe the following things:

  • A table is given.
  • The knight can jump from one cell to some of its neighbors.
  • The cost of passing from a cell to another is always 1 (just one jump).
  • You need to find the minimum number of steps (jumps).

Given this information we can see that the problem can be easily solved by the help of BFS. Don't get confused by the fact that connected points are represented by unconnected cells. Think of cells as points in a graph, or states (whatever you want) - and in order to pass from one point to another, the knight should be able to jump from the first to the second point.

Notice again that the most revealing hint about the BFS solution is the cost of 1 for any jump.

「ジャンプのコストが全て1」→BFSで解けるよというあからさまなヒント

続きを読む

トラックバック - https://topcoder-g-hatena-ne-jp.jag-icpc.org/n4_t/20090505

2009-05-01

SRM439

11:58 | SRM439 - naoya_t@topcoder を含むブックマーク はてなブックマーク - SRM439 - naoya_t@topcoder SRM439 - naoya_t@topcoder のブックマークコメント

04.30+.2009

続きを読む

トラックバック - https://topcoder-g-hatena-ne-jp.jag-icpc.org/n4_t/20090501

2009-04-29

SRM233 Div1 Easy: PipeCuts

| 04:15 | SRM233 Div1 Easy: PipeCuts - naoya_t@topcoder を含むブックマーク はてなブックマーク - SRM233 Div1 Easy: PipeCuts - naoya_t@topcoder SRM233 Div1 Easy: PipeCuts - naoya_t@topcoder のブックマークコメント

SRMのEasy問題にも手を出した

続きを読む

トラックバック - https://topcoder-g-hatena-ne-jp.jag-icpc.org/n4_t/20090429