結果

問題 No.84 悪の算盤
ユーザー tsunabittsunabit
提出日時 2020-01-09 11:23:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 3,422 ms
コンパイル使用メモリ 71,968 KB
実行使用メモリ 56,448 KB
最終ジャッジ日時 2023-08-15 01:11:12
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,848 KB
testcase_01 AC 119 ms
55,540 KB
testcase_02 AC 118 ms
55,852 KB
testcase_03 AC 121 ms
56,008 KB
testcase_04 AC 120 ms
55,808 KB
testcase_05 AC 120 ms
55,448 KB
testcase_06 AC 118 ms
55,676 KB
testcase_07 AC 121 ms
55,576 KB
testcase_08 AC 120 ms
56,016 KB
testcase_09 AC 123 ms
56,448 KB
testcase_10 AC 127 ms
55,924 KB
testcase_11 AC 122 ms
56,096 KB
testcase_12 AC 122 ms
56,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No84 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long r = sc.nextLong();
		long c = sc.nextLong();
		long a = 0;
		
		if(r == c) {
			if(r % 2 == 0) {
				a = (long)(r * c / 4 - 1);
			}else {
				a = (long)(r * c / 4);
			}
		}
		else if(r * c % 2 == 0) a = (long)(r * c / 2 - 1);
		else a = (long)(r * c / 2);		
		
		if(a < 0) a = 0;
		System.out.println(a);
	}
}
0