結果
| 問題 | 
                            No.92 逃走経路
                             | 
                    
| コンテスト | |
| ユーザー | 
                             horiesiniti
                         | 
                    
| 提出日時 | 2018-03-17 09:27:09 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 389 ms / 5,000 ms | 
| コード長 | 384 bytes | 
| コンパイル時間 | 86 ms | 
| コンパイル使用メモリ | 7,552 KB | 
| 実行使用メモリ | 16,512 KB | 
| 最終ジャッジ日時 | 2024-12-23 15:11:56 | 
| 合計ジャッジ時間 | 5,114 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 | 
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - k Syntax OK
ソースコード
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}*" "
            
            
            
        
            
horiesiniti