結果

問題 No.51 やる気の問題
ユーザー fushime2
提出日時 2018-02-25 23:35:14
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 96,640 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 23:57:14
合計ジャッジ時間 1,466 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.algorithm, std.string, std.string, std.conv;
int readint() {
    return readln.chomp.to!int;
}
void main(){
    int w = readint(), d = readint();
    int ans = 0;
    while(w > 0 && d > 0) {
        ans = w / d / d;
        d--;
        w -= ans;
    }
    writeln(ans);
    auto _ = readln();
}
0