SHARE
TWEET

Untitled

a guest Aug 17th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #pragma GCC optimize("Ofast,no-stack-protector")
  6. #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
  7. #pragma GCC optimize("unroll-loops")
  8.  
  9. /// Typedef
  10. typedef long long ll;
  11.  
  12. #define sc1(a) scanf("%lld",&a)
  13. #define sc2(a,b) scanf("%lld %lld",&a,&b)
  14.  
  15. #define pf1(a) printf("%lld\n",a)
  16. #define pf2(a,b) printf("%lld %lld\n",a,b)
  17.  
  18. #define mx 100007
  19. #define mod 100000007
  20. #define PI acos(-1.0)
  21.  
  22. #define size1 998244353
  23. #define pb push_back
  24.  
  25. int main()
  26. {
  27.  
  28.     ll m, tc, num, t = 1;
  29.  
  30.     sc1(num);
  31.     ll arr[num];
  32.  
  33.     ll sum = 0, mxx = 0;
  34.     for(ll i = 0; i < num; i++) {
  35.         sc1(arr[i]);
  36.         sum += arr[i];
  37.         mxx = max(mxx, arr[i]);
  38.     }
  39.  
  40.     if(sum & 1 || mxx * 2 > sum) cout << "NO" << endl;
  41.     else cout << "YES" << endl;
  42.  
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top