洛谷P1014 Cantor表
来源:互联网 发布:qq飞车截图机器人源码 编辑:程序博客网 时间:2024/05/21 07:59
#include <cstdio>#include <algorithm>#include <iostream>#include <map>#include <queue>using namespace std;struct G{ int up, down;}g[10001][1001];int d[10001][1001];int ansx, ansy;int n, x = 1;int main() { cin >> n; for(int i=1; i<=1000; i++) { for(int j=1; j<=10000; j++) { g[i][j].up = i; g[i][j].down = j; } } int size = 1; for(int i=1; i<=10000; i++) { int t1 = i; x^=1; int t2 = 1; if(x) { while(t1>=1) { d[t2++][t1--] = size; if(size == n) { ansx = t2-1; ansy = t1+1; cout << g[ansx][ansy].up<<"/"<<g[ansx][ansy].down; return 0; } size++; } } else { while(t1>=1) { d[t1--][t2++] = size; if(size == n) { ansx = t1+1; ansy = t2-1; cout << g[ansx][ansy].up<<"/"<<g[ansx][ansy].down; return 0; } size++; } } } return 0;}
阅读全文
0 0
- 洛谷P1014 Cantor表
- 洛谷 P1014 Cantor表
- 洛谷 P1014 Cantor表
- 洛谷P1014 Cantor表
- 【模拟】洛谷 P1014 Cantor表
- luogu【P1014】Cantor表
- P1014 Cantor表 luogu
- P1014 Cantor表
- P1014 Cantor表
- P1014
- P1014
- Cantor表
- Cantor表
- Cantor表
- cantor表
- Cantor表
- Cantor表
- Cantor表
- 一些应该注意的问题
- html常用元素之表格元素
- java构造方法的优先级
- Java有关集合的练习
- 对自定义折线图 曲线图进行 图层优化后的代码,之前的性能差效果不友好,修改为:类似支付宝 中查看基金走势图的效果
- 洛谷P1014 Cantor表
- Python: PS滤镜--径向模糊
- Banner轮播
- i++和printf不得不说的故事
- java类、抽象类、接口杂记
- 字符串训练赛 By YYR AC自动机 + KMP/HASH + 贪心
- JavaSE面向对象练习
- hibernate整合的工具类HibernateUtil----单例模式
- 内存