結果

問題 No.92 逃走経路
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-03-17 09:27:09
言語 Ruby
(3.3.0)
結果
AC  
実行時間 369 ms / 5,000 ms
コード長 384 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 11,176 KB
実行使用メモリ 19,052 KB
最終ジャッジ日時 2023-08-25 03:07:52
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 172 ms
17,016 KB
testcase_01 AC 78 ms
15,284 KB
testcase_02 AC 78 ms
15,116 KB
testcase_03 AC 79 ms
15,140 KB
testcase_04 AC 81 ms
15,116 KB
testcase_05 AC 333 ms
15,444 KB
testcase_06 AC 219 ms
15,416 KB
testcase_07 AC 222 ms
15,240 KB
testcase_08 AC 82 ms
15,256 KB
testcase_09 AC 114 ms
19,052 KB
testcase_10 AC 369 ms
17,368 KB
testcase_11 AC 348 ms
17,344 KB
testcase_12 AC 363 ms
18,816 KB
testcase_13 AC 101 ms
17,220 KB
testcase_14 AC 110 ms
16,992 KB
testcase_15 AC 132 ms
17,972 KB
testcase_16 AC 131 ms
17,040 KB
testcase_17 AC 161 ms
17,080 KB
testcase_18 AC 172 ms
16,084 KB
testcase_19 AC 171 ms
15,984 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - k
Syntax OK

ソースコード

diff #

n,m,k=gets.split.map{|e| e.to_i}
g=n.times.map{[]}
m.times{
	a,b,c=gets.split.map{|e| e.to_i}
	a-=1
	b-=1
	g[a]<<[b,c]
	g[b]<<[a,c]
}
cs=gets.split.map{|e| e.to_i}
ans=n.times.map{|e| e.to_i}
hs={}
ans.each{|e|
	hs[e]=0	
}

cs.each{|e|
	hs2={}
	hs.keys.each{|e2|
		g[e2].each{|e3|
			if e3[1]==e
				hs2[e3[0]]=0
			end
		}
	}
	hs=hs2
}
puts hs.size
puts hs.keys.sort.map{|e| e+1}*" "
0