結果
問題 |
No.84 悪の算盤
|
ユーザー |
|
提出日時 | 2014-12-03 00:00:27 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 542 bytes |
コンパイル時間 | 3,090 ms |
コンパイル使用メモリ | 75,036 KB |
実行使用メモリ | 41,256 KB |
最終ジャッジ日時 | 2024-06-11 07:52:15 |
合計ジャッジ時間 | 5,275 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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*r/4); 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); }}