結果

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

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &&v : a) cin >> v;
    int vl = a[0] + a.back();
    int l = 0, r = n - 1;
    while(l <= r){
        if(a[l] + a[r] != vl){
            cout << "No\n";
            return 0;
        }
        l++, r--;
    }
    cout << "Yes\n";
}
0