Codeforces Round #452 (Div. 2) C
来源:互联网 发布:公租房信息管理 源码 编辑:程序博客网 时间:2024/05/21 00:54
这个题上次 b 找bug 找了一个小时当时没有做出来 唉
还是自己智障!
#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;}
阅读全文
0 0
- Codeforces Round #452 (Div. 2) A-C
- Codeforces Round #452 (Div. 2) C
- Codeforces Round #452 (Div. 2) C
- 【codeforces】Codeforces Round #370 (Div. 2) C
- Codeforces Round #452 (Div. 2)
- Codeforces Round #452 (Div. 2)
- Codeforces Round #452 (Div. 2)
- Codeforces Round #452 (Div. 2)
- Codeforces Round #452 (Div. 2)
- Codeforces Round #452 (Div. 2)
- Codeforces Round #452 (Div. 2) A,B,C
- Codeforces Round #452 (Div. 2) A-C题解
- Codeforces Round #452 (Div. 2) 12-17 A-C 题解
- Codeforces Round #105 (Div. 2) C
- Codeforces Round 134 div 2 C题
- Codeforces Round #137 (Div. 2), problem: (C)
- Codeforces Round #153 (Div. 2) C题
- Codeforces Round #158 (Div. 2) C题
- APK META-INF/LICENSE,文件重复问题
- org.springframework.core.convert.ConversionFailedException
- Anaconda和tensorflow离线安装
- GitHub20个Python机器学习项目
- Spring Boot和Spring Cloud微服务架构学习(六)-Docker应用
- Codeforces Round #452 (Div. 2) C
- 不用hashmap二用sparseArray ArrayMap 以及ConcurentHashmAP
- 9.10 ————画类图
- idea快捷键
- bat批处理的注释语句
- Win10+Anaconda2+vs2015+cuDnn+CUDA8.0安装caffe时需要注意的问题
- Bit存储状态型数据
- canvas转base64/jpeg时,透明区域变成黑色背景的解决方案
- 如何快速转载CSDN中的博客