結果

問題 No.84 悪の算盤
ユーザー maimai
提出日時 2018-09-02 10:13:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 11,900 KB
実行使用メモリ 16,084 KB
最終ジャッジ日時 2023-10-24 22:16:55
合計ジャッジ時間 1,914 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 80 ms
16,084 KB
testcase_03 AC 80 ms
16,080 KB
testcase_04 AC 79 ms
16,084 KB
testcase_05 AC 84 ms
16,084 KB
testcase_06 AC 81 ms
16,084 KB
testcase_07 WA -
testcase_08 AC 82 ms
16,084 KB
testcase_09 WA -
testcase_10 AC 80 ms
16,084 KB
testcase_11 WA -
testcase_12 AC 79 ms
16,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

R,C = gets.split.map(&:to_i).sort

if R.odd? && C.odd?
    p (R)*(C)/4+1-1 if R == C
    p (R)*(C)/2+1-1 if R != C
elsif R.even? && C.odd?
    p (C)*(R/2)+C/2-1
elsif R.odd? && C.even?
    p C*(R/2)-1
elsif R.even? && C.even?
    p R*C/4-1 if R == C
    p R*C/2-1 if R != C
end
0