結果

問題 No.51 やる気の問題
ユーザー villachvillach
提出日時 2017-10-05 16:35:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 2,733 ms
コンパイル使用メモリ 73,856 KB
実行使用メモリ 54,176 KB
最終ジャッジ日時 2024-04-28 07:33:27
合計ジャッジ時間 6,227 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
52,816 KB
testcase_01 AC 110 ms
54,008 KB
testcase_02 AC 114 ms
54,168 KB
testcase_03 AC 113 ms
54,124 KB
testcase_04 AC 107 ms
53,328 KB
testcase_05 AC 121 ms
54,176 KB
testcase_06 AC 107 ms
52,960 KB
testcase_07 AC 125 ms
54,104 KB
testcase_08 AC 124 ms
53,524 KB
testcase_09 AC 122 ms
54,104 KB
testcase_10 AC 107 ms
53,160 KB
testcase_11 AC 116 ms
41,408 KB
testcase_12 AC 109 ms
41,316 KB
testcase_13 AC 118 ms
40,944 KB
testcase_14 AC 103 ms
41,400 KB
testcase_15 AC 114 ms
41,428 KB
testcase_16 AC 108 ms
40,828 KB
testcase_17 AC 121 ms
40,980 KB
testcase_18 AC 111 ms
41,404 KB
testcase_19 AC 118 ms
41,560 KB
testcase_20 AC 117 ms
41,412 KB
testcase_21 AC 115 ms
41,272 KB
testcase_22 AC 112 ms
40,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

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