結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
41,416 KB
testcase_01 AC 119 ms
40,956 KB
testcase_02 AC 126 ms
41,084 KB
testcase_03 AC 113 ms
39,872 KB
testcase_04 AC 113 ms
39,872 KB
testcase_05 RE -
testcase_06 AC 114 ms
40,000 KB
testcase_07 AC 123 ms
41,144 KB
testcase_08 AC 105 ms
39,572 KB
testcase_09 RE -
testcase_10 AC 131 ms
41,212 KB
testcase_11 AC 130 ms
41,444 KB
testcase_12 AC 113 ms
40,024 KB
testcase_13 AC 123 ms
40,860 KB
testcase_14 AC 112 ms
40,036 KB
testcase_15 RE -
testcase_16 AC 116 ms
40,980 KB
testcase_17 AC 116 ms
40,604 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 125 ms
41,372 KB
testcase_21 AC 121 ms
41,096 KB
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

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();
		int work = 0;;
		if(d == 0){
			work = w;
		}else{
			for(int i=0, d2=d; i<d2; i++){
				work = w / (d * d);
				w -= work;
				d--;
			}
		}
		System.out.println(work);
	}
}
0