結果

問題 No.51 やる気の問題
ユーザー mustonmuston
提出日時 2016-05-19 15:45:21
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 630 bytes
コンパイル時間 2,268 ms
コンパイル使用メモリ 74,616 KB
実行使用メモリ 41,596 KB
最終ジャッジ日時 2024-04-16 01:10:48
合計ジャッジ時間 6,114 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,436 KB
testcase_01 AC 135 ms
41,308 KB
testcase_02 AC 133 ms
41,432 KB
testcase_03 AC 135 ms
41,412 KB
testcase_04 AC 138 ms
41,384 KB
testcase_05 RE -
testcase_06 AC 122 ms
40,332 KB
testcase_07 AC 122 ms
40,360 KB
testcase_08 AC 134 ms
41,320 KB
testcase_09 RE -
testcase_10 AC 137 ms
41,596 KB
testcase_11 AC 137 ms
41,396 KB
testcase_12 AC 138 ms
41,488 KB
testcase_13 AC 133 ms
41,436 KB
testcase_14 AC 135 ms
41,288 KB
testcase_15 RE -
testcase_16 AC 132 ms
41,352 KB
testcase_17 AC 130 ms
41,136 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 130 ms
41,152 KB
testcase_21 AC 130 ms
41,168 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
/*yukicoder No51 やる気の問題*/
class No51{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int w = scan.nextInt();  //仕事の量
    int d = scan.nextInt();  //残りの日数
    int worked = 0;  //一日に終わらせる仕事量
    //仕事をする
    while(1<d){
      //その日にする仕事量を出す
      worked = w/(d*d);
      //仕事の量から終わらせた仕事を引く
      w -= worked;
      //残りの日数を1減らす
      d--;
    }
    //最後の日の仕事量を出力
    System.out.println(w);
  }
}
0