結果

問題 No.479 頂点は要らない
ユーザー cielciel
提出日時 2017-01-30 01:54:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 377 ms / 1,500 ms
コード長 223 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 24,420 KB
最終ジャッジ日時 2023-08-27 06:50:14
合計ジャッジ時間 9,308 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,204 KB
testcase_01 AC 83 ms
15,004 KB
testcase_02 AC 90 ms
15,304 KB
testcase_03 AC 86 ms
15,140 KB
testcase_04 AC 84 ms
15,200 KB
testcase_05 AC 86 ms
15,124 KB
testcase_06 AC 85 ms
15,088 KB
testcase_07 AC 86 ms
15,284 KB
testcase_08 AC 87 ms
15,108 KB
testcase_09 AC 86 ms
15,104 KB
testcase_10 AC 85 ms
15,112 KB
testcase_11 AC 86 ms
15,276 KB
testcase_12 AC 86 ms
15,040 KB
testcase_13 AC 84 ms
15,244 KB
testcase_14 AC 85 ms
14,996 KB
testcase_15 AC 84 ms
15,192 KB
testcase_16 AC 82 ms
15,200 KB
testcase_17 AC 82 ms
15,136 KB
testcase_18 AC 85 ms
15,232 KB
testcase_19 AC 85 ms
15,288 KB
testcase_20 AC 83 ms
15,296 KB
testcase_21 AC 84 ms
15,196 KB
testcase_22 AC 87 ms
15,000 KB
testcase_23 AC 85 ms
15,144 KB
testcase_24 AC 87 ms
15,244 KB
testcase_25 AC 86 ms
15,236 KB
testcase_26 AC 371 ms
24,420 KB
testcase_27 AC 377 ms
24,232 KB
testcase_28 AC 259 ms
17,976 KB
testcase_29 AC 298 ms
21,032 KB
testcase_30 AC 298 ms
20,748 KB
testcase_31 AC 309 ms
21,076 KB
testcase_32 AC 300 ms
21,952 KB
testcase_33 AC 278 ms
20,152 KB
testcase_34 AC 295 ms
21,516 KB
testcase_35 AC 259 ms
18,496 KB
testcase_36 AC 187 ms
16,500 KB
testcase_37 AC 301 ms
21,676 KB
testcase_38 AC 257 ms
19,908 KB
testcase_39 AC 213 ms
18,672 KB
testcase_40 AC 251 ms
19,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
h=Hash.new{|h,k|h[k]=[]}
n,m=gets.split.map(&:to_i)
m.times{
	a,b=gets.split.map(&:to_i)
	h[b]<<a
}
r=[0]*n
(n-1).downto(0){|i|
	next if r[i]==1
	h[i].each{|e|
		r[e]=1
	}
}
puts r.reverse.join.sub(/^0+/,'')
0