A - Round House
来源:互联网 发布:yum强制重新安装 编辑:程序博客网 时间:2024/06/07 12:56
#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#include<cmath>#include<queue>#include<cctype>#define max(a,b)(a>b?a:b)#define min(a,b)(a<b?a:b)#define INF 0x3f3f3f3f#define N 250000using namespace std;int main(){ int n,a,b,k,i; while(scanf("%d%d%d",&n,&a,&b)!=EOF) { if(b>=0) { k=(a+b)%n; if(k==0) k=n; } else { k=a; for(i=1;i<=-b;i++) { k--; if(k==0) k=n; } } printf("%d\n",k); } return 0;}
大水题 没找到公式 数据小,循环即可过。
0 0
- A. Round House
- A - Round House
- A. Round House
- A. Round House 模拟
- 【CodeForces】[659A]Round House
- 【Codeforces】659A - Round House
- CodeForces-659A-Round House
- cf- #346 A-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 659A Round House 【小数学】
- CodeForces 659A Round House(水题)
- CodeForces 659A Round House(技巧)
- CodeForce 659A - Round House(水题)
- 带你实现开发者头条APP(五)--RecyclerView下拉刷新上拉加载
- RxJava+Retrofit+Gson实现网络请求
- iOS性能忧化
- C++ 在.h文件中声明,在.cpp文件中定义 模板函数和模板类
- Struts2的过滤器和拦截器
- A - Round House
- Elasticsearch安装使用ik中文分词
- 【Arduino官方教程第一辑】示例程序 3-1 模拟信号与串口
- 提升Java性能的基本方法
- 使用iText为PDF加图片水印
- Python 阅读书目推荐
- 【USACO题库】2.2.1 Preface Numbering序言页码(数学+枚举)
- Winock2网络编程服务器端
- segmentcontroler设置被选中状态下字体的颜色 大小