結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー arashin
提出日時 2021-03-31 21:36:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 1,782 ms
コンパイル使用メモリ 172,320 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-15 15:59:11
合計ジャッジ時間 3,790 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1 RE * 1
other AC * 8 WA * 2 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using u64 = uint_least64_t;
using s64 = int_least64_t;
using ll = uint_least64_t;

int main(){
	int n,m,x,y;

	cin >> n >> m >> x >> y;
	vector<int> a;
    for (int i = 0; i < n; i++){
		int aa;
		cin >> aa;
		if (aa > y){
			a.push_back(aa);
		}
	}
	if (a.size() < m){
		cout << "Handicapped" << endl;
	}
	sort(a.begin(),a.end());
	int ans = 0;
	for (int i = a.size()-1; i >= a.size()-m; i--){
		ans += a[i];
	}
	if (a[a.size()-m-1] >= x){
		cout << "Handicapped" << endl;
	}else{
		cout << ans << endl;
	}
}
0