結果
| 問題 | No.1454 ツブ消ししとるなEasy | 
| コンテスト | |
| ユーザー |  chacoder1 | 
| 提出日時 | 2021-12-30 18:56:49 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 480 bytes | 
| コンパイル時間 | 2,248 ms | 
| コンパイル使用メモリ | 196,412 KB | 
| 最終ジャッジ日時 | 2025-01-27 07:42:05 | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 13 WA * 3 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
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;
}
            
            
            
        