結果

問題 No.84 悪の算盤
ユーザー maimai
提出日時 2018-09-02 10:14:54
言語 Ruby
(3.2.2)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 277 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 16,044 KB
最終ジャッジ日時 2023-10-24 22:16:58
合計ジャッジ時間 1,720 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
16,044 KB
testcase_01 AC 85 ms
16,044 KB
testcase_02 AC 78 ms
16,044 KB
testcase_03 AC 78 ms
16,044 KB
testcase_04 AC 78 ms
16,044 KB
testcase_05 AC 78 ms
16,044 KB
testcase_06 AC 82 ms
16,044 KB
testcase_07 AC 78 ms
16,044 KB
testcase_08 AC 78 ms
16,044 KB
testcase_09 AC 77 ms
16,044 KB
testcase_10 AC 78 ms
16,044 KB
testcase_11 AC 78 ms
16,040 KB
testcase_12 AC 77 ms
16,044 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)-1
elsif R.odd? && C.even?
    p (C)*(R/2)+C/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