結果

問題 No.51 やる気の問題
ユーザー matsuyoshi30
提出日時 2016-02-04 12:32:22
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 2,227 ms
コンパイル使用メモリ 74,164 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2024-09-21 20:29:33
合計ジャッジ時間 6,193 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int W = in.nextInt();
		int D = in.nextInt();
		int temp = 0;

		for(int i=1; i<=D-1; i++) {
			temp = (int)Math.floor(W / D * D);
			W -= temp;
			D--;
		}

		System.out.println(temp);
	}
}
0