結果

問題 No.51 やる気の問題
ユーザー kohaku_kohaku
提出日時 2016-11-11 05:14:50
言語 Java
(openjdk 23)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 1,891 ms
コンパイル使用メモリ 73,988 KB
実行使用メモリ 54,152 KB
最終ジャッジ日時 2024-11-25 07:50:56
合計ジャッジ時間 5,691 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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();
        
        while(D!=1){
            int w1d = W/D/D;
            W = W - w1d;
            D--;
        }
        System.out.println(W);
    }
}
0