算法竞赛入门经典 5.4.1Cantor数表
来源:互联网 发布:淘宝申请售后超过15天 编辑:程序博客网 时间:2024/06/05 16:31
#include <cstdio>#include <cmath>int main(){int n;while (scanf("%d", &n) == 1){int k = (int)floor((sqrt(1 + 8.0 * n) - 1) / 2 - 1e-9);int s = n - (1 + k) * k / 2;int numerator = k % 2 == 0 ? k + 2 - s : s;int denominator = k % 2 == 0 ? s : k + 2 - s;printf("%d/%d\n", numerator, denominator);}return 0;}
0 0
- 算法竞赛入门经典 5.4.1Cantor数表
- 算法竞赛入门 5.4.1 Cantor的数表
- 算法竞赛入门经典-第五章cantor数表
- 算法竞赛入门——Cantor的数表
- 【Cantor 的数表 5.4.1】
- 【Cantor 的数表 5.4.1】
- 算法练习--打印Cantor 数表
- 算法练习--打印Cantor 数表
- 算法竞赛入门经典:第五章 基础题目选解 5.9 Cantor数
- cantor 数表
- Cantor数表
- Cantor数表
- cantor数表
- cantor数表
- 算法篇-数学基础-Cantor的数表
- 算法竞赛入门经典
- 算法竞赛入门经典
- 算法竞赛入门经典 例题9-1
- vijos1022Victoria的舞会2——by rfy
- 【UVAlive】康托展开的思想
- C# 连接ACCESS数据库代码实例
- Cohen-Sutherland算法(转载)
- 编译
- 算法竞赛入门经典 5.4.1Cantor数表
- 栈和队列算法二之栈的应用
- CF(427D-Match & Catch)后缀数组应用
- sudo apt-get update && sudo apt-get dist-upgrade
- 编译原理——语言处理程序
- STM32开发板(小苗板)资料系列之十二——SysTick定时器
- hessian简单实例
- 算法竞赛入门经典 5.3.1 “6174”问题
- 黑马程序员_Java基础[20]_异常、finally