Codeforces Round #452 (Div. 2) C
還是自己智障!
#include<bits/stdc++.h>
using namespace std;
int a[100000+100];
int main(){
int n;
cin>>n;
for(int j=1;j<=n;j++){
a[j]=j;
}
long long s1=0,s2=0;
if(n==2){
cout<<'1'<<endl;
cout<<'1'<<" "<<'1'<<endl;
}
else if(n==3){
cout<<'0'<<endl;
cout<<'2'<<" "<<'1'<<' '<<'2'<<endl;
}
else{
if(n%2==1){
if(n/2%2==0){
cout<<"1"<<endl;
cout<<(n+1)/2<<" ";
cout<<'1'<<' ';
for(int j=2;j<=n/2;j+=2){
cout<<j<<" "<<n-j+2<<" ";
}
}
else{
cout<<"0"<<endl;
cout<<(n+1)/2<<" ";
for(int j=1;j<=n/2;j+=2){
cout<<j<<" "<<n-j<<" ";
}
}
}
else{
if(n/2%2==0){
cout<<"0"<<endl;
cout<<n/2<<" ";
for(int j=1;j<n/2;j+=2){
cout<<a[j]<<" "<<a[n-j+1]<<" ";
}
}
else{
cout<<'1'<<endl;
cout<<n/2<<" ";
for(int j=1;j<n/2;j=j+2){
cout<<a[j]<<" "<<a[n-j+1]<<" ";
}
cout<<n/2<<endl;
}
}
}
return 0;
}
相關文章
- Codeforces Round #452 (Div. 2) D
- Codeforces Round #453 (Div. 2) C
- Codeforces Round 973 (Div. 2) C
- Codeforces Round 972 (Div. 2) C
- Codeforces Round 982 (Div. 2)(A~C)
- Codeforces Round #321 (Div. 2) C DFS
- Educational Codeforces Round 33 (Rated for Div. 2) C
- Codeforces Round #323 (Div. 2) C gcdGC
- Codeforces Round #325 (Div. 2) C 模擬
- Codeforces Round #359 (Div. 2) C DFS
- Codeforces Round #290 (Div. 2) A,B,C,D
- codeforces Round #252 (Div. 2) C - Valera and Tubes
- Codeforces Round #250 (Div. 2) C、The Child and Toy
- Codeforces Round 977 (Div. 2)(B-C2)
- Codeforces Round #639 (Div. 2)
- Codeforces Round #541 (Div. 2)
- Codeforces Round #682 (Div. 2)
- Codeforces Round #678 (Div. 2)
- Codeforces Round #747 (Div. 2)
- Codeforces Round #673 (Div. 2)
- Codeforces Round #672 (Div. 2)
- Codeforces Round #448 (Div. 2) A
- Codeforces Round #217 (Div. 2)
- Codeforces Round #256 (Div. 2)
- Codeforces Round #259 (Div. 2)
- Codeforces Round #257 (Div. 2)
- Codeforces Round #258 (Div. 2)
- Codeforces Round #171 (Div. 2)
- Codeforces Round #173 (Div. 2)
- Codeforces Round 951 (Div. 2)
- Codeforces Round 955 (Div. 2)
- Codeforces Round 953 (Div. 2)
- Codeforces Round 975 (Div. 2)
- Codeforces Round 976 (Div. 2)
- Codeforces Round 972 (Div. 2)
- Codeforces Round 979 (Div. 2)
- Codeforces Round 982 (Div. 2)
- Codeforces Round 932 (Div. 2)