UESTC
来源:互联网 发布:windows光盘修复系统 编辑:程序博客网 时间:2024/06/01 08:46
I think that you might have played the traditional Chinese ring game: The Chinese Linking Rings (here we call its nickname Jiulianhuan —— 九连环
). Well, you say you haven’t played it before? Then you must have seen it before, right? If not seen, come to borrow mine to have a good look at it and enjoy it!
Now, I would like to mention the rules or common sense of Jiulianhuan again.
- The first ring can put on or down the handles at any time. That is, when the first ring is under the handle, it can climb up the handle within one step, and vice versa.
- At any moment, you can only operate one ring, on the condition that the ring is operable.
- If the first
k−2 k−2 rings are under the handle, and the(k−1)th (k−1)th ring is on the handle, then if thekth kth ring is under the handle, you can put it on the handle, and if it is not under the handle, you can put it down the handle.
Seems complicated? But I tried my simplest explanation to you, and I hope its not hard for you to understand. Maybe you have played the game before, and the above is what actually astep
means in the game.
Given
A number a line. Because the number are so huge, you are to output the result after it mod prime
1291005
123414260
#include<cstdio>#include<bits/stdc++.h>#define mod 10007using namespace std;int pow(int n){ int res=2; for(int i=1; i<=n; i++) { res*=2; res%=mod; } return res;}int main(){ int n; while(~scanf("%d",&n)) { int res=pow(n); if(n%2) res-=1; else res-=2; res*=3336; printf("%d\n",res%mod); }}
阅读全文
0 0
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- 正则表达式——常用正则表达式验证输入合法性
- 3. 定位并添加Marker
- 使用SpringMVC和js实现文件及字段上传中遇到的坑
- Sublime Text格式化json数据
- 区分mp4格式里面mdat中的音频和视频数据
- UESTC
- android设置中拖动音量条调节音量流程(android5.1)
- 【《Real-Time Rendering 3rd》 提炼总结】(六) 第七章 · 高级着色:BRDF及相关技术
- Linux安装tomcat部署java web项目
- Mybatis中的resultType和resultMap
- CSU 1336: Interesting Calculator<BFS+优化><湖南省赛真题>
- ajax传递的参数值包含单引号
- 【G
- 热更plist后,游戏永远无法读取或者是重启后才可以读取的