結果

問題 No.51 やる気の問題
ユーザー YatsukuYatsuku
提出日時 2015-12-10 21:01:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 338 bytes
コンパイル時間 3,229 ms
コンパイル使用メモリ 72,232 KB
実行使用メモリ 57,848 KB
最終ジャッジ日時 2023-10-13 10:39:17
合計ジャッジ時間 6,779 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,764 KB
testcase_01 AC 123 ms
56,032 KB
testcase_02 AC 123 ms
55,472 KB
testcase_03 AC 128 ms
56,080 KB
testcase_04 AC 126 ms
55,792 KB
testcase_05 AC 133 ms
56,256 KB
testcase_06 AC 132 ms
57,848 KB
testcase_07 AC 132 ms
55,900 KB
testcase_08 AC 130 ms
54,088 KB
testcase_09 AC 136 ms
56,064 KB
testcase_10 AC 131 ms
55,932 KB
testcase_11 AC 131 ms
55,968 KB
testcase_12 AC 131 ms
56,132 KB
testcase_13 AC 132 ms
55,708 KB
testcase_14 AC 130 ms
55,708 KB
testcase_15 AC 132 ms
56,044 KB
testcase_16 AC 134 ms
55,796 KB
testcase_17 AC 132 ms
56,076 KB
testcase_18 AC 134 ms
55,892 KB
testcase_19 AC 132 ms
56,016 KB
testcase_20 AC 133 ms
56,000 KB
testcase_21 AC 129 ms
55,488 KB
testcase_22 AC 128 ms
55,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class No_51 {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);

		int work = stdIn.nextInt();
		int day = stdIn.nextInt();
		
		double tmp;
		while ( day != 1 ) {
			tmp = work / Math.pow(day, 2);	
			day -= 1;
			work -= Math.floor(tmp);
		}
		System.out.println(work);
	}
}
0