結果

問題 No.51 やる気の問題
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-13 18:08:55
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 354 bytes
コンパイル時間 1,902 ms
コンパイル使用メモリ 74,408 KB
実行使用メモリ 41,468 KB
最終ジャッジ日時 2024-05-07 09:40:11
合計ジャッジ時間 5,411 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
40,108 KB
testcase_01 AC 105 ms
40,148 KB
testcase_02 AC 114 ms
41,072 KB
testcase_03 AC 115 ms
41,096 KB
testcase_04 AC 117 ms
41,284 KB
testcase_05 RE -
testcase_06 AC 124 ms
41,324 KB
testcase_07 AC 119 ms
40,984 KB
testcase_08 AC 119 ms
41,244 KB
testcase_09 RE -
testcase_10 AC 123 ms
41,196 KB
testcase_11 AC 116 ms
40,944 KB
testcase_12 AC 106 ms
40,236 KB
testcase_13 AC 118 ms
41,336 KB
testcase_14 AC 116 ms
41,120 KB
testcase_15 RE -
testcase_16 AC 114 ms
40,088 KB
testcase_17 AC 119 ms
41,204 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 118 ms
41,100 KB
testcase_21 AC 120 ms
41,280 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int w = sc.nextInt();
		int d = sc.nextInt();
		double a = 0;
		while (true) {
			if (d==1) {break;}
			else {
				a = Math.floor(w/(d*d));
				w -= (int)a;
				d--;
			}
		}
		System.out.println(w);
	}
}
0