We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 082412c + cae8112 commit 5f34687Copy full SHA for 5f34687
Codechef solutions/COVIDLQ.cpp
@@ -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