結果

問題 No.479 頂点は要らない
ユーザー smz_8110smz_8110
提出日時 2017-04-18 16:14:21
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 303 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 11,200 KB
実行使用メモリ 22,368 KB
最終ジャッジ日時 2023-09-26 13:15:22
合計ジャッジ時間 7,907 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
22,368 KB
testcase_01 AC 82 ms
15,056 KB
testcase_02 AC 82 ms
15,104 KB
testcase_03 AC 80 ms
15,008 KB
testcase_04 AC 81 ms
15,096 KB
testcase_05 AC 80 ms
15,144 KB
testcase_06 AC 82 ms
15,120 KB
testcase_07 AC 82 ms
15,112 KB
testcase_08 AC 82 ms
15,244 KB
testcase_09 AC 79 ms
15,112 KB
testcase_10 AC 80 ms
15,244 KB
testcase_11 AC 79 ms
15,216 KB
testcase_12 AC 79 ms
15,292 KB
testcase_13 AC 80 ms
15,224 KB
testcase_14 AC 80 ms
15,076 KB
testcase_15 AC 80 ms
15,056 KB
testcase_16 AC 80 ms
15,132 KB
testcase_17 AC 80 ms
15,228 KB
testcase_18 AC 80 ms
15,120 KB
testcase_19 AC 84 ms
15,312 KB
testcase_20 AC 86 ms
15,256 KB
testcase_21 AC 83 ms
15,272 KB
testcase_22 AC 84 ms
15,212 KB
testcase_23 AC 85 ms
15,008 KB
testcase_24 AC 83 ms
15,056 KB
testcase_25 AC 83 ms
15,104 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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]
}
r=0
x.keys.sort{|a,b|b<=>a}.each{|v|
  if x[v].size>0
    r|=2**v
    y[v].each{|i|
      x[i].delete v
    } if y[v]
  end
}
puts r.to_s(2)
0