結果

問題 No.51 やる気の問題
ユーザー kaoetayakaoetaya
提出日時 2016-11-09 12:37:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 2,934 ms
コンパイル使用メモリ 74,204 KB
実行使用メモリ 54,464 KB
最終ジャッジ日時 2024-05-03 23:53:47
合計ジャッジ時間 6,347 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
54,064 KB
testcase_01 AC 104 ms
53,000 KB
testcase_02 AC 116 ms
54,100 KB
testcase_03 AC 120 ms
54,080 KB
testcase_04 AC 119 ms
54,124 KB
testcase_05 AC 117 ms
54,252 KB
testcase_06 AC 117 ms
54,148 KB
testcase_07 AC 102 ms
52,332 KB
testcase_08 AC 111 ms
53,684 KB
testcase_09 AC 116 ms
53,924 KB
testcase_10 AC 121 ms
54,144 KB
testcase_11 AC 128 ms
54,056 KB
testcase_12 AC 126 ms
54,148 KB
testcase_13 AC 127 ms
54,464 KB
testcase_14 AC 116 ms
54,128 KB
testcase_15 AC 106 ms
52,928 KB
testcase_16 AC 103 ms
53,088 KB
testcase_17 AC 102 ms
53,156 KB
testcase_18 AC 113 ms
52,860 KB
testcase_19 AC 111 ms
53,448 KB
testcase_20 AC 103 ms
53,072 KB
testcase_21 AC 110 ms
54,040 KB
testcase_22 AC 107 ms
52,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class pre {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
		long w = s.nextInt(),d = s.nextInt(),lastw=0;
		
		while(d>0){
			lastw = w / (d*d);
			w -= lastw;
			d--;
		}
		
		System.out.println(lastw);
    }
}
0