結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー chacoder1chacoder1
提出日時 2021-12-30 18:57:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 2,382 ms
コンパイル使用メモリ 197,560 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 03:48:23
合計ジャッジ時間 3,276 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long

signed main(){
  int n,m,x,y;cin>>n>>m>>x>>y;
  int a[n];
  int cnt=0;
  rep(i,n){
    cin>>a[i];
    if(a[i]>=x) cnt++;
  }
  if(cnt>=m){
    cout<<"Handicapped"<<endl;
    return 0;
  }
  sort(a,a+n);
  cnt=0;
  int ans=0;
  rep(i,n){
    if(a[i]<=y){
      cnt++;
      continue;
    }
    if(cnt<(n-m)){
      cnt++;
      continue;
    }
    ans+=a[i];
  }
  cout<<ans<<endl;
  return 0;
}
0