結果

問題 No.51 やる気の問題
ユーザー mustonmuston
提出日時 2016-05-19 15:49:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 633 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-04-16 01:22:44
合計ジャッジ時間 6,230 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,200 KB
testcase_01 AC 134 ms
41,600 KB
testcase_02 AC 133 ms
41,368 KB
testcase_03 AC 139 ms
41,236 KB
testcase_04 AC 136 ms
41,188 KB
testcase_05 AC 140 ms
41,512 KB
testcase_06 AC 136 ms
41,476 KB
testcase_07 AC 137 ms
41,136 KB
testcase_08 AC 138 ms
41,360 KB
testcase_09 AC 139 ms
41,312 KB
testcase_10 AC 140 ms
41,180 KB
testcase_11 AC 138 ms
41,320 KB
testcase_12 AC 137 ms
41,312 KB
testcase_13 AC 138 ms
41,268 KB
testcase_14 AC 140 ms
41,344 KB
testcase_15 AC 141 ms
41,404 KB
testcase_16 AC 138 ms
41,500 KB
testcase_17 AC 138 ms
41,540 KB
testcase_18 AC 140 ms
41,464 KB
testcase_19 AC 141 ms
41,188 KB
testcase_20 AC 138 ms
41,516 KB
testcase_21 AC 135 ms
41,188 KB
testcase_22 AC 137 ms
41,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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