結果

問題 No.84 悪の算盤
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-14 10:47:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 440 bytes
コンパイル時間 3,863 ms
コンパイル使用メモリ 71,880 KB
実行使用メモリ 55,784 KB
最終ジャッジ日時 2023-08-23 09:21:08
合計ジャッジ時間 6,442 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,620 KB
testcase_01 AC 129 ms
55,480 KB
testcase_02 AC 130 ms
55,468 KB
testcase_03 AC 131 ms
55,476 KB
testcase_04 AC 132 ms
55,388 KB
testcase_05 AC 130 ms
55,440 KB
testcase_06 AC 131 ms
55,736 KB
testcase_07 AC 132 ms
55,784 KB
testcase_08 AC 131 ms
55,680 KB
testcase_09 AC 131 ms
55,376 KB
testcase_10 AC 130 ms
55,484 KB
testcase_11 AC 130 ms
55,764 KB
testcase_12 AC 131 ms
55,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No84 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long H = sc.nextLong();
		long W = sc.nextLong();
		
		if(H == W) {
			if(H % 2 == 1) {
				System.out.println(H * W / 4);
			}else {
				System.out.println(H * W / 4 - 1);
			}
		}else {
			if(H * W % 2 == 1) {
				System.out.println(H * W / 2);
			}else {
				System.out.println(H * W / 2 - 1);
			}
		}
	}
}
0