Submission #1091546


Source Code Expand

#include<bits/stdc++.h>
#include <regex>
#include<ext/numeric>
#include<ext/hash_map>
using namespace std;
using namespace __gnu_cxx;

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v)  (int)v.size()
#define WHITE -1
#define GREY   0
#define BLACK  1
#define CLR(a,v) memset(a,v,sizeof a)
#define PC(x) __builtin_popcount(x)
#define MP make_pair

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
//typedef unsigned int ui;

typedef complex<double> point;
//#define X real()
//#define Y imag()
#define vec(a,b) ((b)-(a))
//#define dot(a,b) ((conj(a)*(b)).real())
#define cross(a,b) ((conj(a)*(b)).imag())
#define colliner pointOnLine

const double PI = acos(-1.0);

int dx[] = { 0, -1, 0, 1, -1, -1, 1, 1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };

int DX[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
int DY[] = { 1, 1, 0, -1, -1, -1, 0, 1 };

const int MAX = 55, MOD = 1e9 + 7, oo = (1 << 30);
const ll OO = 1ll << 60;
const double EPS = 1e-6;

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
#endif
	int n;
	scanf("%d", &n);
	int cnt = 0;
	while (n--) {
		int x;
		scanf("%d", &x);
		if (x & 1)
			++cnt;
	}
	puts((cnt & 1) ? "NO" : "YES");
}

Submission Info

Submission Time
Task A - Addition
User TheMaverick
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1382 Byte
Status WA
Exec Time 2 ms
Memory 256 KB

Compile Error

In file included from /usr/include/c++/5/ext/hash_map:60:0,
                 from ./Main.cpp:4:
/usr/include/c++/5/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
 #warning \
  ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:48:31: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  freopen("in.txt", "r", stdin);
                               ^
./Main.cpp:52:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:56:18: warning: ignoring return v...

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
WA × 1
AC × 7
WA × 7
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 2 ms 256 KB
in10.txt AC 2 ms 256 KB
in11.txt AC 2 ms 256 KB
in12.txt WA 2 ms 256 KB
in2.txt AC 2 ms 256 KB
in3.txt AC 2 ms 256 KB
in4.txt WA 2 ms 256 KB
in5.txt WA 2 ms 256 KB
in6.txt WA 2 ms 256 KB
in7.txt WA 2 ms 256 KB
in8.txt WA 2 ms 256 KB
in9.txt AC 2 ms 256 KB
sample1.txt AC 2 ms 256 KB
sample2.txt WA 2 ms 256 KB