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.
1 parent deb3952 commit 78a959eCopy full SHA for 78a959e
CodeChef_problems/COVIDq_CodeChef.cpp
@@ -0,0 +1,44 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main() {
5
+ // your code goes here
6
+ int T;
7
+ cin>>T;
8
+ while(T--)
9
+ {
10
+ int N;
11
+ int flag=0;
12
+ cin>>N;
13
+ int arr[N];
14
+ for(int i=0;i<N;i++)
15
16
+ cin>>arr[i];
17
18
+ }
19
+ for(int j=0;j<N;j++)
20
21
+ if(arr[j]==1)
22
23
+ for(int k=j+1;k<=j+5 && k<N;k++)
24
25
+ if(arr[k]==1)
26
27
28
+ flag=1;
29
+ break;
30
31
32
33
34
+ if(flag==1)
35
36
37
+ if(flag==0)
38
+ cout<<"YES"<<endl;
39
+ else
40
+ cout<<"NO"<<endl;
41
42
+ return 0;
43
+}
44
0 commit comments