結果

問題 No.99 ジャンピング駒
ユーザー simansiman
提出日時 2015-01-10 19:12:12
言語 Ruby
(3.3.0)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 23,176 KB
最終ジャッジ日時 2023-09-03 22:57:20
合計ジャッジ時間 2,302 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
23,016 KB
testcase_01 AC 133 ms
23,176 KB
testcase_02 AC 132 ms
23,044 KB
testcase_03 AC 132 ms
22,956 KB
testcase_04 AC 132 ms
23,080 KB
testcase_05 AC 134 ms
23,052 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

class A
  def initialize
    n = gets.chomp.to_i
    x = gets.chomp.split(' ').map(&:to_i)

    puts x.count - 2 * [x.count{|i| i.even?}, x.count{|i| i.odd?}].min
  end
end

A.new
0