답안 #516156

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
516156 2022-01-20T13:21:39 Z mosiashvililuka Newspapers (CEOI21_newspapers) C++14
8 / 100
1 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,p[5009],pi;
vector <int> v[1009];
void print(){
	cout<<"YES\n";
	cout<<pi<<"\n";
	for(i=1; i<=pi; i++){
		cout<<p[i]<<" ";
	}
	exit(0);
}
int main(){
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>a>>b;
	for(i=1; i<=b; i++){
		cin>>c>>d;
		v[c].push_back(d);
		v[d].push_back(c);
	}
	if(a==1){
		pi=1;p[1]=1;
		print();
	}
	if(a==2){
		pi=2;p[1]=1;p[2]=1;
		print();
	}
	for(i=2; i<a; i++){
		pi++;p[pi]=i;
	}
	for(i=a-1; i>=2; i--){
		pi++;p[pi]=i;
	}
	print();
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 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 332 KB Output is correct
5 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
6 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
7 Incorrect 0 ms 340 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 332 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Correct 0 ms 332 KB Output is correct
4 Correct 0 ms 332 KB Output is correct
5 Correct 0 ms 332 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 0 ms 332 KB Output is correct
9 Correct 0 ms 332 KB Output is correct
10 Correct 0 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 1 ms 332 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 316 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 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 332 KB Output is correct
5 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
6 Partially correct 0 ms 332 KB Failed to provide a successful strategy.
7 Incorrect 0 ms 340 KB Output isn't correct
8 Halted 0 ms 0 KB -