Submission #1191196

#TimeUsernameProblemLanguageResultExecution timeMemory
1191196user192837Newspapers (CEOI21_newspapers)C++17
0 / 100
0 ms328 KiB
#include <bits/stdc++.h>
#define ar array
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
    }
    if (n <= 5) {
        cout << "YES\n";
        if (n == 1) {
            cout << "1\n1";
        } else if (n == 2) {
            cout << "2\n1 1";
        } else if (n == 3) {
            cout << "2\n2 2";
        } else if (n == 4) {
            cout << "4\n2 3 3 2";
        } else {
            cout << "6\n3 4 4 2 3 4";
        }
    } else {
        cout << "NO\n";
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...