Submission #3608369


Source Code Expand

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

int nums[100009];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,Q;
    cin>>N>>Q;
    rep(i,Q){
        int a,b; cin>>a>>b;
        nums[a]++;
        nums[b]++;
    }
    
    rep1(i,N){
        if(nums[i]%2){
            cout1("NO");
            return 0;
        }
    }
    cout1("YES");
}

Submission Info

Submission Time
Task B - Unplanned Queries
User mensan_fukuhara
Language C++14 (GCC 5.4.1)
Score 500
Code Size 1300 Byte
Status AC
Exec Time 17 ms
Memory 640 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 17 ms 640 KB
in10.txt AC 17 ms 640 KB
in11.txt AC 15 ms 256 KB
in12.txt AC 17 ms 640 KB
in13.txt AC 17 ms 640 KB
in14.txt AC 17 ms 640 KB
in15.txt AC 1 ms 256 KB
in16.txt AC 1 ms 256 KB
in2.txt AC 17 ms 640 KB
in3.txt AC 17 ms 640 KB
in4.txt AC 17 ms 640 KB
in5.txt AC 17 ms 640 KB
in6.txt AC 17 ms 640 KB
in7.txt AC 17 ms 640 KB
in8.txt AC 17 ms 640 KB
in9.txt AC 17 ms 640 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB