結果

問題 No.84 悪の算盤
ユーザー kano_townkano_town
提出日時 2014-12-05 20:57:38
言語 Java19
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 3,860 ms
コンパイル使用メモリ 72,392 KB
実行使用メモリ 56,028 KB
最終ジャッジ日時 2023-08-03 12:02:29
合計ジャッジ時間 5,896 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,852 KB
testcase_01 AC 129 ms
55,588 KB
testcase_02 AC 128 ms
55,580 KB
testcase_03 AC 126 ms
55,640 KB
testcase_04 AC 128 ms
55,692 KB
testcase_05 AC 128 ms
55,676 KB
testcase_06 AC 131 ms
55,560 KB
testcase_07 AC 133 ms
55,532 KB
testcase_08 AC 129 ms
55,648 KB
testcase_09 AC 130 ms
56,028 KB
testcase_10 AC 129 ms
55,804 KB
testcase_11 AC 127 ms
55,348 KB
testcase_12 AC 130 ms
55,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder84 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong(), C = sc.nextLong();
		long b = R % 2 == 0 || C % 2 == 0 ? 1 : 0;
		if (R == C) {
			R /=2L ;
			C += 1 - b;
		}
		System.out.println(R * C / 2L - b);
	}
}
0