結果

問題 No.63 ポッキーゲーム
ユーザー papipenpapipen
提出日時 2017-03-26 16:16:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 504 ms / 5,000 ms
コード長 345 bytes
コンパイル時間 2,098 ms
コンパイル使用メモリ 71,468 KB
実行使用メモリ 57,848 KB
最終ジャッジ日時 2023-08-25 19:23:54
合計ジャッジ時間 7,116 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,644 KB
testcase_01 AC 125 ms
57,848 KB
testcase_02 AC 126 ms
55,812 KB
testcase_03 AC 124 ms
55,684 KB
testcase_04 AC 125 ms
55,876 KB
testcase_05 AC 124 ms
55,752 KB
testcase_06 AC 126 ms
55,460 KB
testcase_07 AC 126 ms
55,860 KB
testcase_08 AC 124 ms
55,980 KB
testcase_09 AC 130 ms
55,988 KB
testcase_10 AC 130 ms
55,852 KB
testcase_11 AC 501 ms
55,792 KB
testcase_12 AC 138 ms
55,752 KB
testcase_13 AC 504 ms
55,640 KB
testcase_14 AC 136 ms
55,752 KB
testcase_15 AC 137 ms
55,924 KB
testcase_16 AC 129 ms
55,884 KB
testcase_17 AC 476 ms
55,800 KB
testcase_18 AC 128 ms
55,992 KB
testcase_19 AC 177 ms
55,800 KB
testcase_20 AC 136 ms
55,724 KB
testcase_21 AC 145 ms
55,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class pokkii{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int L = s.nextInt();
		int K = s.nextInt();
		int i = 0;
		int sum = 0;
		while(K * 2 * i < L){
			i++;
			sum += K * 2;
		}
		if(sum >= L){
			System.out.println(K * (i - 1));
		}else{
			System.out.println(K * i);
		}
	}
}
0