結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-10-28 23:30:59 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 162 ms / 5,000 ms |
| コード長 | 333 bytes |
| コンパイル時間 | 2,448 ms |
| コンパイル使用メモリ | 73,984 KB |
| 実行使用メモリ | 41,432 KB |
| 最終ジャッジ日時 | 2024-12-30 14:22:10 |
| 合計ジャッジ時間 | 7,184 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double w=sc.nextInt();
int d=sc.nextInt();
double ans=0;
for(int i=0;i<d;i++){
double x=(w/(d-i))/(d-i);
w-=(int)x;
if(i==d-1)ans=(int)x;
}
System.out.println((int)ans);
}}