#include <algorithm>
#include <iostream>
#include <iterator>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define _ << ' ' <<
#define ll long long
#define ld long double
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(x) x.begin(), x.end()
#define F first
#define S second
#define pb push_back
const ll INF = (long long)2e18, mod = (long long)1e9+7;
const ll P = 263, Q = 319;
const ll N = 300010, M = 510;
ll n, m;
vector<ll> g[N];
void solve() {
cin >> n >> m;
for (int i = 1; i <= m; ++i) {
ll u, v;
cin >> u >> v;
g[u].pb(v);
g[v].pb(u);
}
if (n == 1) {
cout << "YES\n1\n1\n";
return;
}
else if (n - 1 == m) {
cout << "YES\n";
cout << n * 2 << "\n";
for (int i = 1; i <= n; ++i)
cout << i << " ";
for (int i = n; i >= 1; --i)
cout << i << " ";
}
}
int main() {
speed;
int T = 1;
// cin >> T;
while (T--) {
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Partially correct |
4 ms |
7248 KB |
Provide a successful but not optimal strategy. |
3 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
4 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
5 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
6 |
Partially correct |
3 ms |
7252 KB |
Failed to provide a successful strategy. |
7 |
Incorrect |
3 ms |
7252 KB |
Unexpected end of file - token expected |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
3 |
Partially correct |
3 ms |
7252 KB |
Provide a successful but not optimal strategy. |
4 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
5 |
Partially correct |
3 ms |
7252 KB |
Provide a successful but not optimal strategy. |
6 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
7 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
8 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
9 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
10 |
Partially correct |
5 ms |
7252 KB |
Provide a successful but not optimal strategy. |
11 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
12 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
13 |
Partially correct |
5 ms |
7380 KB |
Provide a successful but not optimal strategy. |
14 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
15 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
16 |
Partially correct |
6 ms |
7380 KB |
Provide a successful but not optimal strategy. |
17 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
18 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
19 |
Partially correct |
4 ms |
7380 KB |
Provide a successful but not optimal strategy. |
20 |
Partially correct |
5 ms |
7380 KB |
Provide a successful but not optimal strategy. |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
7252 KB |
Output is correct |
2 |
Partially correct |
4 ms |
7248 KB |
Provide a successful but not optimal strategy. |
3 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
4 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
5 |
Partially correct |
4 ms |
7252 KB |
Provide a successful but not optimal strategy. |
6 |
Partially correct |
3 ms |
7252 KB |
Failed to provide a successful strategy. |
7 |
Incorrect |
3 ms |
7252 KB |
Unexpected end of file - token expected |
8 |
Halted |
0 ms |
0 KB |
- |