結果

問題 No.3387 23578 Sequence
コンテスト
ユーザー Tehom
提出日時 2025-11-28 21:24:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 653 bytes
コンパイル時間 4,298 ms
コンパイル使用メモリ 251,320 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-11-28 21:24:17
合計ジャッジ時間 5,511 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repl(i,a,b) for(ll i=(a);i<(b);i++)
#define all(a) (a).begin(),(a).end()

template <typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;} return false;}
template <typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;} return false;}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n; cin >> n;
  vector<int> a(n);
  rep(i,0,n) cin >> a[i];
  bool ch=true;
  rep(i,0,n)if(a[i]+a[n-1-i] != a[0]+a[n-1]) ch=false;
  cout << (ch ? "Yes" : "No") << endl;
}
0