結果

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

ソースコード

diff #
raw source code

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

void solve(){
  int n;
  cin>>n;
  int arr[n];
  for(int i=0; i<n ; i++)
  {
    cin>>arr[i];
  }
  
  int sum=0;
  bool flag = true;
  for(int i=0;i<n/2;i++){
   if(i==0){
    sum = arr[i]+arr[n-i-1];
   }else{
      int temp = arr[i]+arr[n-i-1];
      if(sum!=temp)
      flag = false;
   }
  }
  if(flag)
  cout<<"Yes";
  else
  cout<<"No";
  return;
}

int main(){

  int t;
  cin>>t;

  while(t--){
    solve();
    cout<<endl;
  }

  return 0;
}
0