結果

問題 No.84 悪の算盤
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-14 10:47:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 440 bytes
コンパイル時間 3,446 ms
コンパイル使用メモリ 75,456 KB
実行使用メモリ 54,244 KB
最終ジャッジ日時 2024-06-01 06:58:15
合計ジャッジ時間 6,016 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
53,924 KB
testcase_01 AC 137 ms
53,836 KB
testcase_02 AC 135 ms
53,804 KB
testcase_03 AC 135 ms
53,792 KB
testcase_04 AC 134 ms
54,032 KB
testcase_05 AC 136 ms
53,888 KB
testcase_06 AC 136 ms
53,724 KB
testcase_07 AC 136 ms
54,204 KB
testcase_08 AC 134 ms
54,088 KB
testcase_09 AC 134 ms
54,060 KB
testcase_10 AC 134 ms
53,700 KB
testcase_11 AC 135 ms
54,104 KB
testcase_12 AC 134 ms
54,244 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