結果
問題 | No.2565 はじめてのおつかい |
ユーザー | chaemon |
提出日時 | 2023-12-02 15:55:21 |
言語 | Nim (2.0.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 17,941 bytes |
コンパイル時間 | 5,216 ms |
コンパイル使用メモリ | 97,024 KB |
実行使用メモリ | 22,400 KB |
最終ジャッジ日時 | 2024-09-26 19:31:55 |
合計ジャッジ時間 | 11,815 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | WA | - |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 25 ms
10,240 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | AC | 2 ms
5,376 KB |
testcase_52 | AC | 56 ms
22,400 KB |
ソースコード
import macros macro Please(x): untyped = nnkStmtList.newTree() Please use Nim-ACL Please use Nim-ACL Please use Nim-ACL static: when not defined SecondCompile: # md5sum: c62ab7188ee9e241288b9d026866f3b4 atcoder.tar.xz template getFileName():string = instantiationInfo().filename let fn = getFileName() block: let (output, ex) = gorgeEx("if [ -e ./atcoder ]; then exit 1; else exit 0; fi") # doAssert ex == 0, "atcoder directory already exisits" discard staticExec("echo \"/Td6WFoAAATm1rRGAgAhARwAAAAQz1jM4Rf/LyJdADCdCIqmAHyeLmzPetXzWpgQcDgKgJF+nO8CaeoEXtWHsMtPznZpwqZnCfBX34tNap7+vguShs6H5M4l4TrXWvRyILjNbf2TvtX+4VdI1M+xv6dhFpt8EJNsoefJPb+4ljL10FZACNHmoSOeZHqN6N84E9/W5dwZFMM4vAkCJiYaMY656WrJ6h6HD3QF5GEmevKK50rYEXoViGn3ELYljRMWp7/LqVLHgtnnB9GdscLQ6O10H4pIWplTKLMPvKzGq6qoqeojV+Tj8tuDqYaH6blActwX3Fqs2NDDkdclXHmB3NnQp35b2jy8w7H+EVp0+PvS3uk5IHq22fNaAdZbJ5NzWtzCeCn2PzCN4D/q60iJ+KplnqznGVKrOe6J1+LfG5j9gYqUn6zTl2IBTp38xqECGLrLohU3gQ1IfzmiIiWZIdAldoIJVB3YqyiSwIe66vF1N1+/z2OGNV7ODSTVWSgOrj4UkW2cuRQk5YGAHYcZSBLbJH0uq5D3OQ59aRwarATpnj2UCTDijD9WN+Rve7mw85607a/u87UFoYLdHzatvlTEOROf1YW0k/hf2gfiAb0Ry3AYTAnBwuaNHi/RM5VTb6RiPpOxeIjjeQwG1v6Z5JBk7mYT0w1shQVigu9SRgTNJHsAhW3sY10WtkRcrwU7mxMF8RiVAIlXD9H9VAOp7zupCslbNQ9vOm62stlD0w6fEor+0bCFORvkFEPtDwNEHAWc27omUE70zcj3DEkNkHDY4XWuz9fZZ9uI5/gZ2D8d5I6na3R2v/O1LQRdPQM52SJ8UE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9BV2EvLbyiD5bIxkbPqm7iGJL9hVuKDwFwaTUYkUX0LXYxjgcoJYybiJLjEfZG5pScC6SmP1dE0lH4cf7BaR85Z2Uff86kUBOELGO3if7T2zq24WFUSSij5zwAXY6mKSjy2UURnkbDH17Qz3wL9eEocXtvHsSNHQmQHf04CYt+40XZHopkARBIas/JSaUrMfo4FUQ3xyUirvm0LcL0/IQgLYkMhcsAGyv2n32vDwhgcSBT6SfCAAAAAK1ZIucY0xLXAAG+XoCwBABdWt0oscRn+wIAAAAABFla\" | base64 -d > atcoder.tar.xz && tar -Jxvf atcoder.tar.xz") let (output, ex) = gorgeEx("nim cpp -d:release -d:SecondCompile -d:danger --path:./ --opt:speed --multimethods:on --warning[SmallLshouldNotBeUsed]:off --checks:off -o:a.out " & fn) discard staticExec("rm -rf ./atcoder");doAssert ex == 0, output;quit(0) when defined SecondCompile: const DO_CHECK = false;const DEBUG = false else: const DO_CHECK = true;const DEBUG = true const USE_DEFAULT_TABLE = true DO_TEST = false # see https://github.com/zer0-star/Nim-ACL/tree/master/src/atcoder/extra/header/chaemon_header.nim include atcoder/extra/header/chaemon_header # see https://github.com/zer0-star/Nim-ACL/tree/master/src/atcoder/extra/graph/graph_template.nim import atcoder/extra/graph/graph_template # see https://github.com/zer0-star/Nim-ACL/tree/master/src/atcoder/extra/graph/dijkstra.nim import atcoder/extra/graph/dijkstra proc solve() = let N, M = nextInt() var g = initGraph(N) for _ in M: let u, v = nextInt() - 1 g.addBiEdge(u, v) var d0 = g.dijkstra(0) d1 = g.dijkstra(N - 2) d2 = g.dijkstra(N - 1) ans = int.inf ans.min= d0[N - 2] + d1[N - 1] + d2[0] ans.min= d0[N - 1] + d2[N - 2] + d1[0] echo ans discard solve()