답안 #519306

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
519306 2022-01-26T07:40:01 Z AmShZ Newspapers (CEOI21_newspapers) C++11
4 / 100
1 ms 340 KB
//khodaya khodet komak kon
# include <bits/stdc++.h>

using namespace std;

typedef long long                                        ll;
typedef long double                                      ld;
typedef pair <int, int>                                  pii;
typedef pair <pii, int>                                  ppi;
typedef pair <int, pii>                                  pip;
typedef pair <pii, pii>                                  ppp;
typedef pair <ll, ll>                                    pll;

# define A                                               first
# define B                                               second
# define endl                                            '\n'
# define sep                                             ' '
# define all(x)                                          x.begin(), x.end()
# define kill(x)                                         return cout << x << endl, 0
# define SZ(x)                                           int(x.size())
# define lc                                              id << 1
# define rc                                              id << 1 | 1
# define fast_io                                         ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);

ll power(ll a, ll b, ll md) {return (!b ? 1 : (b & 1 ? a * power(a * a % md, b / 2, md) % md : power(a * a % md, b / 2, md) % md));}

const int xn = 1e3 + 10;
const int xm = - 20 + 10;
const int sq = 320;
const int inf = 1e9 + 10;
const ll INF = 1e18 + 10;
const ld eps = 1e-15;
const int mod = 998244353;
const int base = 257;

int n, m;
vector <int> adj[xn];

int main(){
	fast_io;

	cin >> n >> m;
	for (int i = 1; i <= m; ++ i){
		int v, u;
		cin >> v >> u;
		adj[v].push_back(u);
		adj[u].push_back(v);
	}
	if (n == 1){
		cout << "YES" << endl;
		cout << 1 << endl;
		cout << 1 << endl;
		return 0;
	}
	if (n == 2){
		cout << "YES" << endl;
		cout << 2 << endl;
		cout << 1 << sep << 1 << endl;
		return 0;
	}
	if (n == 3){
		cout << "YES" << endl;
		cout << 2 << endl;
		cout << 2 << sep << 2 << endl;
		return 0;
	}
	if (n == 4){
		cout << "YES" << endl;
		cout << 4 << endl;
		cout << "2 3 3 2" << endl;
		return 0;
	}
	if (n == 5){
		cout << "YES" << endl;
		cout << 5 << endl;
		cout << "1 1 1 1 1" << endl;
		return 0;
	}
	cout << "YES" << endl;
	cout << n << endl;
	for (int i = 1; i <= n; ++ i)
		cout << i << sep;
	cout << endl;
	return 0;
	kill("NO");

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 332 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
4 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
5 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
6 Partially correct 1 ms 336 KB Failed to provide a successful strategy.
7 Incorrect 1 ms 332 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 0 ms 332 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
6 Partially correct 0 ms 204 KB Failed to provide a successful strategy.
7 Partially correct 1 ms 336 KB Failed to provide a successful strategy.
8 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
9 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
10 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
11 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
12 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
13 Partially correct 1 ms 336 KB Failed to provide a successful strategy.
14 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
15 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
16 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
17 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
18 Partially correct 1 ms 340 KB Failed to provide a successful strategy.
19 Partially correct 1 ms 336 KB Failed to provide a successful strategy.
20 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 332 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
4 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
5 Partially correct 1 ms 332 KB Failed to provide a successful strategy.
6 Partially correct 1 ms 336 KB Failed to provide a successful strategy.
7 Incorrect 1 ms 332 KB Output isn't correct
8 Halted 0 ms 0 KB -