結果
問題 | No.84 悪の算盤 |
ユーザー |
![]() |
提出日時 | 2018-06-12 09:37:56 |
言語 | Swift (6.0.3) |
結果 |
AC
|
実行時間 | 8 ms / 5,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 1,039 ms |
コンパイル使用メモリ | 130,984 KB |
実行使用メモリ | 9,344 KB |
最終ジャッジ日時 | 2024-11-30 12:29:48 |
合計ジャッジ時間 | 1,708 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
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()