結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
asdfghjkl;
|
| 提出日時 | 2020-04-17 19:32:08 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 489 bytes |
| コンパイル時間 | 201 ms |
| コンパイル使用メモリ | 30,080 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-03 10:32:32 |
| 合計ジャッジ時間 | 1,145 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.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 min(int a,int b){
if(a>=b){return b;}
return a;
}
//cww
int main(void){
int a[4];
int min=99;
scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
qsort(a,4,sizeof(int),cmp);
if(a[1]==a[0]+1&&a[2]==a[1]+1&&a[3]==a[2]+1){printf("Yes\n");}
else{printf("No\n");}
}
asdfghjkl;