結果
| 問題 |
No.406 鴨等間隔の法則
|
| コンテスト | |
| ユーザー |
kongarishisyamo
|
| 提出日時 | 2016-08-09 03:39:28 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 356 bytes |
| コンパイル時間 | 615 ms |
| コンパイル使用メモリ | 60,488 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 11:35:30 |
| 合計ジャッジ時間 | 2,137 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include<iostream>
#include<algorithm>
using namespace std;
#define NMAX 100000
int main(){
int N;
long long x[NMAX];
cin>>N;
for(int i=0;i<N;i++) cin>>x[i];
sort(x,x+N);
long long dis=x[1]-x[0];
for(int i=2;i<N;i++){
if(x[i]-x[i-1]!=dis){
cout<<"NO"<<endl;
return 0;
}
}
if(dis!=0) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
kongarishisyamo