結果

問題 No.84 悪の算盤
ユーザー YamaKasaYamaKasa
提出日時 2018-07-03 22:57:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 1,800 ms
コンパイル使用メモリ 70,936 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2023-09-13 17:20:10
合計ジャッジ時間 4,317 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,040 KB
testcase_01 AC 120 ms
55,956 KB
testcase_02 AC 120 ms
55,780 KB
testcase_03 AC 120 ms
55,740 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 123 ms
56,076 KB
testcase_07 AC 119 ms
55,972 KB
testcase_08 AC 120 ms
55,508 KB
testcase_09 AC 119 ms
55,896 KB
testcase_10 AC 119 ms
55,976 KB
testcase_11 AC 119 ms
55,788 KB
testcase_12 AC 121 ms
55,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
			}else {
				System.out.println((R * C - 1) / 4);
			}
		}
	}
}
0