結果
問題 |
No.84 悪の算盤
|
ユーザー |
|
提出日時 | 2014-12-03 00:08:48 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 548 bytes |
コンパイル時間 | 4,301 ms |
コンパイル使用メモリ | 75,104 KB |
実行使用メモリ | 41,444 KB |
最終ジャッジ日時 | 2024-06-11 07:54:33 |
合計ジャッジ時間 | 6,165 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 1 |
ソースコード
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); }}