結果

問題 No.63 ポッキーゲーム
ユーザー villachvillach
提出日時 2017-09-17 17:29:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 365 ms / 5,000 ms
コード長 316 bytes
コンパイル時間 2,979 ms
コンパイル使用メモリ 71,172 KB
実行使用メモリ 56,684 KB
最終ジャッジ日時 2023-08-25 19:39:28
合計ジャッジ時間 7,448 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,580 KB
testcase_01 AC 117 ms
55,688 KB
testcase_02 AC 119 ms
55,860 KB
testcase_03 AC 120 ms
55,372 KB
testcase_04 AC 119 ms
55,636 KB
testcase_05 AC 122 ms
54,048 KB
testcase_06 AC 120 ms
55,464 KB
testcase_07 AC 120 ms
55,436 KB
testcase_08 AC 119 ms
55,700 KB
testcase_09 AC 122 ms
56,684 KB
testcase_10 AC 124 ms
56,336 KB
testcase_11 AC 365 ms
56,344 KB
testcase_12 AC 126 ms
55,860 KB
testcase_13 AC 363 ms
56,324 KB
testcase_14 AC 127 ms
56,328 KB
testcase_15 AC 125 ms
54,360 KB
testcase_16 AC 121 ms
56,196 KB
testcase_17 AC 348 ms
55,444 KB
testcase_18 AC 123 ms
55,968 KB
testcase_19 AC 155 ms
56,032 KB
testcase_20 AC 126 ms
56,068 KB
testcase_21 AC 133 ms
55,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N63 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int k = sc.nextInt();
		int y = 0;
		while(true){
			l -= 2 * k;
			if(l <= 0){
				System.out.println(y);
				return;
			}
			y += k;
		}
	}
}
0