結果

問題 No.63 ポッキーゲーム
ユーザー len_proglen_prog
提出日時 2016-06-07 13:11:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 548 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 1,859 ms
コンパイル使用メモリ 70,956 KB
実行使用メモリ 56,636 KB
最終ジャッジ日時 2023-08-25 19:12:49
合計ジャッジ時間 6,984 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,856 KB
testcase_01 AC 119 ms
55,924 KB
testcase_02 AC 119 ms
55,480 KB
testcase_03 AC 119 ms
56,032 KB
testcase_04 AC 119 ms
55,936 KB
testcase_05 AC 119 ms
55,796 KB
testcase_06 AC 120 ms
55,768 KB
testcase_07 AC 123 ms
56,196 KB
testcase_08 AC 120 ms
55,784 KB
testcase_09 AC 123 ms
56,284 KB
testcase_10 AC 130 ms
56,052 KB
testcase_11 AC 548 ms
55,924 KB
testcase_12 AC 133 ms
55,784 KB
testcase_13 AC 548 ms
56,080 KB
testcase_14 AC 135 ms
56,056 KB
testcase_15 AC 133 ms
55,668 KB
testcase_16 AC 125 ms
55,792 KB
testcase_17 AC 523 ms
55,788 KB
testcase_18 AC 125 ms
56,020 KB
testcase_19 AC 182 ms
55,688 KB
testcase_20 AC 131 ms
55,496 KB
testcase_21 AC 141 ms
56,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long L,K;
		L = scan.nextInt();
		K = scan.nextInt();
		long haruka_length = K;
		long yu_length = K;
		long yu_total = 0;

		while(L >= 0){
			if(L - haruka_length - yu_length <= 0){
				L -= haruka_length;
			}else{
				yu_total += yu_length;
				L = L - haruka_length - yu_length;
			}
		}
		System.out.println(yu_total);
		scan.close();
	}
}
0