結果

問題 No.1736 Princess vs. Dragoness
ユーザー distortedibudistortedibu
提出日時 2021-11-12 22:10:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 722 bytes
コンパイル時間 1,722 ms
コンパイル使用メモリ 169,212 KB
実行使用メモリ 17,088 KB
最終ジャッジ日時 2024-11-25 19:00:28
合計ジャッジ時間 92,936 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1
other AC * 2 WA * 2 TLE * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N =0;int A=0;int B=0;int X=0;int Y=0;
    cin >> N >> A >> B >> X >> Y ;
    vector<int> H(N);
    for (int i = 0;i<N;i++){
        cin >> H.at(i);
    }
    while (A > 0){
        int i = 0;
        if(i < N-1){
            
            if (H[i] <= A && H[i] != 0){
            H[i]=0;
            A--;
            i++;
        } 
        else if(H[i] != 0 && H[i] > A){
            H[i] = H[i] - X;
            A--;
        }


        }
        
    }

    

    int sum_H = accumulate(H.begin(), H.end(), 0);
    if (sum_H <= B * Y){
        cout << "Yes"<<endl;

    }
    else{
         cout << "No"<<endl;
    }

        
        
        
    
}
0