Submission #576479

# Submission time Handle Problem Language Result Execution time Memory
576479 2022-06-13T06:31:33 Z temporary_juggernaut Newspapers (CEOI21_newspapers) C++14
0 / 100
1 ms 212 KB
#include<bits/stdc++.h>
#define fr first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
#define USING_ORDERED_SET 0
#if USING_ORDERED_SET
#include<bits/extc++.h>
using namespace __gnu_pbds;
template<class T>using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
#endif
template<class T>void umax(T &a,T b){if(a<b)a=b;}
template<class T>void umin(T &a,T b){if(b<a)a=b;}
#ifdef juggernaut
    #define printl(args...)printf(args)
#else
    #define printl(args...)((void)0)
#endif
int main(){
	int n;
	cin>>n;
	if(n==1){
		puts("YES\n1\n1");
		return 0;
	}else if(n==2||n==3){
		puts("YES\n2\n2 2");
		return 0;
	}
	vector<int>vec;
	if(n&1){
		for(int i=2;i<n;i++)vec.push_back(i);
		for(int i=2;i<n;i++)vec.push_back(i);
	}else{
		for(int i=2;i<n;i++)vec.push_back(i);
		for(int i=1;i<n;i++)vec.push_back(i);
		vec.clear();
	}
	printf("YES\n%d\n",int(vec.size()));
	for(int to:vec)printf("%d ",to);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Integer parameter [name=k] equals to 0, violates the range [1, 30]
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Integer parameter [name=k] equals to 0, violates the range [1, 20]
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Integer parameter [name=k] equals to 0, violates the range [1, 30]
5 Halted 0 ms 0 KB -