結果

問題 No.406 鴨等間隔の法則
ユーザー 1white_princess1white_princess
提出日時 2022-02-12 13:28:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 1,676 ms
コンパイル使用メモリ 175,680 KB
実行使用メモリ 8,596 KB
最終ジャッジ日時 2023-09-11 00:44:39
合計ジャッジ時間 5,005 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
5,236 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 70 ms
7,976 KB
testcase_05 AC 22 ms
4,932 KB
testcase_06 AC 24 ms
5,016 KB
testcase_07 AC 24 ms
5,112 KB
testcase_08 AC 71 ms
7,700 KB
testcase_09 AC 74 ms
8,288 KB
testcase_10 AC 28 ms
5,252 KB
testcase_11 AC 58 ms
7,392 KB
testcase_12 AC 34 ms
5,708 KB
testcase_13 AC 31 ms
5,624 KB
testcase_14 AC 70 ms
7,536 KB
testcase_15 AC 3 ms
4,380 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 7 ms
4,380 KB
testcase_20 AC 9 ms
4,376 KB
testcase_21 WA -
testcase_22 AC 17 ms
4,380 KB
testcase_23 AC 37 ms
5,940 KB
testcase_24 AC 62 ms
6,920 KB
testcase_25 AC 79 ms
8,596 KB
testcase_26 AC 84 ms
8,584 KB
testcase_27 AC 37 ms
4,376 KB
testcase_28 AC 63 ms
8,532 KB
testcase_29 AC 91 ms
8,580 KB
testcase_30 AC 87 ms
8,308 KB
testcase_31 AC 76 ms
8,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(LL i = a;i<b; i++)
#define rrep(i,a,b) for(LL i = a;i>b; i--)
#define INF ((1LL<<62)-(1LL<<31))
#define ooki 9,223,372,036,854,775,807
#define tii -9,223,372,036,854,775,808
typedef long long LL;
int main(){
 LL n;
  cin >> n;
  set<LL> s;
  vector<LL> x(n);
  rep(i,0,n){cin>>x[i];s.insert(x[i]);}
  if(s.size()!=n){cout<<"NO"<<endl;return 0;}
  sort(x.begin(),x.end());
  LL a = x[1]-x[0];
  rep(i,0,n-1){
    if(x[i+1]-x[i]!=a){cout<<"NO"<<endl;}
  }
  cout << "YES" << endl;
}
  

    
  
    
     
   
   
    
    
    
 
    



    


0