Advertisement
SorahISA

[PCCA 2020 pH]

Feb 13th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define int long long
  5.  
  6. #define fastIO() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
  7.  
  8. int32_t main() {
  9.     fastIO();
  10.    
  11.     int n;
  12.     cin >> n;
  13.    
  14.     vector<int> v(n), ans;
  15.     for (auto &x : v) {
  16.         cin >> x;
  17.         if (~x & 1) ans.push_back(x);
  18.     }
  19.    
  20.     sort(ans.begin(), ans.end());
  21.    
  22.     if (ans.empty() or ans.size() == 1) cout << "NO\n";
  23.     else if (ans.size() & 1) cout << "OuO\n" << ans[0] << "\n";
  24.     else {
  25.         cout << "YES\n";
  26.         int sz = ans.size();
  27.         for (int i = 0; i < sz; ++i) {
  28.             cout << ans[i] << " \n"[i == sz-1];
  29.         }
  30.     }
  31.    
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement