結果
| 問題 |
No.1454 ツブ消ししとるなEasy
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2021-04-01 16:08:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 2,000 ms |
| コード長 | 976 bytes |
| コンパイル時間 | 1,222 ms |
| コンパイル使用メモリ | 97,684 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-17 19:36:40 |
| 合計ジャッジ時間 | 2,082 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 1454.cc: No.1454 ツブ消ししとるなEasy - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int MAX_N = 100000;
/* typedef */
typedef long long ll;
/* global variables */
int as[MAX_N];
/* subroutines */
/* main */
int main() {
int n, m, x, y;
scanf("%d%d%d%d", &n, &m, &x, &y);
for (int i = 0; i < n; i++) scanf("%d", as + i);
sort(as, as + n);
int k = lower_bound(as, as + n, x) - as;
if (n - k > m) { puts("Handicapped"); return 0; }
int l = max<int>(upper_bound(as, as + n, y) - as, n - m);
ll sum = 0;
for (int i = l; i < n; i++) sum += as[i];
printf("%lld\n", sum);
return 0;
}
tnakao0123