Skip to content

Commit 5f34687

Browse files
authored
Merge pull request kothariji#128 from Dipeshtwis/master
Add Codechef solution
2 parents 082412c + cae8112 commit 5f34687

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Codechef solutions/COVIDLQ.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* Dipesh Kumar */
2+
3+
#include <bits/stdc++.h>
4+
using namespace std;
5+
int main() {
6+
int t;
7+
cin>>t;
8+
while(t--){
9+
int n;
10+
cin>>n;
11+
int a[n];
12+
int f =1;
13+
vector<int> v;
14+
for(int i=0; i<n; i++){
15+
cin>>a[i];
16+
if(a[i]==1){
17+
v.push_back(i);
18+
}
19+
}
20+
for(int i =1; i<v.size(); i++){
21+
if(v[i]-v[i-1]<6){
22+
f = 0;
23+
break;
24+
}
25+
}
26+
if(f==0){
27+
cout<<"NO"<<endl;
28+
}
29+
else
30+
cout<<"YES"<<endl;
31+
}
32+
return 0;
33+
}
34+

0 commit comments

Comments
 (0)