結果

問題 No.51 やる気の問題
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-03 03:42:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 860 bytes
コンパイル時間 3,347 ms
コンパイル使用メモリ 73,804 KB
実行使用メモリ 56,408 KB
最終ジャッジ日時 2023-09-17 03:53:13
合計ジャッジ時間 7,340 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,192 KB
testcase_01 AC 125 ms
56,116 KB
testcase_02 AC 125 ms
55,816 KB
testcase_03 AC 124 ms
56,388 KB
testcase_04 AC 125 ms
55,968 KB
testcase_05 AC 127 ms
55,652 KB
testcase_06 AC 126 ms
56,020 KB
testcase_07 AC 125 ms
55,732 KB
testcase_08 AC 126 ms
56,168 KB
testcase_09 AC 129 ms
56,128 KB
testcase_10 AC 126 ms
54,252 KB
testcase_11 AC 126 ms
56,324 KB
testcase_12 AC 127 ms
56,236 KB
testcase_13 AC 126 ms
56,068 KB
testcase_14 AC 127 ms
56,072 KB
testcase_15 AC 127 ms
56,408 KB
testcase_16 AC 126 ms
55,604 KB
testcase_17 AC 125 ms
55,772 KB
testcase_18 AC 127 ms
56,032 KB
testcase_19 AC 129 ms
55,744 KB
testcase_20 AC 127 ms
56,352 KB
testcase_21 AC 126 ms
55,464 KB
testcase_22 AC 128 ms
56,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.51 やる気の問題

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No51 {
    
    static final Scanner sc = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        long w = sc.nextInt();
        int d = sc.nextInt();
        long ans = 0;
        for (long i=d; i>0; i--) {
            long t = w/(i*i);
            ans = t;
            w -= t;
        }
        out.println(ans);
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        sc.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0