結果

問題 No.51 やる気の問題
ユーザー koukonkokoukonko
提出日時 2015-12-07 17:09:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 512 bytes
コンパイル時間 2,330 ms
コンパイル使用メモリ 71,344 KB
実行使用メモリ 49,932 KB
最終ジャッジ日時 2023-10-12 20:05:02
合計ジャッジ時間 4,152 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,392 KB
testcase_01 AC 44 ms
49,316 KB
testcase_02 AC 44 ms
49,312 KB
testcase_03 AC 45 ms
49,580 KB
testcase_04 AC 45 ms
49,592 KB
testcase_05 AC 47 ms
49,620 KB
testcase_06 AC 46 ms
49,456 KB
testcase_07 AC 46 ms
49,400 KB
testcase_08 AC 45 ms
49,524 KB
testcase_09 AC 48 ms
49,616 KB
testcase_10 AC 45 ms
49,500 KB
testcase_11 AC 46 ms
49,420 KB
testcase_12 AC 46 ms
49,620 KB
testcase_13 AC 46 ms
49,464 KB
testcase_14 AC 46 ms
49,420 KB
testcase_15 AC 47 ms
49,580 KB
testcase_16 AC 45 ms
49,452 KB
testcase_17 AC 46 ms
49,504 KB
testcase_18 AC 49 ms
49,496 KB
testcase_19 AC 48 ms
49,652 KB
testcase_20 AC 46 ms
49,596 KB
testcase_21 AC 45 ms
49,416 KB
testcase_22 AC 49 ms
49,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			int W = Integer.parseInt(buff.readLine());
			double D = Double.parseDouble(buff.readLine());
			while(D > 1){
				W -= (int)(W / Math.pow(D, 2));
				D--;
			}

			System.out.println(W);
		} catch (NumberFormatException e) {

		} catch (IOException e) {

		}
	}
}
0