結果

問題 No.51 やる気の問題
ユーザー kichirb3
提出日時 2018-03-06 09:41:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 442 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 70,712 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-15 08:05:23
合計ジャッジ時間 2,742 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.51 やる気の問題
// https://yukicoder.me/problems/no/51
//

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int solve(int W, int D);


int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    int W, D;
    cin >> W >> D;
    int ans = solve(W, D);
    cout << ans << endl;
}

int solve(int W, int D) {
    for (; D > 1; --D) {
        W -= W / (D*D);
    }
    return W;
}
0