結果

問題 No.51 やる気の問題
ユーザー htensaihtensai
提出日時 2019-12-06 14:07:16
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 335 bytes
コンパイル時間 1,951 ms
コンパイル使用メモリ 71,816 KB
実行使用メモリ 56,512 KB
最終ジャッジ日時 2023-08-24 19:52:46
合計ジャッジ時間 6,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,884 KB
testcase_01 AC 122 ms
55,928 KB
testcase_02 AC 121 ms
55,980 KB
testcase_03 AC 119 ms
55,644 KB
testcase_04 AC 122 ms
55,964 KB
testcase_05 RE -
testcase_06 AC 123 ms
55,564 KB
testcase_07 AC 122 ms
56,044 KB
testcase_08 AC 120 ms
55,620 KB
testcase_09 RE -
testcase_10 AC 122 ms
55,624 KB
testcase_11 AC 122 ms
55,372 KB
testcase_12 AC 125 ms
55,780 KB
testcase_13 AC 123 ms
56,512 KB
testcase_14 AC 123 ms
55,804 KB
testcase_15 RE -
testcase_16 AC 124 ms
56,000 KB
testcase_17 AC 125 ms
55,588 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 123 ms
55,572 KB
testcase_21 AC 121 ms
55,832 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int d = sc.nextInt();
		int[] arr = new int[d + 1];
		arr[d] = w;
		for (int i = d; i > 1; i--) {
		    arr[i - 1] = arr[i] - arr[i] / (i * i);
		}
		System.out.println(arr[1]);
   }
}

0