結果

問題 No.51 やる気の問題
ユーザー shinshin
提出日時 2022-05-17 07:42:14
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 759 bytes
コンパイル時間 3,639 ms
コンパイル使用メモリ 74,032 KB
実行使用メモリ 50,192 KB
最終ジャッジ日時 2023-10-13 03:37:12
合計ジャッジ時間 5,883 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,300 KB
testcase_01 AC 44 ms
49,452 KB
testcase_02 AC 43 ms
49,384 KB
testcase_03 AC 44 ms
49,328 KB
testcase_04 AC 44 ms
49,472 KB
testcase_05 RE -
testcase_06 WA -
testcase_07 AC 47 ms
49,192 KB
testcase_08 AC 45 ms
49,280 KB
testcase_09 RE -
testcase_10 AC 46 ms
49,228 KB
testcase_11 AC 45 ms
49,388 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 45 ms
49,344 KB
testcase_15 RE -
testcase_16 AC 45 ms
49,332 KB
testcase_17 AC 43 ms
49,344 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 AC 45 ms
49,528 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No51 {

	public static void main(String[] args) throws IOException{
		//やる気の問題
		String[] text = readStr();
		int W = Integer.parseInt(text[0]) , D = Integer.parseInt(text[1]);
		while(D > 1){
			W = W - Math.floorDiv(W, D * D);
			D--;
		}
		
		System.out.println(W);

	}
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();

		do {
			list.add(br.readLine());
		}while(br.ready());

		br.close();

		String[] text = new String[list.size()];
		list.toArray(text);

		return text;

	}

}
0