結果

問題 No.51 やる気の問題
ユーザー shinwisteriashinwisteria
提出日時 2019-01-21 21:52:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 150 ms / 5,000 ms
コード長 334 bytes
コンパイル時間 4,058 ms
コンパイル使用メモリ 72,248 KB
実行使用メモリ 56,272 KB
最終ジャッジ日時 2023-10-13 17:21:15
合計ジャッジ時間 7,994 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
55,928 KB
testcase_01 AC 141 ms
55,644 KB
testcase_02 AC 140 ms
56,080 KB
testcase_03 AC 141 ms
56,000 KB
testcase_04 AC 144 ms
55,872 KB
testcase_05 AC 150 ms
55,948 KB
testcase_06 AC 147 ms
56,240 KB
testcase_07 AC 147 ms
55,648 KB
testcase_08 AC 145 ms
55,904 KB
testcase_09 AC 149 ms
55,768 KB
testcase_10 AC 146 ms
55,960 KB
testcase_11 AC 143 ms
55,896 KB
testcase_12 AC 146 ms
55,856 KB
testcase_13 AC 149 ms
55,640 KB
testcase_14 AC 146 ms
56,272 KB
testcase_15 AC 148 ms
56,020 KB
testcase_16 AC 150 ms
55,608 KB
testcase_17 AC 144 ms
55,836 KB
testcase_18 AC 149 ms
56,088 KB
testcase_19 AC 148 ms
55,756 KB
testcase_20 AC 147 ms
55,912 KB
testcase_21 AC 145 ms
53,920 KB
testcase_22 AC 149 ms
55,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No51 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		double W = s.nextDouble() , D = s.nextDouble();
		s.close();
		for(int i = 0;i < D -1;i++){
			double d2 = D - i;
			int w2 = (int)Math.floor(W/d2/d2);
			W -= w2;
		}
		System.out.println((int)W);

	}

}
0