結果

問題 No.84 悪の算盤
ユーザー simansiman
提出日時 2015-01-10 21:39:45
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,376 KB
最終ジャッジ日時 2023-09-03 22:57:49
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
15,052 KB
testcase_01 AC 76 ms
14,980 KB
testcase_02 AC 77 ms
15,184 KB
testcase_03 AC 77 ms
15,268 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 75 ms
15,292 KB
testcase_08 AC 75 ms
15,092 KB
testcase_09 AC 74 ms
15,084 KB
testcase_10 AC 75 ms
14,984 KB
testcase_11 AC 74 ms
15,200 KB
testcase_12 AC 75 ms
15,060 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class A
  def initialize
    r, c = gets.chomp.split(' ').map(&:to_i)

    if c.even?
      puts (r * (c/2)) - 1
    else
      if r.even?
        puts (r * (c/2) + (r/2)) - 1
      else
        puts (r * (c/2) + (r/2)+1) - 1
      end
    end
  end
end

A.new
0