結果

問題 No.1453 手助け
ユーザー shu8Creamshu8Cream
提出日時 2021-03-31 21:16:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 823 bytes
コンパイル時間 2,326 ms
コンパイル使用メモリ 200,172 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-09 04:28:12
合計ジャッジ時間 3,032 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
*    author:  shu8Cream
*    created: 31.03.2021 20:51:18
**/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a,b,c,d,e;
    cin >> a >> b >> c >> d >> e;
    int ans = 0;
    if(b-c<=0){
        cout << 0 << endl;
        return 0;
    }
    int tmp = d;
    for(int i=1; i<=a; i++){
        if(i==1) ans+=(b-c)*tmp;
        else{
            if(i%10!=0) ans+=(b-c)*tmp;
            if(i%10==0 && e<=tmp){
                tmp-=e;
                ans+=(b-c)*tmp;
            }
            if(i%10==0 && e>tmp) ans=(b-c)*tmp;
        }
    }
    cout << ans << endl;
}
0