結果

問題 No.63 ポッキーゲーム
ユーザー omc-testomc-test
提出日時 2016-08-03 16:14:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 554 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 2,029 ms
コンパイル使用メモリ 71,412 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-08-25 19:15:00
合計ジャッジ時間 6,744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
55,788 KB
testcase_01 AC 114 ms
55,936 KB
testcase_02 AC 107 ms
55,504 KB
testcase_03 AC 111 ms
56,160 KB
testcase_04 AC 116 ms
55,724 KB
testcase_05 AC 114 ms
55,920 KB
testcase_06 AC 121 ms
55,628 KB
testcase_07 AC 124 ms
55,796 KB
testcase_08 AC 117 ms
53,568 KB
testcase_09 AC 117 ms
56,040 KB
testcase_10 AC 122 ms
56,120 KB
testcase_11 AC 554 ms
56,204 KB
testcase_12 AC 125 ms
55,764 KB
testcase_13 AC 540 ms
55,896 KB
testcase_14 AC 128 ms
56,312 KB
testcase_15 AC 128 ms
55,732 KB
testcase_16 AC 118 ms
56,108 KB
testcase_17 AC 530 ms
55,616 KB
testcase_18 AC 119 ms
55,692 KB
testcase_19 AC 174 ms
55,832 KB
testcase_20 AC 124 ms
55,464 KB
testcase_21 AC 135 ms
56,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		int k = sc.nextInt();
		sc.close();

		int eat = 0;
		int yuu = 0;
		while(eat < l){
			if(l <= eat + (k*2)) {
				break;
			}
			eat += k*2;
			yuu += k;
		}
		System.out.println(yuu);
	}
}
0