-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRAINBOWA.cpp
More file actions
67 lines (64 loc) · 830 Bytes
/
RAINBOWA.cpp
File metadata and controls
67 lines (64 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include<vector>
using namespace std;
int main() {
int t;
cin>>t;
for(int i=0;i<t;i++){
int n;
cin>>n;
vector<int> a(n);
for(int j=0;j<n;j++){
cin>>a[j];
}
vector<int> b(11,0);
int k=0;
for(int j=0;j<(n+1)/2;j++){
int l=0;
int s=1;
if(a[j]==a[n-1-j]){
int h=a[j];
b[h]++;
if(a[j]==s){
if(s>l){
continue;
}
else{
k=1;
break;
}
}
else{
l=s;
s=a[j];
}
if(s<=7){
}
else{
k=1;
break;
}
}
else{
k=1;
break;
}
}
for(int j=1;j<8;j++){
if(b[j]>0){
continue;
}
else{
k=1;
break;
}
}
if(k==0){
cout<<"yes"<<endl;
}
if(k==1){
cout<<"no"<<endl;
}
}
return 0;
}