結果

問題 No.51 やる気の問題
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-12-05 13:35:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 5,980 ms
コンパイル使用メモリ 74,364 KB
実行使用メモリ 41,260 KB
最終ジャッジ日時 2024-05-05 20:20:27
合計ジャッジ時間 6,669 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,024 KB
testcase_01 AC 115 ms
41,208 KB
testcase_02 AC 118 ms
41,168 KB
testcase_03 AC 106 ms
40,076 KB
testcase_04 AC 108 ms
40,180 KB
testcase_05 AC 120 ms
41,144 KB
testcase_06 AC 112 ms
40,360 KB
testcase_07 AC 106 ms
39,776 KB
testcase_08 AC 105 ms
39,940 KB
testcase_09 AC 114 ms
40,668 KB
testcase_10 AC 130 ms
41,144 KB
testcase_11 AC 131 ms
40,808 KB
testcase_12 AC 113 ms
40,152 KB
testcase_13 AC 124 ms
40,980 KB
testcase_14 AC 127 ms
41,152 KB
testcase_15 AC 126 ms
40,868 KB
testcase_16 AC 122 ms
40,888 KB
testcase_17 AC 128 ms
41,260 KB
testcase_18 AC 122 ms
40,972 KB
testcase_19 AC 107 ms
40,176 KB
testcase_20 AC 115 ms
40,972 KB
testcase_21 AC 109 ms
40,140 KB
testcase_22 AC 120 ms
40,936 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();
		sc.close();
		for (int i = D; i > 1; i--) {
			int tmp = (W / (int) (Math.pow(i, 2)));
			W -= tmp;
		}
		System.out.println(W);
	}
}
0