結果

問題 No.3387 23578 Sequence
コンテスト
ユーザー vjudge1
提出日時 2026-02-09 02:29:03
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 1,578 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,384 ms
コンパイル使用メモリ 336,484 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-02-09 02:29:09
合計ジャッジ時間 5,317 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

//Bismillah
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define f(i, a, n) for (int i = a; i < n; i++)
#define fn(i,a,n) for (int i = n - 1; i >= a; i--)
#define pr(vec) {for(auto &value: vec) cout<<value<<" ";} nl;
#define iv(vec) for(auto &value: vec) cin>>value;
#define pb push_back
#define p(a) cout << a << "\n";
#define file_read(filepath) freopen(filepath, "r", stdin);
#define file_write(filepath) freopen(filepath, "w", stdout);
#define fr first
#define se second
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define uset unordered_set
#define mset unordered_multiset
#define vb vector<bool>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int>>
#define MOD1 1000000007
#define mii map<int,int>
#define sz(a) a.size()
#define ld long double
#define ins insert
int rev(int a, int b) { return a > b; }
#define nl cout<<"\n";
#define ned ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);int t = 1;
int test  = 1;
const int N = 1e7 + 5;
vector<bool> is_prime(N, true);
void sieve() {is_prime[0] = is_prime[1] = false;for (int i = 2; i * i < N; i++) {if (is_prime[i]) {for (int j = i * i; j < N; j += i) {is_prime[j] = false;}}}}

void solve(){
    int n; cin>>n;
    vi a(n);
    iv(a);

    int x = a[0] + a[n-1];
    f(i,0,n){
        if(x != a[i]+a[n-1-i]){
            p("No");
            return;
        }
    }
    p("Yes");
}

signed main(){
    ned;
    // cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}
0