結果

問題 No.51 やる気の問題
ユーザー yagi2yagi2
提出日時 2017-04-25 17:41:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 407 bytes
コンパイル時間 1,925 ms
コンパイル使用メモリ 72,436 KB
実行使用メモリ 56,460 KB
最終ジャッジ日時 2023-10-11 09:50:07
合計ジャッジ時間 5,525 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,804 KB
testcase_01 AC 104 ms
56,316 KB
testcase_02 AC 103 ms
55,600 KB
testcase_03 AC 108 ms
56,404 KB
testcase_04 AC 104 ms
56,152 KB
testcase_05 AC 113 ms
56,328 KB
testcase_06 AC 115 ms
55,704 KB
testcase_07 AC 122 ms
56,236 KB
testcase_08 AC 113 ms
55,528 KB
testcase_09 AC 113 ms
56,104 KB
testcase_10 AC 110 ms
55,880 KB
testcase_11 AC 109 ms
56,460 KB
testcase_12 AC 115 ms
56,024 KB
testcase_13 AC 111 ms
55,756 KB
testcase_14 AC 117 ms
56,276 KB
testcase_15 AC 114 ms
55,544 KB
testcase_16 AC 109 ms
55,816 KB
testcase_17 AC 108 ms
56,036 KB
testcase_18 AC 114 ms
55,768 KB
testcase_19 AC 112 ms
55,768 KB
testcase_20 AC 112 ms
56,032 KB
testcase_21 AC 117 ms
56,260 KB
testcase_22 AC 119 ms
55,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int W = Integer.parseInt(sc.next());
        int D = Integer.parseInt(sc.next());

        int K = 0;
        for (int i = D; i > 0; i--) {
            K = (int)Math.floor(W / Math.pow(i, 2));
            W -= K;
        }
        System.out.println(K);
    }
}
0