結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,780 KB
testcase_01 AC 125 ms
55,696 KB
testcase_02 AC 122 ms
56,000 KB
testcase_03 AC 123 ms
56,028 KB
testcase_04 AC 123 ms
55,776 KB
testcase_05 RE -
testcase_06 AC 128 ms
53,984 KB
testcase_07 AC 129 ms
55,396 KB
testcase_08 AC 127 ms
55,576 KB
testcase_09 RE -
testcase_10 AC 126 ms
55,356 KB
testcase_11 AC 126 ms
55,624 KB
testcase_12 AC 128 ms
55,960 KB
testcase_13 AC 128 ms
55,656 KB
testcase_14 AC 127 ms
56,308 KB
testcase_15 RE -
testcase_16 AC 124 ms
56,184 KB
testcase_17 AC 124 ms
56,000 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 126 ms
55,664 KB
testcase_21 AC 123 ms
55,660 KB
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;
            }else{
                break;
            }
        }
        System.out.println(rw);
    }
}
0