Codeforces 659A Round House【水题,细节】
来源:互联网 发布:o2o网络便利店系统 编辑:程序博客网 时间:2024/06/01 21:01
题目链接:
http://codeforces.com/contest/659/problem/A
题意:
一个圈,按逆时针编号,给定起点,方向和步数,问终点在几号?
分析:
很简单的模拟。。。注意答案为0的时候应该输出n。。。
代码:
#include<iostream>using namespace std;int main (void){ int n, a, b;cin>>n>>a>>b; b = (b - 1) %n + 1; int k = (a - 1 + b + n)%n + 1 ; if(k) cout<<k<<endl; else cout<<n<<endl;}
0 0
- Codeforces 659A Round House【水题,细节】
- CodeForces 659A Round House(水题)
- 【CodeForces】[659A]Round House
- 【Codeforces】659A - Round House
- CodeForces-659A-Round House
- CodeForces 659A Round House
- CodeForces 659A Round House
- codeforces 659A Round House
- Codeforces 659A Round House (模拟)
- Codeforces 659A Round House 【小数学】
- CodeForces 659A Round House(技巧)
- Codeforces Round #408 A. Buying A House
- CodeForces - 659A Round House (形成环)水
- Codeforces 659A:Round House(模拟,转化)
- CodeForces 659 A. Round House(简单数学推理)
- CodeForce 659A - Round House(水题)
- Codeforces Round #346 (Div. 2) -A. Round House(模拟)
- Codeforces Round #346 (Div. 2)--A. Round House
- 20160329 HDU1023 Train Problem II(卡塔兰数)
- 11个让你吃惊的 Linux 终端命令
- 虚函数和纯虚函数的区别
- 七牛云储存理解
- Rotional Rose2007安装及激活详细攻略
- Codeforces 659A Round House【水题,细节】
- test
- 回朔法浅析
- Eclipse闪退/打不开/无法启动/一闪而过打解决方法
- Android下使用Protobuf进行序列化
- JavaScript浏览器对象
- generator 生成杨辉三角
- 剑指 offer代码解析——面试题39二叉树的深度
- Hdu oj 1874 畅通工程续(floyd)