結果

問題 No.1736 Princess vs. Dragoness
ユーザー distortedibudistortedibu
提出日時 2021-11-12 21:56:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 684 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 168,760 KB
実行使用メモリ 13,952 KB
最終ジャッジ日時 2024-11-25 18:20:44
合計ジャッジ時間 90,201 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
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){
        for (int i = 0 ; i < N ;i++){
            if (H[i] > 0){
            H[i] = H[i] - X;
            A--;
            i--;
            }
            else{
                H[i] = 0;
                break;
                
            }
        }
    int sum_H = accumulate(H.begin(), H.end(), 0);
    if (sum_H <= B * Y){
        cout << "Yes"<<endl;

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

        
        
        
    }
}
0