We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cee1174 commit 5295cb8Copy full SHA for 5295cb8
1669C - Odd Even Increments.cpp
@@ -0,0 +1,37 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int main()
10
+{
11
+ int t;
12
+ cin>>t;
13
+ while(t--)
14
+ {
15
+ int n;
16
+ cin>>n;
17
+ int a[n], i, maxi = 0;
18
+ for(i = 0; i < n; i++)
19
20
+ cin>>a[i];
21
+ }
22
+ bool no = false;
23
+ for(i = 0; i < n-2; i++){
24
+ if(a[i]%2 != a[i+2]%2) {
25
+ no = true;
26
+ break;
27
28
29
+ if(no)
30
+ cout<<"NO"<<endl;
31
+ else
32
+ cout<<"YES"<<endl;
33
34
+ return 0;
35
+}
36
37
0 commit comments