結果

問題 No.51 やる気の問題
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-07 13:06:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 71,972 KB
実行使用メモリ 66,532 KB
最終ジャッジ日時 2023-09-17 06:36:46
合計ジャッジ時間 9,918 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 122 ms
55,900 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 WA -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 WA -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int w = koko.nextInt();
        int d = koko.nextInt();
        int rw = w;
        int rd = d;
        for(int i=0; i<d; i++){
            if(rd>1){
                int done = (int)Math.floor(rw/(rd*rd));
                rw=rw-done;
                rd=rd-1;
                System.out.println(done);
            }else{
                break;
            }
        }
        System.out.println(rw);
    }
}
0