結果

問題 No.998 Four Integers
ユーザー asdfghjkl;
提出日時 2020-02-28 22:08:28
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-13 17:45:32
合計ジャッジ時間 874 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 16 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int cmp(const void *a,const void *b){
    if(*(int*)a>*(int*)b){return -1;}
    else if(*(int*)a<*(int*)b){return 1;}
    else {return 0;}
}


int main(void){
int n,l[3];

for(int i=0;i<4;i++){
    scanf("%d",&l[i]);
}

qsort(l,n,sizeof(int),cmp);
//printf("%d%d%d%d",l[0],l[1],l[2],l[3]);
for(int i=1;i<3;i++){
if(l[i-1]-1!=l[i]){printf("No\n"); return 0;}
}
//printf("%d%d%d%d",l[0],l[1],l[2],l[3]);
printf("Yes\n");

}
0