結果
| 問題 | No.51 やる気の問題 | 
| コンテスト | |
| ユーザー |  spacia | 
| 提出日時 | 2015-12-20 10:37:20 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 59 ms / 5,000 ms | 
| コード長 | 468 bytes | 
| コンパイル時間 | 2,171 ms | 
| コンパイル使用メモリ | 74,332 KB | 
| 実行使用メモリ | 50,452 KB | 
| 最終ジャッジ日時 | 2024-09-17 11:55:38 | 
| 合計ジャッジ時間 | 4,226 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 | 
ソースコード
import java.io.*;
import java.util.*;
class Main51 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int w = Integer.parseInt(br.readLine());
		int d = Integer.parseInt(br.readLine());
		int ans = 0;
		
		for (int i = 0; i < d; i++)
			w -= ans = w / (int)Math.pow(d - i, 2);
		
		out(ans);
	}
}
            
            
            
        