Submission #2147367


Source Code Expand

/* @BEGIN_OF_SOURCE_CODE */
// created by salazar slytherin
#include<bits/stdc++.h>
using namespace std;

#define read                   freopen("in.txt","rt",stdin)
#define write                  freopen("out.txt","wt",stdout)
#define fresh                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define PI                     3.1415926535897932384626433832795
#define mems(ds_name,val)      memset(ds_name,val,sizeof(ds_name))
#define ll					   long long


//      template <class T> inline T  bigmod(T p,T e,T M){ll ret=1;for(;e>0;e>>=1){if(e&1)ret=(ret*p)%M;p=(p*p)%M;}return (T)ret;}
//      template <class T> inline T  gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
//      template <typename T> string NumberToString(T pNumber)	{ostringstream oOStrStream;oOStrStream << pNumber;return oOStrStream.str();}


//      int lcm(int a, int b) {return (a*b)/gcd(a,b);}
//      ll  powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
//      void dec2bin(int n)   {int rem;if(n<=1){v.push_back(n);return;}rem=n%2;dec2bin(n/2);v.push_back(rem);}  // ***vector type
      bool isprime(ll x)    {if(x<=1)return 0;ll n=sqrt(x);for(ll i=2;i<=n;i++){if(x%i==0)return 0;}return 1;}

vector<int >v;
int main()
{
    fresh;
//    read;//write;

    ll n;
    cin>>n;
    ll even,odd;
    even=odd=0;
    for(int i=0;i<n;i++){
        int x;cin>>x;
        if(x%2==0)even++;
        else odd++;
    }
    if(odd%2==0)cout<<"YES\n";
    else cout<<"NO\n";

    return 0;

}



/* @END_OF_SOURCE_CODE */

Submission Info

Submission Time
Task A - Addition
User vjudge2
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1564 Byte
Status AC
Exec Time 11 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 16
Set Name Test Cases
Sample sample1.txt, sample2.txt
All sample1.txt, sample2.txt, in1.txt, in10.txt, in11.txt, in12.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt
Case Name Status Exec Time Memory
in1.txt AC 11 ms 256 KB
in10.txt AC 11 ms 256 KB
in11.txt AC 1 ms 256 KB
in12.txt AC 1 ms 256 KB
in2.txt AC 11 ms 256 KB
in3.txt AC 11 ms 256 KB
in4.txt AC 11 ms 256 KB
in5.txt AC 11 ms 256 KB
in6.txt AC 11 ms 256 KB
in7.txt AC 11 ms 256 KB
in8.txt AC 11 ms 256 KB
in9.txt AC 11 ms 256 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB