結果
問題 | No.1065 電柱 / Pole (Easy) |
ユーザー | 6soukiti29 |
提出日時 | 2020-05-30 16:37:16 |
言語 | Nim (2.0.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,251 bytes |
コンパイル時間 | 3,363 ms |
コンパイル使用メモリ | 72,668 KB |
実行使用メモリ | 52,228 KB |
最終ジャッジ日時 | 2023-08-07 15:26:57 |
合計ジャッジ時間 | 7,986 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
52,228 KB |
testcase_01 | AC | 16 ms
13,388 KB |
testcase_02 | AC | 186 ms
25,096 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
コンパイルメッセージ
/home/judge/data/code/Main.nim(52, 30) Warning: Number of spaces around '+' is not consistent [Spacing]
ソースコード
import sequtils,strutils,math,heapqueue type sen = tuple[b : int, d : float64 ] t = tuple[cost : float64, p : int] var N, M : int X, Y : int p,q : int dentyuu = newSeq[array[2,int]](0) densen = newSeqWith(200010, newSeq[sen](0)) hyou : array[200010, float64] (N, M) = stdin.readline.split.map(parseInt) (X, Y) = stdin.readline.split.map(parseInt) X -= 1 Y -= 1 for n in 1..N: (p,q) = stdin.readline.split.map(parseInt) dentyuu.add([p, q]) for m in 1..M: (p, q) = stdin.readline.split.map(parseInt) p -= 1 q -= 1 var dx : float = (dentyuu[p][0] - dentyuu[q][0]).float var dy : float = (dentyuu[p][1] - dentyuu[q][1]).float dx = dx * dx dy = dy * dy var d = sqrt(dx + dy) var l : sen = (q, d) densen[p].add(l) l = (p, d) densen[q].add(l) for i in 0..200000: hyou[i] = 1e10 proc `<` (a, b : t) : bool = a.cost > b.cost var hp = initHeapQueue[t]() var i : t = (0.0, X) hp.push(i) while(hp).len > 0: var P = hp.pop() if hyou[P.p] < P.cost: continue hyou[P.p] = P.cost for s in densen[P.p]: if hyou[s[0]] >= s[1] + hyou[P.p]: hp.push((s[1] + hyou[P.p], s[0])) hyou[s[0]] = s[1]+ hyou[P.p] echo hyou[Y]