結果
問題 |
No.84 悪の算盤
|
ユーザー |
![]() |
提出日時 | 2018-07-03 22:58:40 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 132 ms / 5,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 2,410 ms |
コンパイル使用メモリ | 74,100 KB |
実行使用メモリ | 41,496 KB |
最終ジャッジ日時 | 2024-07-01 02:03:22 |
合計ジャッジ時間 | 4,469 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
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 != C) { if(R % 2 == 1 && C % 2 == 1) { System.out.println((R * C) / 2); }else { System.out.println((R * C - 1) / 2); } }else { if(R % 2 == 0) { System.out.println(R * C / 4 - 1); }else { System.out.println((R * C - 1) / 4); } } } }