結果

問題 No.479 頂点は要らない
ユーザー smz_8110smz_8110
提出日時 2017-04-18 16:19:54
言語 Ruby
(3.2.2)
結果
AC  
実行時間 439 ms / 1,500 ms
コード長 331 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 29,924 KB
最終ジャッジ日時 2023-09-26 13:15:32
合計ジャッジ時間 9,411 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,216 KB
testcase_01 AC 81 ms
15,268 KB
testcase_02 AC 79 ms
15,288 KB
testcase_03 AC 82 ms
15,044 KB
testcase_04 AC 78 ms
15,240 KB
testcase_05 AC 79 ms
15,076 KB
testcase_06 AC 80 ms
15,244 KB
testcase_07 AC 79 ms
15,248 KB
testcase_08 AC 83 ms
15,268 KB
testcase_09 AC 79 ms
15,272 KB
testcase_10 AC 79 ms
15,040 KB
testcase_11 AC 79 ms
15,120 KB
testcase_12 AC 79 ms
15,216 KB
testcase_13 AC 78 ms
15,228 KB
testcase_14 AC 78 ms
15,184 KB
testcase_15 AC 79 ms
15,276 KB
testcase_16 AC 80 ms
15,200 KB
testcase_17 AC 79 ms
15,040 KB
testcase_18 AC 78 ms
15,280 KB
testcase_19 AC 81 ms
15,272 KB
testcase_20 AC 81 ms
15,132 KB
testcase_21 AC 82 ms
15,056 KB
testcase_22 AC 82 ms
15,228 KB
testcase_23 AC 81 ms
15,060 KB
testcase_24 AC 82 ms
15,112 KB
testcase_25 AC 82 ms
15,036 KB
testcase_26 AC 439 ms
29,784 KB
testcase_27 AC 429 ms
29,924 KB
testcase_28 AC 370 ms
27,316 KB
testcase_29 AC 363 ms
26,180 KB
testcase_30 AC 359 ms
26,108 KB
testcase_31 AC 365 ms
26,224 KB
testcase_32 AC 363 ms
26,000 KB
testcase_33 AC 351 ms
24,840 KB
testcase_34 AC 372 ms
25,468 KB
testcase_35 AC 316 ms
22,128 KB
testcase_36 AC 215 ms
17,532 KB
testcase_37 AC 361 ms
25,016 KB
testcase_38 AC 308 ms
23,216 KB
testcase_39 AC 238 ms
20,844 KB
testcase_40 AC 285 ms
23,584 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
x={}
y={}
m.times{
  b=gets.split.map(&:to_i)
  c=b[0]
  x[c]=[] unless x[c]
  x[c]<<b[1]
  c=b[1]
  y[c]=[] unless y[c]
  y[c]<<b[0]
}
f=false
x.keys.max.downto(0){|v|
  if x[v]&&x[v].size>0
    print 1
    y[v].each{|i|
      x[i].delete v
    } if y[v]
    f=true
  elsif f
    print 0
  end
}
puts ""
0