結果
| 問題 |
No.1736 Princess vs. Dragoness
|
| コンテスト | |
| ユーザー |
incuiio
|
| 提出日時 | 2023-05-10 16:51:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,052 bytes |
| コンパイル時間 | 1,231 ms |
| コンパイル使用メモリ | 132,096 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-07-04 14:07:17 |
| 合計ジャッジ時間 | 2,279 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <list>
#include <climits>
#include <bitset>
#include <numeric>
#include <cassert>
#include <regex>
using std::cout;
using std::cin;
using std::string;
using std::vector;
int main()
{
int n, a, b;
cin >> n >> a >> b;
long long x, y;
cin >> x >> y;
std::priority_queue<long long> arr;
long long total_health = 0;
for (int i = 0; i < n; i++)
{
long long health;
cin >> health;
arr.push(health);
total_health += health;
}
long long a_damage = 0;
while (a > 0)
{
a_damage += std::min(arr.top(), x);
long long new_health = arr.top() - std::min(arr.top(), x);
arr.pop();
arr.push(new_health);
a--;
}
if (a_damage >= total_health - b * y)
{
cout << "Yes";
}
else
{
cout << "No";
}
}
incuiio