結果

問題 No.1736 Princess vs. Dragoness
ユーザー distortedibudistortedibu
提出日時 2021-11-12 23:29:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 770 bytes
コンパイル時間 1,439 ms
コンパイル使用メモリ 171,472 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 11:19:10
合計ジャッジ時間 2,935 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 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 WA -
testcase_07 AC 53 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 41 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 72 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 22 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 6 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 7 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 11 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 3 ms
5,376 KB
testcase_30 AC 14 ms
5,376 KB
testcase_31 AC 19 ms
5,376 KB
testcase_32 WA -
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 1 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){
        sort(H.begin(), H.end(), std::greater<int>() );
        if (H[i] <= X && H[i] != 0){
            H[i]=0;
            A--;
            
        } 
        else if(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