結果

問題 No.84 悪の算盤
ユーザー kano_townkano_town
提出日時 2014-12-05 20:57:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 3,820 ms
コンパイル使用メモリ 74,832 KB
実行使用メモリ 54,296 KB
最終ジャッジ日時 2024-04-21 09:57:33
合計ジャッジ時間 6,288 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
53,552 KB
testcase_01 AC 133 ms
53,652 KB
testcase_02 AC 136 ms
54,232 KB
testcase_03 AC 134 ms
53,788 KB
testcase_04 AC 132 ms
53,824 KB
testcase_05 AC 132 ms
54,296 KB
testcase_06 AC 134 ms
53,868 KB
testcase_07 AC 132 ms
53,836 KB
testcase_08 AC 131 ms
53,712 KB
testcase_09 AC 133 ms
53,860 KB
testcase_10 AC 129 ms
53,948 KB
testcase_11 AC 132 ms
53,780 KB
testcase_12 AC 131 ms
54,004 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