結果

問題 No.51 やる気の問題
ユーザー cocomoff
提出日時 2019-08-06 09:48:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 307 bytes
コンパイル時間 1,156 ms
コンパイル使用メモリ 159,072 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 13:51:25
合計ジャッジ時間 1,717 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h> 

using namespace std;

int main() {
    double W, D; cin >> W >> D;
    double last;
    for (int i = 0; i < D; i++) {
        double work = W / ((D - i) * (D - i));
        if (i == D - 1)
            last = floor(work);
        W -= floor(work);
    }
    cout << last << endl;
}
0