結果
| 問題 | 
                            No.1453 手助け
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-03-31 21:20:45 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 808 bytes | 
| コンパイル時間 | 3,928 ms | 
| コンパイル使用メモリ | 191,484 KB | 
| 最終ジャッジ日時 | 2025-01-20 02:48:46 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 10 WA * 11 | 
ソースコード
/**
*    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 x = d;
    for(int i=1; i<=a; i++){
        if(i==1) ans+=(b-c)*x;
        else{
            if(i%10!=0) ans+=(b-c)*x;
            if(i%10==0 && e<=x){
                x-=e;
                ans+=(b-c)*x;
            }
            if(i%10==0 && e>x) ans+=(b-c)*x;
        }
    }
    cout << ans << endl;
}