結果

問題 No.51 やる気の問題
ユーザー omc-testomc-test
提出日時 2016-08-03 13:35:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 403 bytes
コンパイル時間 2,109 ms
コンパイル使用メモリ 73,692 KB
実行使用メモリ 41,376 KB
最終ジャッジ日時 2024-04-24 15:12:40
合計ジャッジ時間 5,551 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
41,152 KB
testcase_01 AC 125 ms
41,376 KB
testcase_02 AC 120 ms
41,024 KB
testcase_03 AC 113 ms
40,056 KB
testcase_04 AC 111 ms
39,780 KB
testcase_05 AC 123 ms
40,888 KB
testcase_06 AC 121 ms
41,044 KB
testcase_07 AC 114 ms
40,180 KB
testcase_08 AC 112 ms
39,964 KB
testcase_09 AC 116 ms
39,848 KB
testcase_10 AC 121 ms
40,984 KB
testcase_11 AC 108 ms
39,908 KB
testcase_12 AC 127 ms
41,136 KB
testcase_13 AC 108 ms
39,952 KB
testcase_14 AC 120 ms
39,892 KB
testcase_15 AC 124 ms
40,988 KB
testcase_16 AC 118 ms
40,624 KB
testcase_17 AC 123 ms
40,976 KB
testcase_18 AC 123 ms
41,096 KB
testcase_19 AC 125 ms
41,148 KB
testcase_20 AC 119 ms
41,116 KB
testcase_21 AC 123 ms
41,192 KB
testcase_22 AC 125 ms
41,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int d = sc.nextInt();
		sc.close();
		double work = 0;;
		if(d == 0){
			work = w;
		}else{
			for(int i=0, d2=d; i<d2; i++){
				work = (double)w / ((double)d * (double)d);
				w -= (int)work;
				d--;
			}
		}
		System.out.println((int)work);
	}
}
0