結果

問題 No.63 ポッキーゲーム
ユーザー bellbell
提出日時 2021-02-12 19:45:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 367 ms / 5,000 ms
コード長 424 bytes
コンパイル時間 4,177 ms
コンパイル使用メモリ 71,284 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2023-09-27 00:53:01
合計ジャッジ時間 7,489 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,944 KB
testcase_01 AC 122 ms
56,032 KB
testcase_02 AC 122 ms
55,836 KB
testcase_03 AC 121 ms
56,000 KB
testcase_04 AC 124 ms
55,920 KB
testcase_05 AC 123 ms
55,596 KB
testcase_06 AC 123 ms
55,768 KB
testcase_07 AC 125 ms
56,072 KB
testcase_08 AC 122 ms
55,624 KB
testcase_09 AC 126 ms
55,844 KB
testcase_10 AC 127 ms
55,716 KB
testcase_11 AC 361 ms
53,328 KB
testcase_12 AC 138 ms
55,792 KB
testcase_13 AC 367 ms
55,712 KB
testcase_14 AC 129 ms
55,996 KB
testcase_15 AC 130 ms
55,792 KB
testcase_16 AC 126 ms
55,780 KB
testcase_17 AC 349 ms
55,980 KB
testcase_18 AC 124 ms
55,756 KB
testcase_19 AC 159 ms
56,108 KB
testcase_20 AC 130 ms
55,708 KB
testcase_21 AC 136 ms
55,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int L=sc.nextInt(); //90
        int K=sc.nextInt(); //20 *2
        int result=0;

        for(int i = K * 2; i < L; ){
            if(K * 2 < L){
                result+=K;
            }
            i+=K*2;
        }
        System.out.println(result);

            sc.close();
		}
    }
0