結果
| 問題 | No.406 鴨等間隔の法則 |
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-18 10:38:32 |
| 言語 | C (gcc 15.2.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 646 bytes |
| 記録 | |
| コンパイル時間 | 145 ms |
| コンパイル使用メモリ | 39,360 KB |
| 最終ジャッジ日時 | 2026-02-22 13:17:37 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | TLE * 2 -- * 27 |
ソースコード
#include <stdio.h>
#include <stdbool.h>
void main(void) {
int n = 0;
scanf("%d",&n);
int duckList[n];
for(int i = 0 ; i < n ; i++){
scanf("%d",&duckList[i]);
}
bool duckFlg = true;
for(int i = 0 ; i < n ; i++){
for(int j = i ; j < n ; j++){
if(duckList[i] < duckList[j]){
int num = duckList[i];
duckList[i] = duckList[j];
duckList[j] = num;
}
}
}
int criteria = duckList[0] - duckList[1];
if(criteria == 0){
duckFlg = false;
}else{
for(int i = 1 ; i < n-1 ; i++){
if(criteria != duckList[i] - duckList[i+1]){
duckFlg = false;
}
}
}
if(duckFlg){
printf("YES");
}else{
printf("NO");
}
}
Maeda