結果

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

ソースコード

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