結果
| 問題 | No.84 悪の算盤 |
| コンテスト | |
| ユーザー |
YamaKasa
|
| 提出日時 | 2018-07-03 22:40:02 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 488 bytes |
| 記録 | |
| コンパイル時間 | 1,502 ms |
| コンパイル使用メモリ | 81,972 KB |
| 実行使用メモリ | 46,396 KB |
| 最終ジャッジ日時 | 2026-03-21 18:09:49 |
| 合計ジャッジ時間 | 2,819 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 3 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long R = scan.nextLong();
long C = scan.nextLong();
scan.close();
if(R == 1 && C == 1) {
System.out.println(0);
System.exit(0);
}
if(R % 2 == 1 && C % 2 ==1) {
System.out.println(R * (C / 2) + R / 2);
}else {
if(R % 2 == 0) {
System.out.println((R / 2) * C - 1);
}else{
System.out.println(R * (C / 2) - 1);
}
}
}
}
YamaKasa