Submission #698749

#TimeUsernameProblemLanguageResultExecution timeMemory
698749CyanmondNewspapers (CEOI21_newspapers)C++17
4 / 100
1 ms212 KiB
#include <bits/stdc++.h>

int main() {
    int N, M;
    std::cin >> N >> M;
    std::vector<int> A(M), B(M);
    std::vector<int> deg(N);
    for (int i = 0; i < M; ++i) {
        std::cin >> A[i] >> B[i];
        --A[i], --B[i];
        ++deg[A[i]];
        ++deg[B[i]];
    }
    if (M == N - 1) {
        std::cout << "YES" << std::endl;
    std::cout << 1 << std::endl;
    std::cout << 1 << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...