We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2271005 commit eb56d79Copy full SHA for eb56d79
1833C - Vlad Building Beautiful Array.cpp
@@ -0,0 +1,38 @@
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];
18
+ for(int i=0; i<n; i++)
19
20
+ cin>>a[i];
21
+ }
22
+ int mini = INT_MAX;
23
+ int cnt = 0;
24
25
26
+ if(a[i]%2==0)
27
+ cnt++;
28
+ mini = min(mini, a[i]);
29
30
+ if(cnt == n)
31
+ cout<<"YES"<<endl;
32
+ else if(mini%2 == 0)
33
+ cout<<"NO"<<endl;
34
+ else
35
36
37
+ return 0;
38
+}
0 commit comments