結果

問題 No.51 やる気の問題
ユーザー l1267976l1267976
提出日時 2017-03-10 19:12:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 489 bytes
コンパイル時間 4,816 ms
コンパイル使用メモリ 73,256 KB
実行使用メモリ 56,332 KB
最終ジャッジ日時 2023-09-06 13:18:47
合計ジャッジ時間 8,343 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
55,624 KB
testcase_01 AC 108 ms
55,632 KB
testcase_02 AC 109 ms
55,600 KB
testcase_03 AC 112 ms
55,764 KB
testcase_04 AC 112 ms
55,904 KB
testcase_05 AC 119 ms
55,672 KB
testcase_06 AC 124 ms
55,320 KB
testcase_07 AC 131 ms
55,344 KB
testcase_08 AC 130 ms
55,896 KB
testcase_09 AC 135 ms
55,812 KB
testcase_10 AC 132 ms
55,424 KB
testcase_11 AC 131 ms
55,872 KB
testcase_12 AC 132 ms
55,584 KB
testcase_13 AC 133 ms
55,708 KB
testcase_14 AC 133 ms
55,748 KB
testcase_15 AC 126 ms
55,560 KB
testcase_16 AC 116 ms
56,332 KB
testcase_17 AC 114 ms
56,076 KB
testcase_18 AC 112 ms
55,668 KB
testcase_19 AC 113 ms
55,896 KB
testcase_20 AC 115 ms
56,092 KB
testcase_21 AC 116 ms
55,740 KB
testcase_22 AC 116 ms
55,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No51 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int d = sc.nextInt();

        for (int i = d; i > 0; i--) {
            double yaruki = w / Math.pow(i, 2);
            int iYaruki = (int) Math.floor(yaruki);
            w -= iYaruki;

            if (i == 1) {
                System.out.println(iYaruki);
            }
        }

        sc.close();
    }

}
0