結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
distortedibu
|
| 提出日時 | 2021-11-12 23:39:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 796 bytes |
| コンパイル時間 | 1,454 ms |
| コンパイル使用メモリ | 171,856 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-25 22:06:39 |
| 合計ジャッジ時間 | 2,925 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 17 |
ソースコード
#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;
}
}
distortedibu