Advertisement
Zuneve

awd7wju754h

Oct 14th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int main() {
  5. int n, cnt1=0, cnt2=0;
  6. cin >> n;
  7. vector <int> a(n, 0);
  8. for (int i = 0; i<n; i++) {
  9. cin >> a[i];
  10. if (a[i]%2==0) {
  11. cnt1++;
  12. } else {
  13. cnt2++;
  14. cout << a[i] << " ";
  15. }
  16. } cout << endl;
  17. for (int i = 0; i<n; i++) {
  18. if (a[i]%2==0) {
  19. cout << a[i] << " ";
  20. }
  21. } cout << endl;
  22. if (cnt1>=cnt2) cout << "YES";
  23. else cout << "NO";
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement