Submission #1263496


Source Code Expand

#include <bits/stdc++.h>

#define int long long
#define double long double

using namespace std;

template<class T> string tostr(T x) { stringstream o; o << x; return o.str(); }
template<class T> T sqr(T x) { return x*x; }
template<class T> T mypow(T x, int n) { T r = 1; while (n > 0) { if (n & 1)r = r*x; x = x*x; n >>= 1; }return r; }

int toint(string s) { int v; stringstream i(s); i >> v; return v; }
bool check(int x, int y, int w, int h) { return x >= 0 && y >= 0 && w > x && h > y; }
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

#define REP(i,a,b)	for(int (i) = (a);i < (b);(i)++)
#define rep(i,n)	REP(i,0,n)
#define PER(i,a,b)	for(int (i) = (a-1);i >= (b);(i)--)
#define per(i,n)	PER(i,n,0)
#define each(i,n)	for(auto &i : n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define dump(val) 	cerr << #val " = " << val << endl;
#define dum(val)	cerr << #val " = " << val;
#define FILL(a,v)	fill(a,a+sizeof(a)/sizeof(*a),v)

const int dx[8] = { +1,+0,-1,+0,+1,+1,-1,-1 };
const int dy[8] = { +0,-1,+0,+1,-1,+1,-1,+1 };
const int mod = 1e9 + 7;
const int INF = 1e9;

signed main() {

	int n, m;
	cin >> n >> m;

	map<int, int> mp;

	rep(i, m){
		int a, b;
		cin >> a >> b;
		mp[a]++;
		mp[b]++;
	}

	each(i, mp){
		if(i.second % 2){
			cout << "NO" << endl;return 0;
		}
	}

	cout << "YES" << endl;return 0;

	return 0;
}

Submission Info

Submission Time
Task B - Unplanned Queries
User omu
Language C++14 (GCC 5.4.1)
Score 500
Code Size 1525 Byte
Status AC
Exec Time 119 ms
Memory 5632 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 20
Set Name Test Cases
Sample sample1.txt, sample2.txt
All sample1.txt, sample2.txt, in1.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.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 113 ms 5632 KB
in10.txt AC 94 ms 4224 KB
in11.txt AC 70 ms 896 KB
in12.txt AC 94 ms 4224 KB
in13.txt AC 94 ms 4224 KB
in14.txt AC 114 ms 5632 KB
in15.txt AC 1 ms 256 KB
in16.txt AC 1 ms 256 KB
in2.txt AC 118 ms 5632 KB
in3.txt AC 112 ms 5632 KB
in4.txt AC 119 ms 5632 KB
in5.txt AC 115 ms 5632 KB
in6.txt AC 94 ms 4224 KB
in7.txt AC 97 ms 4224 KB
in8.txt AC 94 ms 4224 KB
in9.txt AC 99 ms 4224 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB