結果

問題 No.63 ポッキーゲーム
ユーザー kameyama_skameyama_s
提出日時 2023-05-29 17:17:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 498 ms / 5,000 ms
コード長 321 bytes
コンパイル時間 3,435 ms
コンパイル使用メモリ 70,432 KB
実行使用メモリ 56,468 KB
最終ジャッジ日時 2023-08-27 23:46:32
合計ジャッジ時間 7,207 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,992 KB
testcase_01 AC 118 ms
56,076 KB
testcase_02 AC 118 ms
55,660 KB
testcase_03 AC 121 ms
56,468 KB
testcase_04 AC 116 ms
55,640 KB
testcase_05 AC 117 ms
56,120 KB
testcase_06 AC 119 ms
55,964 KB
testcase_07 AC 122 ms
55,980 KB
testcase_08 AC 118 ms
56,020 KB
testcase_09 AC 122 ms
55,676 KB
testcase_10 AC 127 ms
56,044 KB
testcase_11 AC 498 ms
55,624 KB
testcase_12 AC 134 ms
55,692 KB
testcase_13 AC 498 ms
55,844 KB
testcase_14 AC 125 ms
56,056 KB
testcase_15 AC 132 ms
56,224 KB
testcase_16 AC 118 ms
56,016 KB
testcase_17 AC 473 ms
55,664 KB
testcase_18 AC 120 ms
56,036 KB
testcase_19 AC 174 ms
55,928 KB
testcase_20 AC 131 ms
56,236 KB
testcase_21 AC 140 ms
56,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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