結果

問題 No.998 Four Integers
コンテスト
ユーザー asdfghjkl;
提出日時 2020-02-28 22:08:28
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 481 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 150 ms
コンパイル使用メモリ 38,848 KB
最終ジャッジ日時 2026-02-22 05:24:16
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 16 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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