結果

問題 No.63 ポッキーゲーム
ユーザー gomagoma
提出日時 2017-09-23 13:55:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 362 ms / 5,000 ms
コード長 313 bytes
コンパイル時間 1,995 ms
コンパイル使用メモリ 71,340 KB
実行使用メモリ 56,172 KB
最終ジャッジ日時 2023-08-25 19:40:12
合計ジャッジ時間 6,638 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,740 KB
testcase_01 AC 121 ms
56,116 KB
testcase_02 AC 121 ms
55,984 KB
testcase_03 AC 122 ms
56,016 KB
testcase_04 AC 121 ms
55,976 KB
testcase_05 AC 120 ms
55,920 KB
testcase_06 AC 121 ms
55,636 KB
testcase_07 AC 122 ms
55,484 KB
testcase_08 AC 123 ms
55,740 KB
testcase_09 AC 124 ms
55,916 KB
testcase_10 AC 128 ms
56,064 KB
testcase_11 AC 359 ms
55,644 KB
testcase_12 AC 135 ms
55,640 KB
testcase_13 AC 362 ms
55,344 KB
testcase_14 AC 130 ms
55,696 KB
testcase_15 AC 130 ms
56,032 KB
testcase_16 AC 127 ms
55,664 KB
testcase_17 AC 350 ms
55,440 KB
testcase_18 AC 127 ms
56,172 KB
testcase_19 AC 158 ms
55,916 KB
testcase_20 AC 130 ms
55,940 KB
testcase_21 AC 139 ms
55,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int k = sc.nextInt();
		int m = 0, count = 0, ans = 0;
		while (l > 2 * k) {
			l -= 2 * k;
			count++;
		}
		ans = count * k;
		System.out.println(ans);
	}
}
0