結果

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

ソースコード

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