結果

問題 No.51 やる気の問題
ユーザー jimanojimano
提出日時 2017-05-06 10:31:00
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 509 bytes
コンパイル時間 1,769 ms
コンパイル使用メモリ 72,076 KB
実行使用メモリ 49,852 KB
最終ジャッジ日時 2023-10-12 14:57:33
合計ジャッジ時間 4,016 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,208 KB
testcase_01 AC 41 ms
49,332 KB
testcase_02 AC 41 ms
49,220 KB
testcase_03 AC 41 ms
49,072 KB
testcase_04 AC 42 ms
49,056 KB
testcase_05 RE -
testcase_06 AC 43 ms
49,060 KB
testcase_07 AC 43 ms
49,072 KB
testcase_08 AC 43 ms
49,780 KB
testcase_09 RE -
testcase_10 AC 42 ms
49,212 KB
testcase_11 AC 42 ms
49,264 KB
testcase_12 AC 43 ms
49,252 KB
testcase_13 AC 42 ms
49,144 KB
testcase_14 AC 42 ms
49,204 KB
testcase_15 RE -
testcase_16 AC 42 ms
49,364 KB
testcase_17 AC 41 ms
49,272 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 42 ms
49,152 KB
testcase_21 AC 41 ms
49,276 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main{
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			int w = Integer.parseInt(br.readLine());
			int d = Integer.parseInt(br.readLine());
			int moto = 0;

			while (d > 0) {
				moto = w / (d * d);
				w = w - moto;
				d--;
			}
			System.out.println(moto);

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0