結果
| 問題 | No.3387 23578 Sequence |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-02-09 02:37:37 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,052 bytes |
| 記録 | |
| コンパイル時間 | 2,052 ms |
| コンパイル使用メモリ | 214,524 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-02-09 02:37:41 |
| 合計ジャッジ時間 | 3,679 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long
static const long long MOD = 1000000007;
static const int MAXN = 1000000; // adjust as
ll inf = 1e17;
ll f(ll x, ll num) {
if (num > x) return x + 1;
else if (num == x) return x;
else return x- 1;
}
ll power(ll base, ll exp) {
ll res = 1;
base %= MOD;
while (exp > 0) {
if (exp % 2 == 1) res = (res * base) % MOD;
base = (base * base) % MOD;
exp /= 2;
}
return res;
}
void solve() {
ll n;
cin >> n;
vector<ll>arr(n);
for (ll i = 0; i< n; i++) {
cin >> arr[i];
}
ll sum = arr[0] + arr[n - 1];
ll i = 0;
ll j = n - 1;
while (i < j) {
ll num = arr[i] + arr[j];
if (num != sum) {
cout << "No" << endl;
return;
}
i++;
j--;
}
cout << "Yes" << endl;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
// int t;
// cin >> t;
// while (t--)
// {
// solve();
// }
solve();
return 0;
}
vjudge1