結果
問題 | No.84 悪の算盤 |
ユーザー |
|
提出日時 | 2014-12-03 00:19:02 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 129 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 3,291 ms |
コンパイル使用メモリ | 74,004 KB |
実行使用メモリ | 54,292 KB |
最終ジャッジ日時 | 2024-10-13 08:43:42 |
合計ジャッジ時間 | 5,212 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
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+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); }}