82A - Double Cola
来源:互联网 发布:linux查看log日志 编辑:程序博客网 时间:2024/06/08 04:04
#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <string>#include <algorithm>using namespace std;string ans[5] = { "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" };int main() { int n; int x = 0; cin >> n; while(5*((1<<x)-1)<n) { ++x; } n -= 5*((1<<(x-1))-1); int p = n / (1<<(x-1)); if(n % (1<<(x-1))) p++; cout << ans[p-1] << endl; return 0;}
0 0
- 82A - Double Cola
- 82A - Double Cola
- CodeForces 82A Double Cola
- CodeForces-82A-Double Cola
- CF 82A Double Cola
- Problem--82A--Codeforces--Double Cola
- A. Double Cola
- A. Double Cola
- Codeforces A. Double Cola 题解
- codeforces-82A-Double Cola( 等比数列 + 有意思的题目! )
- Yandex.Algorithm 2011 A. Double Cola
- Double Cola
- Codeforces Yandex.Algorithm 2011 Qualification 2 / 82A Double Cola (数学规律&模拟)
- Yandex.Algorithm 2011 Qualification 2 A. Double Cola
- Cola
- CodeForces 44B- A - Cola- 分类讨论
- 11150 - Cola
- Cola HDU1495
- Android Studio中 git 的.gitignore配置
- JVM的内存管理和垃圾回收
- install kvm on centos 6.5
- Ubuntu vi 上下左右变ABCD及 apt-get install报错问题解决方法
- 总结了这么多年的自己,感觉能力需要提升才行
- 82A - Double Cola
- QT 4.8.5支持电容触摸屏 和 鼠标
- Java(Android)线程池
- Android Please ensure that adb is correctly located at问题解决办法
- 复制对象(一)copy和mutableCopy方法
- LintCode-赋值运算符重载
- 通过NFSv3挂载HDFS到本地目录
- 折腾gcc/g++链接时.o文件及库的顺序问题
- 分析iOS Crash文件:符号化iOS Crash文件的3种方法