結果

問題 No.583 鉄道同好会
ユーザー sca1lsca1l
提出日時 2017-10-27 22:51:45
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 213 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 15,232 KB
最終ジャッジ日時 2024-05-01 17:21:14
合計ジャッジ時間 3,670 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
12,160 KB
testcase_01 AC 75 ms
12,160 KB
testcase_02 AC 78 ms
12,288 KB
testcase_03 AC 80 ms
12,160 KB
testcase_04 WA -
testcase_05 AC 78 ms
12,160 KB
testcase_06 AC 80 ms
12,160 KB
testcase_07 AC 82 ms
12,288 KB
testcase_08 AC 81 ms
12,160 KB
testcase_09 AC 81 ms
12,288 KB
testcase_10 AC 83 ms
12,160 KB
testcase_11 AC 118 ms
12,672 KB
testcase_12 AC 130 ms
12,928 KB
testcase_13 AC 138 ms
13,056 KB
testcase_14 AC 139 ms
12,928 KB
testcase_15 AC 155 ms
13,440 KB
testcase_16 AC 202 ms
14,336 KB
testcase_17 AC 236 ms
15,232 KB
testcase_18 AC 249 ms
15,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: assigned but unused variable - at
Syntax OK

ソースコード

diff #

n,m = gets.split.map(&:to_i)
x = n.times.map{[]}
m.times{
  a,b=gets.split.map(&:to_i)
  at=a
  x[a]<<b
  x[b]<<a
}

odd = x.select{|t| t.size%2==1}.size

if odd==0 || odd==2 then
  puts 'YES'
else
  puts 'NO'
end
0