Advertisement
Zeinab_Hamdy

Untitled

Apr 9th, 2023
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.36 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define ull unsigned ll
  5. #define nl "\n"
  6. #define sz(x) int(x.size())
  7. #define NumOfDigit(w) log10(w) + 1
  8. #define fill(arr, val)  memset(arr, val , sizeof(arr))
  9. #define PI 3.141592654
  10. #define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
  11. #define all(v) v.begin(), v.end()
  12. #define rall(v) v.rbegin(), v.rend()
  13. #define fi first
  14. #define se second
  15. #define cin(v) for (auto&i:v) cin >> i;
  16. #define cout(v) for (auto&i:v) cout << i << " ";
  17. #define fixed(n) fixed << setprecision(n)
  18. //#define MOD  1e9 + 7
  19.  
  20.  
  21. void IO(){
  22.     ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  23. }
  24. void files(){
  25.     //freopen("filename.in" , "r" ,stdin);
  26.             #ifndef ONLINE_JUDGE
  27.               freopen("input.txt", "r", stdin);  freopen("output.txt", "w", stdout);
  28.             #endif
  29. }
  30.  
  31.  
  32.  
  33. void solve(){
  34. int n ;
  35. cin >> n ;
  36. vector <ll > v(n);
  37. int cnt4=0 , cnt2=0 , odd=0;
  38. for(auto& i : v){
  39.     cin >> i;
  40.     if( i % 4==0) cnt4++;
  41.     else if(i % 2 ==0 ) cnt2++;
  42.     else odd++;
  43.    
  44. }
  45.  
  46.  
  47. if( odd ==0 )    cout <<"YES";
  48. else if( cnt4 >= odd  ) cout <<"YES";
  49. else cout <<"NO";
  50.  
  51. }
  52. int main(){
  53.                  IO();       //  files();
  54.  
  55.     int testCase=1;  // one test case
  56.    // cin >> testCase ;      
  57.  while(testCase--)
  58.         solve();  // my code
  59.        
  60.     return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement