結果

問題 No.51 やる気の問題
ユーザー tenten
提出日時 2020-11-05 08:33:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 74,684 KB
実行使用メモリ 41,376 KB
最終ジャッジ日時 2024-07-22 10:49:09
合計ジャッジ時間 5,209 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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