結果

問題 No.51 やる気の問題
ユーザー dazydazy
提出日時 2016-09-08 23:07:58
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 653 bytes
コンパイル時間 2,819 ms
コンパイル使用メモリ 74,820 KB
実行使用メモリ 54,052 KB
最終ジャッジ日時 2024-04-27 18:05:18
合計ジャッジ時間 6,142 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
53,668 KB
testcase_01 AC 106 ms
53,356 KB
testcase_02 AC 100 ms
52,852 KB
testcase_03 AC 108 ms
53,288 KB
testcase_04 AC 115 ms
53,908 KB
testcase_05 RE -
testcase_06 AC 110 ms
53,828 KB
testcase_07 AC 113 ms
53,740 KB
testcase_08 AC 110 ms
53,564 KB
testcase_09 RE -
testcase_10 AC 107 ms
53,540 KB
testcase_11 AC 113 ms
53,892 KB
testcase_12 AC 120 ms
54,052 KB
testcase_13 AC 104 ms
52,616 KB
testcase_14 AC 114 ms
53,908 KB
testcase_15 RE -
testcase_16 AC 109 ms
53,348 KB
testcase_17 AC 120 ms
53,700 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 108 ms
53,528 KB
testcase_21 AC 120 ms
53,808 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int W = scan.nextInt();
        int D = scan.nextInt();
        if (!match(W, D)) System.exit(1);

        int yaruki;
        while (D > 1) {
            W -= W/(D * D);
            if (W <= 0) {
                System.out.println("0");
                System.exit(0);
            }
            D--;
        }
        System.out.println(W);
    }

    public static boolean match (int... args) {
        for (int i : args) {
            if (i < 1||i > 100000) return false;
        }
        return true;
    }
}
0