結果

問題 No.84 悪の算盤
ユーザー ぴろずぴろず
提出日時 2014-12-02 23:54:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 322 bytes
コンパイル時間 2,599 ms
コンパイル使用メモリ 74,372 KB
実行使用メモリ 54,424 KB
最終ジャッジ日時 2024-04-21 09:55:23
合計ジャッジ時間 4,467 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
54,004 KB
testcase_01 AC 135 ms
53,916 KB
testcase_02 AC 134 ms
54,040 KB
testcase_03 AC 136 ms
54,336 KB
testcase_04 AC 135 ms
54,108 KB
testcase_05 AC 133 ms
53,972 KB
testcase_06 AC 135 ms
53,748 KB
testcase_07 AC 134 ms
53,664 KB
testcase_08 AC 133 ms
54,056 KB
testcase_09 AC 134 ms
54,356 KB
testcase_10 AC 129 ms
54,288 KB
testcase_11 AC 131 ms
54,272 KB
testcase_12 AC 134 ms
54,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long r = sc.nextInt();
		long c = sc.nextInt();
		if (r != c) {
			System.out.println(((r * c) + 1) / 2 - 1);
		}else{
			System.out.println(((r * c) + 3) / 4 - 1);
		}
	}

}
0