結果

問題 No.601 Midpoint Erase
ユーザー simansiman
提出日時 2021-05-19 19:14:08
言語 Ruby
(3.3.0)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 945 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 20,096 KB
最終ジャッジ日時 2024-04-18 06:38:45
合計ジャッジ時間 5,622 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
12,160 KB
testcase_01 AC 79 ms
12,160 KB
testcase_02 AC 76 ms
12,160 KB
testcase_03 AC 202 ms
16,896 KB
testcase_04 AC 211 ms
17,792 KB
testcase_05 AC 170 ms
16,384 KB
testcase_06 AC 130 ms
14,464 KB
testcase_07 AC 211 ms
17,536 KB
testcase_08 AC 199 ms
16,256 KB
testcase_09 AC 222 ms
17,664 KB
testcase_10 AC 115 ms
13,056 KB
testcase_11 AC 293 ms
20,096 KB
testcase_12 AC 172 ms
16,128 KB
testcase_13 AC 78 ms
12,160 KB
testcase_14 AC 79 ms
12,160 KB
testcase_15 AC 76 ms
12,288 KB
testcase_16 AC 80 ms
12,160 KB
testcase_17 AC 79 ms
12,160 KB
testcase_18 AC 77 ms
12,160 KB
testcase_19 AC 76 ms
12,288 KB
testcase_20 AC 78 ms
12,032 KB
testcase_21 AC 75 ms
12,288 KB
testcase_22 AC 79 ms
12,288 KB
testcase_23 AC 82 ms
12,288 KB
testcase_24 AC 83 ms
12,032 KB
testcase_25 AC 83 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
P = N.times.map { gets.split.map(&:to_i) }

A = P.select { |x, _| x.odd? }
B = P.select { |x, _| x.even? }

C = A.select { |_, y| y.odd? }
D = A.select { |_, y| y.even? }

E = B.select { |_, y| y.odd? }
F = B.select { |_, y| y.even? }

cnt = C.size / 2 + D.size / 2 + E.size / 2 + F.size / 2

if cnt.even?
  puts 'Bob'
else
  puts 'Alice'
end
0