CodeForces 435C Cardiogram
来源:互联网 发布:人不知而不愠的知 编辑:程序博客网 时间:2024/06/05 04:31
单纯的模拟
#include <cstdio>#include <cstring>char mat[2005][1005];int main(){ int n, t; int now_r = 1002, now_c = 0; int up = 1002, down = 1002; scanf("%d", &n); memset(mat, ' ', sizeof(mat)); for(int i = 0; i < n; i++) { scanf("%d", &t); for(int j = 0; j < t; j++) { if(i & 1) mat[now_r][now_c] = '\\', now_r++; else mat[now_r][now_c] = '/', now_r--; now_c++; } if(i & 1) now_r--; else now_r++; if(up > now_r) up = now_r; if(down < now_r) down = now_r; } for(int i = 0; i < 2005; i++) mat[i][now_c] = '\0'; for(int i = up; i <= down; i++) printf("%s\n", mat[i]); return 0;}
0 0
- Codeforces 435C Cardiogram
- Codeforces 435C. Cardiogram
- CodeForces 435C Cardiogram
- Codeforces 435C Cardiogram
- Cardiogram CodeForces
- Codeforces Round #249 (Div. 2)C. Cardiogram
- C. Cardiogram
- Codeforces Round #249 (Div. 2)453C Cardiogram(模拟)
- cf435C Cardiogram
- Codeforces-340-C(c++)
- Codeforces-507-C(c++)
- CodeForces 731C C
- CodeForces-612C C
- CODEFORCES 265C CODEFORCES, 265C
- codeforces #78 div2 C
- Codeforces 117C Cycle
- CodeForces 209C
- CodeForces 156C Cipher
- retext
- stm32f10x.h 地址映射
- Bulls and Cows-LeetCode
- web.xml文件详解
- 计划
- CodeForces 435C Cardiogram
- E- 1-42随机数
- 在源码中理解Android中手势分发
- 51Nod 1022 石子归并 V2 (划分型dp四边形不等式优化)
- 浅析JavaScript中两种类型的全局对象/函数
- MongoDB基础
- 如何查看本机ip地址,首先介绍下,查看电脑在局域网里的ip地址
- Codeforces Round #334 B. More Cowbell (二分 + 贪心)
- [python] 专题八.多线程编程之thread和threading