結果

問題 No.63 ポッキーゲーム
ユーザー dogwood0424dogwood0424
提出日時 2017-11-30 01:51:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 414 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 4,366 ms
コンパイル使用メモリ 71,476 KB
実行使用メモリ 56,412 KB
最終ジャッジ日時 2023-08-25 19:46:46
合計ジャッジ時間 9,144 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
54,032 KB
testcase_01 AC 121 ms
56,144 KB
testcase_02 AC 121 ms
55,724 KB
testcase_03 AC 120 ms
56,412 KB
testcase_04 AC 121 ms
54,232 KB
testcase_05 AC 120 ms
55,844 KB
testcase_06 AC 121 ms
55,812 KB
testcase_07 AC 122 ms
55,968 KB
testcase_08 AC 121 ms
56,164 KB
testcase_09 AC 124 ms
55,936 KB
testcase_10 AC 126 ms
55,800 KB
testcase_11 AC 414 ms
55,840 KB
testcase_12 AC 130 ms
55,964 KB
testcase_13 AC 411 ms
53,684 KB
testcase_14 AC 131 ms
55,940 KB
testcase_15 AC 131 ms
55,708 KB
testcase_16 AC 127 ms
56,044 KB
testcase_17 AC 397 ms
55,932 KB
testcase_18 AC 123 ms
55,744 KB
testcase_19 AC 164 ms
55,924 KB
testcase_20 AC 128 ms
56,084 KB
testcase_21 AC 135 ms
55,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No63 {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);

		int length=sc.nextInt();
		int K = sc.nextInt();

		int cnt=0;

		do {
			length = length-2*K;

			if(length<=0)	break;

			cnt += K;

		}while(length>K);

		System.out.println(cnt);

	}

}
0