結果

問題 No.406 鴨等間隔の法則
ユーザー severrabaen
提出日時 2019-01-02 21:41:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 160,088 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 18:37:04
合計ジャッジ時間 3,516 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k[100005];
cin>>n;
for(int i=0;i<n;++i){cin>>k[i];}
sort(k,k+n);
bool ok=true;
int mon=k[1]-k[0];
for(int i=2;i<n;++i){
  if(k[i]-k[i-1]!=mon){
ok=false;
break;
}
}
if(ok){cout<<"YES"<<endl;}
else{cout<<"NO"<<endl;}
}
0