結果

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

ソースコード

diff #
raw source code

#ifdef ONPC
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#ifdef ONPC
#include "debug.hpp"
#else
#define debug(...) 42
#endif
using namespace std;
#define int long long
#define nl "\n"

void solve()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int &val : a)
    {
        cin >> val;
    }
    int sum = a[0] + a[n - 1];
    bool f = true;
    for (int i = 0; i < n; ++i)
    {
        if (sum != (a[i] + a[n - i - 1]))
            f = false;
    }
    if (f)
    {
        cout << "Yes" << nl;
    }
    else
    {
        cout << "No" << nl;
    }
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    for (int i = 0; i < t; ++i)
    {
        debug(i);
        solve();
    }
    return 0;
}
0