結果

問題 No.84 悪の算盤
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-25 13:59:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 177 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 2,674 ms
コンパイル使用メモリ 73,700 KB
実行使用メモリ 54,400 KB
最終ジャッジ日時 2024-04-21 09:59:52
合計ジャッジ時間 5,684 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 167 ms
53,880 KB
testcase_01 AC 166 ms
53,648 KB
testcase_02 AC 177 ms
53,580 KB
testcase_03 AC 163 ms
54,028 KB
testcase_04 AC 168 ms
54,048 KB
testcase_05 AC 163 ms
54,100 KB
testcase_06 AC 164 ms
54,192 KB
testcase_07 AC 163 ms
54,284 KB
testcase_08 AC 165 ms
54,400 KB
testcase_09 AC 167 ms
53,936 KB
testcase_10 AC 165 ms
53,900 KB
testcase_11 AC 169 ms
53,860 KB
testcase_12 AC 164 ms
53,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {
	public static void main(String[] a) {
		Scanner s=new Scanner(System.in);
		long R=s.nextLong(),C=s.nextLong(),S=0;
		if(R*C%2>0){//all odd
			S=(R==C)?(R-1)*(R+1)/4:R*C/2;
		}else{// at least even
			S=R*C/(R==C?4:2)-1;
		}
		System.out.println(S);
	}
}
0