結果

問題 No.51 やる気の問題
ユーザー kuramukuramu
提出日時 2016-01-21 00:25:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 4,060 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 53,444 KB
最終ジャッジ日時 2023-10-21 13:38:37
合計ジャッジ時間 6,326 ms
ジャッジサーバーID
(参考情報)
judge14 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
52,324 KB
testcase_01 AC 57 ms
53,432 KB
testcase_02 AC 56 ms
52,344 KB
testcase_03 AC 57 ms
53,428 KB
testcase_04 AC 56 ms
53,432 KB
testcase_05 AC 59 ms
53,424 KB
testcase_06 AC 58 ms
53,436 KB
testcase_07 AC 57 ms
53,444 KB
testcase_08 AC 56 ms
53,436 KB
testcase_09 AC 58 ms
53,432 KB
testcase_10 AC 56 ms
52,312 KB
testcase_11 AC 56 ms
53,436 KB
testcase_12 AC 57 ms
53,432 KB
testcase_13 AC 57 ms
53,424 KB
testcase_14 AC 56 ms
53,444 KB
testcase_15 AC 59 ms
52,340 KB
testcase_16 AC 57 ms
53,428 KB
testcase_17 AC 57 ms
53,444 KB
testcase_18 AC 59 ms
53,428 KB
testcase_19 AC 59 ms
52,368 KB
testcase_20 AC 57 ms
52,352 KB
testcase_21 AC 55 ms
53,440 KB
testcase_22 AC 59 ms
53,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));

	      try {
		      long W =Long.parseLong(stdReader.readLine());
		      long D = Long.parseLong(stdReader.readLine());
		      while(D>1){
		    	  long temp = W /(D*D);
		    	  W -= temp;
		    	  D--;
		      }
		      System.out.println(W);
	    	  } catch (IOException e) {
			e.printStackTrace();
	      }
	}	
}
0