結果

問題 No.51 やる気の問題
ユーザー itezpaceitezpace
提出日時 2016-08-21 11:54:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 1,850 ms
コンパイル使用メモリ 74,152 KB
実行使用メモリ 41,944 KB
最終ジャッジ日時 2024-04-25 11:07:47
合計ジャッジ時間 5,557 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,412 KB
testcase_01 AC 115 ms
41,556 KB
testcase_02 AC 130 ms
41,496 KB
testcase_03 AC 117 ms
41,340 KB
testcase_04 AC 110 ms
40,684 KB
testcase_05 AC 118 ms
41,120 KB
testcase_06 AC 119 ms
40,576 KB
testcase_07 AC 109 ms
40,840 KB
testcase_08 AC 136 ms
41,944 KB
testcase_09 AC 130 ms
41,352 KB
testcase_10 AC 122 ms
41,432 KB
testcase_11 AC 114 ms
40,972 KB
testcase_12 AC 107 ms
40,676 KB
testcase_13 AC 127 ms
41,308 KB
testcase_14 AC 110 ms
40,784 KB
testcase_15 AC 118 ms
40,736 KB
testcase_16 AC 118 ms
41,204 KB
testcase_17 AC 110 ms
40,888 KB
testcase_18 AC 127 ms
41,488 KB
testcase_19 AC 114 ms
40,704 KB
testcase_20 AC 107 ms
41,108 KB
testcase_21 AC 119 ms
41,572 KB
testcase_22 AC 124 ms
41,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Yuki51 {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double w = sc.nextDouble();
    double d = sc.nextDouble();
    for(double i=d; i>1; --i){
      double a = i*i;
      double b = w/a;
      int c = (int)b;
      w-=c;
    }
    int w2 = (int)w;
    System.out.println(w2);
  }
}
0