結果

問題 No.1736 Princess vs. Dragoness
ユーザー distortedibudistortedibu
提出日時 2021-11-12 22:16:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 1,729 ms
コンパイル使用メモリ 168,464 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 09:13:38
合計ジャッジ時間 3,159 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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){

        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