标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 712 Accepted Submission(s): 439
#include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <algorithm> #include <set> #include <vector> #include <sstream> #include <queue> #include <typeinfo> #include <fstream> typedef long long ll; using namespace std; //freopen("D.in","r",stdin); //freopen("D.out","w",stdout); #define sspeed ios_base::sync_with_stdio(0);cin.tie(0) #define maxn 1005 const int inf=0x7fffffff; //无限大 int a[maxn]; int main() { int n; cin>>n; while(n--) { //memset(a,0,sizeof(a)); int b; scanf("%d",&b); ll ans1=0; ll ans2=0; for(int i=0;i<b;i++) { scanf("%d",&a[i]); if(i%2==0) ans1+=a[i]; else ans2+=a[i]; } if(ans1!=ans2) cout<<"No"<<endl; else { int flag=0; for(int i=0;i<b;i++) { if(a[i]!=a[b-i-1]) { flag=1; break; } } if(flag==0) cout<<"No"<<endl; else cout<<"Yes"<<endl; } } return 0; }
标签:
原文地址:http://www.cnblogs.com/qscqesze/p/4176205.html