以下の内容はhttps://blog.hamayanhamayan.com/entry/2020/05/02/225626より取得しました。


1% [AtCoder Beginner Contest 165 B]

https://atcoder.jp/contests/abc165/tasks/abc165_b

解説

https://atcoder.jp/contests/abc165/submissions/12650100

制約が1018となっている、C++ではintではオーバーフローするので、long longで受け取ること。
入力例で1000000000000000000は3760とあるので、シミュレーションすると、結構な速さで貯金額が増えるようだ。
愚直にシミュレーションをして、何日後にX以上となるかを求めよう。

ll X;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> X;

    ll x = 100;
    int ans = 0;
    while (x < X) {
        x = x + x / 100;
        ans++;
    }
    cout << ans << endl;
}



以上の内容はhttps://blog.hamayanhamayan.com/entry/2020/05/02/225626より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14