【链接】 我是链接,点我呀:)

【题意】

在这里输入题意

【题解】

模拟

【代码】

#include <bits/stdc++.h>
using namespace std; const int N = 1000; int n;
pair <int,int> a[N+10]; int main(){
// freopen("rush.txt","r",stdin);
scanf("%d",&n);
for (int i = 1;i <= n;i++)
scanf("%d%d",&a[i].first,&a[i].second);
int now = a[1].first;
for (int i = 2;i <= n;i++){
if (now < a[i].first){
now = a[i].first;
}else{
//now >= a[i].first;
int pre = now;
int temp = now - a[i].first;
temp = (temp-1)/a[i].second + 1;
now = a[i].first + temp*a[i].second;
if (pre==now) now += a[i].second;
}
}
printf("%d\n",now);
return 0;
}

最新文章

  1. 记录android显示流程
  2. Ueditor 编译发布后无法使用上传图片、附件等功能
  3. 初学UML——用例图
  4. 转:Connection: close和Connection: keep-alive有什么区别?
  5. NSEnumerator
  6. EDS 14.0 dtc:commmand not found
  7. P1912: [Apio2010]patrol 巡逻
  8. HDU 5328 Problem Killer(水题)
  9. Java RandomAccessFile的使用(转载的文章,出处http://www.2cto.com/kf/201208/149816.html)
  10. 登陆用户怎样获取验证码和保存用户到cookie中
  11. CreateThread函数
  12. .net core 11
  13. Unity 打包总结和资源的优化和处理
  14. 4.2 PCIe体系结构的组成部件
  15. Oracle 重建控制文件一例
  16. 【测试工程师面试】 记录XX银行面试
  17. 【转】drop、truncate和delete的区别
  18. 微信 H5 支付流程以及一些坑
  19. (转)开源项目miaosha(下)
  20. Unity3D 重写下拉菜单/Dropdown组件、开启每个按钮可用

热门文章

  1. Spark 性能相关參数配置具体解释-任务调度篇
  2. Java Security安全系列文档翻译笔记————KeyStore、密钥、证书、命令行实战
  3. Kinect 开发 &mdash;&mdash; Kinect studio
  4. Kinect 开发 —— 骨骼追踪 (下)
  5. 解决xorm逆向mssql报datetime2不兼容的异常错误
  6. Linux编译ffmpeg
  7. cocos2d-x cocoStudioUI编辑器导出文件的使用
  8. Problem C: Celebrity Split
  9. 关于使用strtok的一个小问题
  10. worktools-monkey 测试工具的使用