結果

問題 No.84 悪の算盤
ユーザー リチウムリチウム
提出日時 2014-12-03 00:08:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 3,802 ms
コンパイル使用メモリ 72,056 KB
実行使用メモリ 56,176 KB
最終ジャッジ日時 2023-09-02 01:18:01
合計ジャッジ時間 5,680 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,176 KB
testcase_01 AC 121 ms
53,748 KB
testcase_02 AC 122 ms
55,804 KB
testcase_03 AC 124 ms
56,104 KB
testcase_04 AC 124 ms
55,744 KB
testcase_05 AC 121 ms
55,968 KB
testcase_06 WA -
testcase_07 AC 121 ms
56,040 KB
testcase_08 AC 123 ms
55,940 KB
testcase_09 AC 123 ms
55,660 KB
testcase_10 AC 124 ms
55,948 KB
testcase_11 AC 122 ms
56,144 KB
testcase_12 AC 123 ms
56,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.Math.*;
 
public class ppp {
	
	
		
  public static void main(String[] args) {
	  Scanner sc=new Scanner(System.in);
	  long r=sc.nextInt();
	  long c=sc.nextInt();
	  long x=0;
	  if(r==c){
		x=(r/2)*(r/2);
		if(r%2==1){
			x+=r/2+r/2+1;
		}
	  }
	  if(r!=c){
		  x=(r/2)*(c/2)*2;
		  if(r%2==0 && c%2==1){
			  x+=r/2;
		  }
		  if(r%2==1 && c%2==0){
			  x+=c/2;
		  }
		  if(r%2==1 && c%2==1){
			  x+=c/2+r/2+1;
		  }
		  
	  }
	  System.out.println(x-1);
	  
  }}
0