結果

問題 No.51 やる気の問題
ユーザー tentententen
提出日時 2020-11-05 08:33:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 2,080 ms
コンパイル使用メモリ 71,292 KB
実行使用メモリ 57,348 KB
最終ジャッジ日時 2023-09-29 16:43:51
合計ジャッジ時間 6,426 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,924 KB
testcase_01 AC 123 ms
55,724 KB
testcase_02 AC 124 ms
55,920 KB
testcase_03 AC 124 ms
55,984 KB
testcase_04 AC 124 ms
55,784 KB
testcase_05 AC 126 ms
56,036 KB
testcase_06 AC 124 ms
57,348 KB
testcase_07 AC 125 ms
56,180 KB
testcase_08 AC 124 ms
55,744 KB
testcase_09 AC 126 ms
55,932 KB
testcase_10 AC 123 ms
55,796 KB
testcase_11 AC 122 ms
55,900 KB
testcase_12 AC 124 ms
55,896 KB
testcase_13 AC 125 ms
56,240 KB
testcase_14 AC 125 ms
55,740 KB
testcase_15 AC 125 ms
56,208 KB
testcase_16 AC 124 ms
55,972 KB
testcase_17 AC 120 ms
55,604 KB
testcase_18 AC 124 ms
55,652 KB
testcase_19 AC 124 ms
56,176 KB
testcase_20 AC 120 ms
55,764 KB
testcase_21 AC 122 ms
55,844 KB
testcase_22 AC 126 ms
55,436 KB
権限があれば一括ダウンロードができます

ソースコード

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 ans = 0;
		while (w > 0) {
		    ans = w;
		    w -= w / d / d;
		    d--;
		}
		System.out.println(ans);
	}
}
0