Submission #1091547
Source Code Expand
#include <bits/stdc++.h>
#define MAX 1000000
#define ll unsigned long long
#define upperlimit 1000100
#define INF 1e18
#define eps 1e-8
#define endl '\n'
#define pcc pair<char,char>
#define pii pair<ll,ll>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define MOD 1000000007
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) prllf("%d\n",t)
#define plld(t) prllf("%lld\n",t)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<ll>
#define clr(a) memset(a,MOD,sizeof(a))
#define debug(a) printf("check%d\n",a)
#define csl ios::sync_with_stdio(false);cin.tie(0);
#define INT_SIZE 32
using namespace std;
ll gcd(ll n1,ll n2){
if(n1%n2==0)return n2;
return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent,ll mod)
{
ll ans=1;
while(exponent){
if(exponent&1)ans=(ans*base)%mod;
base=(base*base)%mod;
exponent/=2;
}
return ans;
}
ll phi[MAX];
std::map<ll, ll> mphi;
ll fphi(ll x)
{
if(x<MAX)
return phi[x];
if(mphi[x])
return mphi[x];
ll n=x;
ll result=x;
for(ll i=2LL;i*i<=x;i++)
{
if(x%i==0)
{
while(x%i==0)
x/=i;
result-=result/i;
}
}
if(x>1)
result-=result/x;
mphi[n]=result;
return result;
}
ll f(ll a,ll n,ll m)
{
if(n==1)
return 1;
if(n%2==0)
{
ll first=f(a,n/2LL,m);
ll second=powmod(a,n/2LL,m)*first;
second%=m;
second+=first;
second%=m;
return second;
}
else
{
ll first=f(a,n/2LL,m);
ll second=powmod(a,n/2LL,m)*first;
//cout<<second<<" DEBUG "<<first<<endl;
second%=m;
second+=first+powmod(a,n-1LL,m);
second%=m;
return second;
}
}
int main()
{
/*for(ll i=1;i<MAX;i++)
phi[i]=i-1;
for(ll i=2;i<MAX;i++)
{
if(phi[i]==i-1)
for(ll j=2*i;j<MAX;j+=i)
phi[j]-=phi[j]/i;
}*/
ll t,cnt=0;
cin>>t;
while(t--)
{
int n;
cin>>n;
if(n&1)
cnt++;
}
if(cnt%2==0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
Submission Info
Submission Time |
|
Task |
A - Addition |
User |
deva2802 |
Language |
C++14 (GCC 5.4.1) |
Score |
300 |
Code Size |
2085 Byte |
Status |
AC |
Exec Time |
51 ms |
Memory |
384 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
300 / 300 |
Status |
|
|
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 |
Case Name |
Status |
Exec Time |
Memory |
in1.txt |
AC |
46 ms |
256 KB |
in10.txt |
AC |
46 ms |
256 KB |
in11.txt |
AC |
3 ms |
256 KB |
in12.txt |
AC |
2 ms |
256 KB |
in2.txt |
AC |
46 ms |
256 KB |
in3.txt |
AC |
46 ms |
256 KB |
in4.txt |
AC |
46 ms |
256 KB |
in5.txt |
AC |
51 ms |
256 KB |
in6.txt |
AC |
46 ms |
256 KB |
in7.txt |
AC |
46 ms |
256 KB |
in8.txt |
AC |
48 ms |
384 KB |
in9.txt |
AC |
46 ms |
256 KB |
sample1.txt |
AC |
2 ms |
256 KB |
sample2.txt |
AC |
2 ms |
256 KB |