제출 #783360

#제출 시각아이디문제언어결과실행 시간메모리
783360vh50Newspapers (CEOI21_newspapers)C++17
4 / 100
1 ms340 KiB
#include <bits/stdc++.h> #define int long long #define endl "\n" using namespace std; const int MAXN = 2e3; int n, m, marc[MAXN][MAXN]; vector <int> g[MAXN]; void dfs(int a, int r) { marc[a][r] = 1; for(auto v : g[a]) { if(marc[v][r]) continue; dfs(v, r); } } main() { cin >> n >> m; for(int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--, b--; g[a].push_back(b); g[b].push_back(a); } if(m == n - 1) { cout << "YES" << endl; cout << 4 * n << endl; for(int i = 0; i < n; i++) cout << i + 1 << " " << i + 1 << " "; for(int i = 0; i < n; i++) cout << i + 1 << " " << i + 1 << " "; cout << endl; } else cout << "NO" << endl; }

컴파일 시 표준 에러 (stderr) 메시지

newspapers.cpp:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...