結果

問題 No.51 やる気の問題
ユーザー takutaku
提出日時 2020-09-18 10:38:15
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 504 bytes
コンパイル時間 3,976 ms
コンパイル使用メモリ 74,760 KB
実行使用メモリ 54,628 KB
最終ジャッジ日時 2024-06-22 07:48:27
合計ジャッジ時間 5,820 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 RE * 6
権限があれば一括ダウンロードができます

ソースコード

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[] amount = new int[d];
        
        for(int i = 0; i < d; i++) {
            
            amount[i] = w / ((d-i)*(d-i));
            
            w = w - amount[i];
            
        }
        
        System.out.println(amount[d-1]);
        
	}
}
0