結果

問題 No.51 やる気の問題
ユーザー omc-test
提出日時 2016-08-03 13:27:24
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 366 bytes
コンパイル時間 2,140 ms
コンパイル使用メモリ 73,848 KB
実行使用メモリ 41,588 KB
最終ジャッジ日時 2024-11-06 23:42:33
合計ジャッジ時間 6,240 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 RE * 6
権限があれば一括ダウンロードができます

ソースコード

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