結果

問題 No.63 ポッキーゲーム
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-21 10:37:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 367 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 3,182 ms
コンパイル使用メモリ 71,236 KB
実行使用メモリ 56,212 KB
最終ジャッジ日時 2023-08-25 19:44:33
合計ジャッジ時間 7,079 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,044 KB
testcase_01 AC 119 ms
55,908 KB
testcase_02 AC 123 ms
55,736 KB
testcase_03 AC 124 ms
56,008 KB
testcase_04 AC 125 ms
55,776 KB
testcase_05 AC 125 ms
55,908 KB
testcase_06 AC 125 ms
55,608 KB
testcase_07 AC 128 ms
56,056 KB
testcase_08 AC 125 ms
55,912 KB
testcase_09 AC 130 ms
56,212 KB
testcase_10 AC 132 ms
55,648 KB
testcase_11 AC 367 ms
55,588 KB
testcase_12 AC 131 ms
55,828 KB
testcase_13 AC 363 ms
55,472 KB
testcase_14 AC 132 ms
55,860 KB
testcase_15 AC 132 ms
55,672 KB
testcase_16 AC 129 ms
55,688 KB
testcase_17 AC 355 ms
55,436 KB
testcase_18 AC 127 ms
56,056 KB
testcase_19 AC 160 ms
54,196 KB
testcase_20 AC 131 ms
54,028 KB
testcase_21 AC 139 ms
55,832 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 ans = 0;
		while(l > 2 * k) {
			ans += k;
			l -= 2 * k;
		}
		System.out.println(ans);
 	}
}

0