結果

問題 No.84 悪の算盤
ユーザー YamaKasa
提出日時 2018-07-03 22:54:19
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 74,184 KB
実行使用メモリ 56,616 KB
最終ジャッジ日時 2024-07-01 02:03:14
合計ジャッジ時間 4,708 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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