結果

問題 No.51 やる気の問題
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-12-05 12:24:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 341 bytes
コンパイル時間 4,451 ms
コンパイル使用メモリ 71,932 KB
実行使用メモリ 56,960 KB
最終ジャッジ日時 2023-08-18 15:07:09
合計ジャッジ時間 7,464 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,928 KB
testcase_01 AC 116 ms
54,692 KB
testcase_02 AC 117 ms
56,960 KB
testcase_03 AC 117 ms
55,692 KB
testcase_04 AC 117 ms
55,684 KB
testcase_05 AC 120 ms
56,596 KB
testcase_06 AC 120 ms
55,688 KB
testcase_07 AC 121 ms
55,748 KB
testcase_08 AC 117 ms
55,952 KB
testcase_09 AC 121 ms
55,500 KB
testcase_10 AC 118 ms
55,444 KB
testcase_11 AC 119 ms
55,484 KB
testcase_12 AC 119 ms
55,480 KB
testcase_13 AC 119 ms
55,908 KB
testcase_14 AC 119 ms
55,736 KB
testcase_15 AC 120 ms
55,688 KB
testcase_16 AC 120 ms
56,108 KB
testcase_17 AC 119 ms
55,868 KB
testcase_18 AC 120 ms
55,696 KB
testcase_19 AC 119 ms
55,860 KB
testcase_20 AC 118 ms
55,976 KB
testcase_21 AC 118 ms
55,720 KB
testcase_22 AC 120 ms
55,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No_051 {// やる気の問題
	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 > 1; i--) {
			int tmp = (W / (int) (Math.pow(i, 2)));
			W -= tmp;
		}
		System.out.println(W);
	}
}
0