Diverse Permutation_Codeforces
来源:互联网 发布:淘宝商品信息模板 编辑:程序博客网 时间:2024/05/17 07:18
大一的题,做法嘛。。忘了。。
#include <stdio.h>#define maxn 100010int s[maxn];int main(){ int n, k, i; scanf("%d %d", &n, &k); s[1] = 1; for (i = 2;i <= n;i++) { if (k > 0) { if (i % 2 == 0) s[i] = s[i - 1] + k; else s[i] = s[i-1]-k; k--; } else { s[i] = i; } } for (i = 1;i <= n;i++) if (i != n) printf("%d ", s[i]); else printf("%d\n", s[i]); return 0;}
0 0
- Diverse Permutation_Codeforces
- Diverse Permutation
- Guiyang, Diverse traveling experience
- codeforces C. Diverse Permutation
- 【构造】【cf482A】Diverse Permutation
- A. Diverse Permutation
- 482 A. Diverse Permutation
- Mining Diverse Patterns
- 【CODEFORCES】C. Diverse Permutation
- CodeForces 386C Diverse Substrings
- Codeforces:Diverse Permutation(找规律)
- codeforces 483C.Diverse Permutation
- CodeForces 482A Diverse Permutation
- CodeForces-483C Diverse Permutation
- CodeForces 483C Diverse Permutation
- CodeForces 482A Diverse Permutation
- coderforce 482A. Diverse Permutation
- Captioning Images with Diverse Objects
- Oracle Data Integrator 12c-模型(Model)和 数据存储(DataStore)
- centos 安装 matplotlib失败如何解决
- 怎么使用CorelDRAW 中的默认调色板
- 关于VMware中克隆虚拟机后不能联网问题
- 超市信息系统的代码
- Diverse Permutation_Codeforces
- Myisam和Innodb索引实现的不同(存储结构)
- Yii实战开发大型商城项目视频教程
- Oracle Data Integrator 12c-第一个映射
- 最新butterknife 8.5.1注解框架构建步骤
- 【CSS3】创意页面切换效果集合
- 小猪用Git一年多后的总结精华
- 疯狂ajaxj讲义摘录
- Java日志之log4j