結果

問題 No.51 やる気の問題
ユーザー takutakutakutaku
提出日時 2020-09-18 10:38:15
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 504 bytes
コンパイル時間 3,354 ms
コンパイル使用メモリ 71,448 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2023-09-04 08:39:20
合計ジャッジ時間 8,313 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
55,588 KB
testcase_01 AC 129 ms
55,804 KB
testcase_02 AC 127 ms
55,548 KB
testcase_03 AC 127 ms
55,768 KB
testcase_04 AC 127 ms
55,668 KB
testcase_05 RE -
testcase_06 AC 128 ms
55,708 KB
testcase_07 AC 135 ms
55,436 KB
testcase_08 AC 131 ms
55,764 KB
testcase_09 RE -
testcase_10 AC 128 ms
55,772 KB
testcase_11 AC 131 ms
55,676 KB
testcase_12 AC 129 ms
55,684 KB
testcase_13 AC 130 ms
55,772 KB
testcase_14 AC 131 ms
55,424 KB
testcase_15 RE -
testcase_16 AC 131 ms
55,436 KB
testcase_17 AC 131 ms
55,508 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 127 ms
55,928 KB
testcase_21 AC 128 ms
55,936 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[] 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