結果

問題 No.84 悪の算盤
ユーザー tsunabittsunabit
提出日時 2020-01-09 11:19:53
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 3,004 ms
コンパイル使用メモリ 71,640 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-08-15 01:10:52
合計ジャッジ時間 5,607 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,760 KB
testcase_01 AC 117 ms
55,956 KB
testcase_02 AC 117 ms
55,544 KB
testcase_03 AC 120 ms
56,168 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 118 ms
56,240 KB
testcase_07 AC 118 ms
55,836 KB
testcase_08 AC 115 ms
55,752 KB
testcase_09 AC 118 ms
56,364 KB
testcase_10 AC 118 ms
55,796 KB
testcase_11 AC 121 ms
56,068 KB
testcase_12 AC 120 ms
56,284 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) 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