結果

問題 No.1453 手助け
ユーザー warm4C0
提出日時 2024-05-25 10:57:50
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 3,066 ms
コンパイル使用メモリ 244,496 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 19:38:56
合計ジャッジ時間 4,088 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;

    if (b-c == 0) {
        puts("0");
        return 0;
    }

    int ans = d;
    int pre = d;
    for (int i = 1; i < (b-c)*a; i++) {
        if ((i+1)%10 == 0 && e <= pre) {
            pre = pre-e;
        }
        ans += pre;
    }

    cout << ans << endl;

    return 0;
}
0