-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5.cpp
More file actions
34 lines (29 loc) · 762 Bytes
/
5.cpp
File metadata and controls
34 lines (29 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <math.h>
#include <vector>
#include <iterator>
int main()
{
long long N;
std::cin>>N;
std::vector<long long int> ch, nch;
for(int i = 0; i < N; i ++){
long long int a;
std::cin>>a;
if(a % 2 == 0) ch.push_back(a);
else nch.push_back(a);
}
for(int i = 0; i < nch.size(); i++){
if(i == nch.size()-1 )
std::cout<<nch[i] <<std::endl;
else
std::cout<<nch[i]<<" ";
}
for(int i = 0; i < ch.size(); i++){
if(i == ch.size()-1 )
std::cout<<ch[i]<<std::endl;
else
std::cout<<ch[i]<<" ";
}
ch.size() >= nch.size() ? std::cout<<"YES" : std::cout<<"NO";
}