結果

問題 No.51 やる気の問題
ユーザー jimanojimano
提出日時 2017-05-06 10:41:20
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 511 bytes
コンパイル時間 3,686 ms
コンパイル使用メモリ 71,384 KB
実行使用メモリ 51,412 KB
最終ジャッジ日時 2023-10-12 14:57:49
合計ジャッジ時間 4,301 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,448 KB
testcase_01 AC 42 ms
49,316 KB
testcase_02 AC 43 ms
49,364 KB
testcase_03 AC 42 ms
49,344 KB
testcase_04 AC 45 ms
49,340 KB
testcase_05 RE -
testcase_06 AC 43 ms
49,248 KB
testcase_07 AC 43 ms
49,444 KB
testcase_08 AC 42 ms
49,440 KB
testcase_09 RE -
testcase_10 AC 42 ms
49,332 KB
testcase_11 AC 42 ms
49,440 KB
testcase_12 AC 42 ms
49,244 KB
testcase_13 AC 44 ms
49,208 KB
testcase_14 AC 43 ms
49,436 KB
testcase_15 RE -
testcase_16 AC 43 ms
49,284 KB
testcase_17 AC 42 ms
49,176 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 44 ms
49,112 KB
testcase_21 AC 42 ms
49,408 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 = (int)w / (d * d);
				w -= moto;
				d--;
			}
			System.out.println(moto);

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