結果

問題 No.99 ジャンピング駒
ユーザー harhogefooharhogefoo
提出日時 2016-10-07 08:51:48
言語 Ruby
(3.3.0)
結果
AC  
実行時間 148 ms / 5,000 ms
コード長 201 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 20,608 KB
最終ジャッジ日時 2024-05-01 14:15:41
合計ジャッジ時間 2,201 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
20,480 KB
testcase_01 AC 148 ms
20,608 KB
testcase_02 AC 139 ms
20,352 KB
testcase_03 AC 143 ms
20,352 KB
testcase_04 AC 145 ms
20,480 KB
testcase_05 AC 140 ms
20,480 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
x_ary = gets.chomp.split(" ").map(&:to_i)

even_count = 0
odd_count = 0
x_ary.each do |x|
  if x % 2 == 0
    even_count += 1
  else
    odd_count += 1
  end
end

puts (even_count - odd_count).abs
0