結果

問題 No.1736 Princess vs. Dragoness
ユーザー matcharate12matcharate12
提出日時 2022-03-23 11:08:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 1,332 ms
コンパイル使用メモリ 165,552 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 16:36:21
合計ジャッジ時間 2,357 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <string.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define srep(i,a,b) for(int i = a; i < b; i++)
#define all(A) (A).begin(),A.end()
#define MOD 1000000007
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void){
	int N,A,B,X,Y; cin >> N >> A >> B >> X >> Y;
	vector<int> H(N);

	int M = 0,p = 0;
	rep(i,N){
		cin >> H[i];
		if(M < H[i]) M = H[i],p = i;
	}
	while(A){
		A--;
		H[p] -= X;
	}

	int P = Y;
	rep(i,B){
		rep(j,N){
			if(H[j] <= 0) continue;
			else {
				int D = min(P,H[j]);
				H[j] -= D; P -= D;
			}
		}
	}

	bool ok = 1;
	rep(i,N) if(H[i] > 0) ok = 0;
	cout << (ok ? "Yes" : "No");
}
0