結果

問題 No.84 悪の算盤
ユーザー k_kadora
提出日時 2015-05-24 01:21:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 403 bytes
コンパイル時間 3,147 ms
コンパイル使用メモリ 74,476 KB
実行使用メモリ 41,616 KB
最終ジャッジ日時 2024-10-13 08:51:54
合計ジャッジ時間 5,188 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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)+1);
			}
		}else{
			if(r%2 == 0 || c %2 ==0){
				out = r*c /2 -1;
			}else{
				out = r*c /2;
			}
		}
		System.out.println(out);
	}
}
			
0