結果

問題 No.63 ポッキーゲーム
ユーザー syusyu
提出日時 2020-08-25 23:12:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 378 ms / 5,000 ms
コード長 369 bytes
コンパイル時間 2,127 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 41,512 KB
最終ジャッジ日時 2024-04-24 04:57:49
合計ジャッジ時間 7,073 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,436 KB
testcase_01 AC 142 ms
41,156 KB
testcase_02 AC 139 ms
41,472 KB
testcase_03 AC 139 ms
41,332 KB
testcase_04 AC 133 ms
41,368 KB
testcase_05 AC 139 ms
41,328 KB
testcase_06 AC 139 ms
41,420 KB
testcase_07 AC 142 ms
41,364 KB
testcase_08 AC 141 ms
41,224 KB
testcase_09 AC 144 ms
41,380 KB
testcase_10 AC 150 ms
41,512 KB
testcase_11 AC 376 ms
41,484 KB
testcase_12 AC 148 ms
41,260 KB
testcase_13 AC 378 ms
41,440 KB
testcase_14 AC 146 ms
41,176 KB
testcase_15 AC 148 ms
41,256 KB
testcase_16 AC 147 ms
41,416 KB
testcase_17 AC 365 ms
41,204 KB
testcase_18 AC 137 ms
41,344 KB
testcase_19 AC 176 ms
41,192 KB
testcase_20 AC 141 ms
41,304 KB
testcase_21 AC 152 ms
41,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int length=sc.nextInt();
        int eat=sc.nextInt();
        
        int count=0;
        
        while(length>eat*2){
            length-=eat*2;
            count++;
        }
    
        System.out.println(eat*count);
    }
}
0