Submission #1605393


Source Code Expand

// #include {{{
#include <array>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iterator>
#include <tuple>
#include <utility>
#include <random>
#include <limits>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cstdint>
#include <cassert>

#ifdef DEBUG
#include <fmt/format.h>
#endif
// }}}

using namespace std;

// macros {{{
template<typename T, size_t N>
constexpr size_t NELEMS(T (&)[N]) { return N; }

template<typename InputIt>
void PRINT_RANGE(InputIt first, InputIt last)
{
    for(; first != last; ++first)
        cout << *first << (first==last ? "" : " ");
    cout << "\n";
}

template<typename T>
void PRINT_MATRIX(T mat, size_t nr, size_t nc)
{
    for(size_t r = 0; r < nr; ++r) {
        for(size_t c = 0; c < nc; ++c) {
            cout << mat[r][c] << (c==nc-1 ? "" : " ");
        }
        cout << "\n";
    }
}

#define FOR(i, start, end) for(int i = (start); i < (end); ++i)
#define REP(i, n) FOR(i, 0, n)
// }}}

// types {{{
using s64 = int64_t;
using u64 = uint64_t;
// }}}

int N, M;

void solve()
{
    vector<int> cnts(N+1);

    REP(_, M) {
        int a, b;
        cin >> a >> b;
        ++cnts[a];
        ++cnts[b];
    }

    bool ans = all_of(begin(cnts), end(cnts), [](int cnt) { return cnt % 2 == 0; });
    cout << (ans ? "YES" : "NO") << "\n";
}

int main()
{
    cin >> N >> M;

    solve();

    return 0;
}

Submission Info

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