Skip to content

Commit eb56d79

Browse files
committed
Added 1833C - Vlad Building Beautiful Array.cpp
1 parent 2271005 commit eb56d79

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Diff for: 1833C - Vlad Building Beautiful Array.cpp

+38
Original file line numberDiff line numberDiff line change
@@ -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+
for(int i=0; i<n; i++)
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+
cout<<"YES"<<endl;
36+
}
37+
return 0;
38+
}

0 commit comments

Comments
 (0)