結果

問題 No.479 頂点は要らない
ユーザー yutat93yutat93
提出日時 2017-02-06 19:44:38
言語 Ruby
(3.2.2)
結果
AC  
実行時間 391 ms / 1,500 ms
コード長 209 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 11,472 KB
実行使用メモリ 24,352 KB
最終ジャッジ日時 2023-08-27 05:16:59
合計ジャッジ時間 9,311 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,132 KB
testcase_01 AC 86 ms
15,108 KB
testcase_02 AC 83 ms
15,264 KB
testcase_03 AC 84 ms
15,148 KB
testcase_04 AC 83 ms
15,216 KB
testcase_05 AC 83 ms
15,252 KB
testcase_06 AC 84 ms
15,164 KB
testcase_07 AC 84 ms
15,204 KB
testcase_08 AC 83 ms
15,212 KB
testcase_09 AC 82 ms
15,216 KB
testcase_10 AC 82 ms
14,968 KB
testcase_11 AC 82 ms
15,080 KB
testcase_12 AC 83 ms
15,264 KB
testcase_13 AC 82 ms
15,236 KB
testcase_14 AC 83 ms
15,140 KB
testcase_15 AC 82 ms
15,208 KB
testcase_16 AC 83 ms
15,104 KB
testcase_17 AC 83 ms
15,248 KB
testcase_18 AC 83 ms
15,132 KB
testcase_19 AC 86 ms
15,076 KB
testcase_20 AC 86 ms
15,200 KB
testcase_21 AC 86 ms
14,972 KB
testcase_22 AC 87 ms
15,300 KB
testcase_23 AC 88 ms
15,248 KB
testcase_24 AC 86 ms
15,048 KB
testcase_25 AC 87 ms
15,252 KB
testcase_26 AC 377 ms
24,352 KB
testcase_27 AC 391 ms
24,212 KB
testcase_28 AC 260 ms
17,840 KB
testcase_29 AC 305 ms
20,944 KB
testcase_30 AC 307 ms
20,908 KB
testcase_31 AC 303 ms
20,804 KB
testcase_32 AC 309 ms
20,856 KB
testcase_33 AC 284 ms
19,984 KB
testcase_34 AC 309 ms
21,496 KB
testcase_35 AC 266 ms
18,620 KB
testcase_36 AC 180 ms
16,416 KB
testcase_37 AC 305 ms
21,548 KB
testcase_38 AC 267 ms
20,052 KB
testcase_39 AC 216 ms
18,920 KB
testcase_40 AC 244 ms
19,660 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
h=Hash.new{|h,k| h[k]=[]}
m.times{
  a,b=gets.split.map &:to_i
  h[b]<<a
}
a=[0]*n

(n-1).downto(0){|i|
  next if a[i]==1
  h[i].each{|e| a[e]=1}
}

puts a.reverse.join.sub(/^0+/, '')
0