Submission #827400

# Submission time Handle Problem Language Result Execution time Memory
827400 2023-08-16T12:37:31 Z BERNARB01 Newspapers (CEOI21_newspapers) C++17
0 / 100
0 ms 212 KB
/**
 *    author:  BERNARD B.01
**/
#include <bits/stdc++.h>

using namespace std;

#ifdef B01
#include "deb.h"
#else
#define deb(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (m != n - 1) {
    cout << "NO" << '\n';
    return 0;
  }
  vector<vector<int>> g(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    --u; --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  cout << "YES" << '\n';
  cout << 5 * (n - 2) << '\n';
  for (int i = 2; i < n; i++) {
    cout << i << " " << i << " " << i + 1 << " " << i + 1 << " " << i << " ";
  }
  cout << '\n';
  return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Integer parameter [name=k] equals to -5, violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Integer parameter [name=k] equals to -5, violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Integer parameter [name=k] equals to -5, violates the range [1, 5]
2 Halted 0 ms 0 KB -