結果

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

ソースコード

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);
    }
    int i = 0;
    while (A > 0 && i < N-1){
        if (H[i] <= X && H[i] != 0){
            H[i]=0;
            A--;
            i++;
        } 
        else if(H[i] != 0 && H[i] > X){
            H[i] = H[i] - X;
            A--;
        }
        else{
            break;
        }


        }
        
        
    

    

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

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

        
        
        
    
}
0