結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-08 23:07:58 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 653 bytes |
| コンパイル時間 | 3,358 ms |
| コンパイル使用メモリ | 74,568 KB |
| 実行使用メモリ | 54,308 KB |
| 最終ジャッジ日時 | 2024-11-15 22:26:15 |
| 合計ジャッジ時間 | 7,067 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 RE * 6 |
ソースコード
import java.util.*;
public class Run {
public static void main (String arg[]) {
Scanner scan = new Scanner(System.in);
int W = scan.nextInt();
int D = scan.nextInt();
if (!match(W, D)) System.exit(1);
int yaruki;
while (D > 1) {
W -= W/(D * D);
if (W <= 0) {
System.out.println("0");
System.exit(0);
}
D--;
}
System.out.println(W);
}
public static boolean match (int... args) {
for (int i : args) {
if (i < 1||i > 100000) return false;
}
return true;
}
}