結果

問題 No.51 やる気の問題
ユーザー tsunabittsunabit
提出日時 2018-08-05 04:31:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 485 bytes
コンパイル時間 3,965 ms
コンパイル使用メモリ 75,788 KB
実行使用メモリ 57,556 KB
最終ジャッジ日時 2023-10-19 22:01:55
合計ジャッジ時間 8,081 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
57,476 KB
testcase_01 AC 136 ms
57,452 KB
testcase_02 AC 136 ms
57,528 KB
testcase_03 AC 137 ms
57,208 KB
testcase_04 AC 136 ms
57,248 KB
testcase_05 AC 139 ms
57,496 KB
testcase_06 AC 138 ms
57,260 KB
testcase_07 AC 140 ms
57,304 KB
testcase_08 AC 139 ms
57,356 KB
testcase_09 AC 140 ms
57,556 KB
testcase_10 AC 140 ms
55,536 KB
testcase_11 AC 138 ms
57,284 KB
testcase_12 AC 139 ms
57,464 KB
testcase_13 AC 139 ms
57,220 KB
testcase_14 AC 138 ms
57,228 KB
testcase_15 AC 141 ms
57,524 KB
testcase_16 AC 139 ms
57,488 KB
testcase_17 AC 137 ms
57,460 KB
testcase_18 AC 140 ms
57,496 KB
testcase_19 AC 141 ms
57,464 KB
testcase_20 AC 138 ms
57,468 KB
testcase_21 AC 138 ms
57,516 KB
testcase_22 AC 140 ms
57,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.Stream;
import java.time.*;
import java.time.format.*;

public class No51 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long w = sc.nextInt(), d = sc.nextInt();
        for(long i = d; i > 1; i--) {
            //System.out.println(w / (Math.pow(i, 2)));
            w -= (int)(w / (i * i));
            //System.out.println(i + " " + w);
        }
        System.out.println(w);
    }
}
0