結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー kpinkcatkpinkcat
提出日時 2023-09-05 10:55:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 2,336 ms
コンパイル使用メモリ 204,448 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 10:55:22
合計ジャッジ時間 4,370 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 26 ms
4,376 KB
testcase_08 AC 26 ms
4,380 KB
testcase_09 AC 27 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using namespace std;


int main()
{
    int n, m, x, y, cntMin = 0, cntMax = 0, sum1 = 0;
    cin >> n >> m >> x >> y;
    vector<int> a(n);
    cntMax = n;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    for (int i = 0; i < n; i++){
        if (a[i] >= x) cntMin++;
        if ((n-m) <= i && a[i] > y) sum1 += a[i];
    }
    cout << ((cntMin <= m) ? to_string(sum1) : "Handicapped") << endl;
}
0