結果

問題 No.84 悪の算盤
ユーザー バカらっくバカらっく
提出日時 2018-06-12 09:37:56
言語 Swift
(5.10.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 522 bytes
コンパイル時間 1,256 ms
コンパイル使用メモリ 126,716 KB
実行使用メモリ 8,100 KB
最終ジャッジ日時 2023-08-20 10:48:25
合計ジャッジ時間 2,449 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,028 KB
testcase_01 AC 4 ms
7,900 KB
testcase_02 AC 3 ms
7,896 KB
testcase_03 AC 4 ms
7,948 KB
testcase_04 AC 4 ms
8,040 KB
testcase_05 AC 3 ms
7,968 KB
testcase_06 AC 3 ms
7,936 KB
testcase_07 AC 4 ms
7,932 KB
testcase_08 AC 4 ms
8,076 KB
testcase_09 AC 4 ms
8,072 KB
testcase_10 AC 3 ms
7,920 KB
testcase_11 AC 3 ms
8,100 KB
testcase_12 AC 3 ms
7,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class Proc {
    public func doProc() {
        let inpt = readLine()!.split(separator: " ").map{ Int64($0)! }
        if inpt[0] == inpt[1] {
            if(inpt[0] % 2 == 0) {
                print(inpt[0]*inpt[1]/4 - 1)
            } else {
                print((inpt[0]*inpt[1]-1)/4 + 1 - 1)
            }
        } else if inpt[0] % 2 != 0  && inpt[1] % 2 != 0 {
            print((inpt[0] * inpt[1] - 1) / 2 + 1 - 1)
        } else {
            print(inpt[0] * inpt[1] / 2 - 1)
        }
    }

}

Proc().doProc()
0