結果
| 問題 |
No.92 逃走経路
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-03 00:02:19 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 330 ms / 5,000 ms |
| コード長 | 396 bytes |
| コンパイル時間 | 78 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2024-11-22 14:23:24 |
| 合計ジャッジ時間 | 4,966 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
Main.rb:8: warning: assigned but unused variable - starts Syntax OK
ソースコード
N, M, K = gets.split.map &:to_i
edges = []
M.times.map{
a, b, c = gets.split.map &:to_i
edges << [a, b, c] << [b, a, c]
}
tollages = gets.split.map &:to_i
starts = []
checked = [true] * -~N
tollages.each{|tollages|
nxt = [false] * -~N
edges.each{|a, b, c|
nxt[b] = true if checked[a] && c == tollages
}
checked = nxt
}
p checked.count(true)
puts (1..N).select{|i|checked[i]}*" "