結果
問題 |
No.406 鴨等間隔の法則
|
ユーザー |
![]() |
提出日時 | 2022-10-15 18:14:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 57 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 1,950 ms |
コンパイル使用メモリ | 202,964 KB |
最終ジャッジ日時 | 2025-02-08 06:48:24 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> S(N); for(int i=0;i<N;i++) cin>>S[i]; sort(S.begin(),S.end()); set<int> s; for(int i=1;i<N;i++)s.insert(S[i]-S[i-1]); cout<<((s.size() == 1 && !s.count(0)) ? "YES" : "NO")<<endl; }