結果
問題 |
No.84 悪の算盤
|
ユーザー |
![]() |
提出日時 | 2018-07-03 22:40:02 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 488 bytes |
コンパイル時間 | 1,970 ms |
コンパイル使用メモリ | 74,108 KB |
実行使用メモリ | 54,492 KB |
最終ジャッジ日時 | 2024-07-01 02:02:29 |
合計ジャッジ時間 | 4,386 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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); } } } }