結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー tatuyan_edsontatuyan_edson
提出日時 2021-04-10 22:16:31
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 28,372 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 17:53:21
合計ジャッジ時間 2,058 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>

int comp(const void *p1,const void *p2){
  int n1=*(int *)p1;
  int n2=*(int *)p2;
  return n2-n1;
}

int main(void){
  int N,M,X,Y;
  int array[100000];
  int i,j,k;

  scanf("%d%d%d%d",&N,&M,&X,&Y);
  for(i=0;i<N;i++) scanf("%d",array+i);
  qsort(array,N,sizeof(array[0]),comp);
  k=0;
  for(i=0;i<M;i++){
    if(array[i]<=Y) break;
    k+=array[i];
  }
  if(M!=N && array[M]>=X){
    puts("Handicapped");
  }else{
    printf("%d\n",k);
  }
  return 0;
}
0