【SGU】 105. Div 3
来源:互联网 发布:设置环境变量 linux 编辑:程序博客网 时间:2024/05/17 06:23
/** * @author johnsondu * @createTime 2015-8-16 17:04 @problem SGU Div 3 @url http://acm.sgu.ru/problem.php?contest=0&problem=105 @description math, print first 20 elements and find the rule behind it.
0 1 2 2 3 4 4 5 6 6 ... */#include <iostream>#include <cstdio>#include <cmath>#include <algorithm>#include <cstring>#include <stack>#include <queue>#include <map>#include <vector>using namespace std;int main(){ int n; while(cin >> n) { if (n < 4) cout << n - 1 << endl; else { if (n % 3 == 0 || n % 3 == 1) cout << n / 3 * 2 << endl; else cout << n / 3 * 2 + 1 << endl; } } return 0;}
0 0
- [SGU]105. Div 3
- SGU 105. Div 3
- 【SGU】 105. Div 3
- 【SGU】105. Div 3 水题
- SGU 105 Div 3
- sgu 105 Div 3
- sgu 105 Div 3
- SGU 105 Div 3
- [SGU 105] Div 3 [数学]
- SGU 105 Div 3 找规律
- SGU - 105 - Div 3 (简单数学题!)
- SGU 105 Div 3(数论)
- 2016 Personal Training #3 Div.2 SGU 409
- SGU
- SGU
- SGU
- SGU
- SGU
- 架构师应该亲力亲为
- 机房收费系统验收小结(二)
- 1091. Acute Stroke (30) -- DFS(三维空间)
- poj 1319 Pipe Fitters
- 以“遥远的银河”为例浅谈扫描和信息维护的技巧
- 【SGU】 105. Div 3
- 华为OJ(密码强度等级)
- HDU 4907 Task schedule(标记+二分或直接处理也行)BestCoder Round #3
- BASE64Decoder小解
- 细节决定成败--职场心得
- log4net的使用 日志输出
- UVa 1586 - Molar mass
- Strom入门(二)
- Vuforia 摄像头自动对焦问题测试