結果

問題 No.84 悪の算盤
ユーザー k_kadorak_kadora
提出日時 2015-05-24 01:18:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 3,042 ms
コンパイル使用メモリ 72,044 KB
実行使用メモリ 56,496 KB
最終ジャッジ日時 2023-09-20 10:56:40
合計ジャッジ時間 5,524 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,212 KB
testcase_01 AC 119 ms
56,424 KB
testcase_02 AC 117 ms
55,768 KB
testcase_03 AC 119 ms
55,528 KB
testcase_04 AC 119 ms
55,756 KB
testcase_05 AC 119 ms
55,812 KB
testcase_06 WA -
testcase_07 AC 119 ms
55,956 KB
testcase_08 AC 117 ms
55,956 KB
testcase_09 AC 119 ms
56,012 KB
testcase_10 AC 119 ms
55,972 KB
testcase_11 AC 120 ms
56,028 KB
testcase_12 AC 118 ms
55,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Soroban{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		long r,c,out;
		r = sc.nextInt();
		c = sc.nextInt();
		if(r == c){
			if(r %2 == 0){
				out = r*c /4 -1;
			}else{
				out = (r/2)*(r/2);
			}
		}else{
			if(r%2 == 0 || c %2 ==0){
				out = r*c /2 -1;
			}else{
				out = r*c /2;
			}
		}
		System.out.println(out);
	}
}
			
0