結果

問題 No.63 ポッキーゲーム
ユーザー bellbell
提出日時 2021-02-12 19:43:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 3,266 ms
コンパイル使用メモリ 71,272 KB
実行使用メモリ 57,852 KB
最終ジャッジ日時 2023-09-27 00:51:48
合計ジャッジ時間 8,376 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,480 KB
testcase_01 AC 117 ms
56,032 KB
testcase_02 AC 119 ms
56,032 KB
testcase_03 AC 119 ms
55,976 KB
testcase_04 AC 117 ms
55,752 KB
testcase_05 AC 119 ms
55,912 KB
testcase_06 AC 120 ms
55,780 KB
testcase_07 AC 120 ms
55,944 KB
testcase_08 AC 122 ms
56,092 KB
testcase_09 AC 129 ms
55,756 KB
testcase_10 AC 124 ms
55,996 KB
testcase_11 AC 366 ms
55,712 KB
testcase_12 AC 128 ms
53,880 KB
testcase_13 WA -
testcase_14 AC 128 ms
55,944 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 133 ms
55,664 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