Atcoder ABC 139B

题意:

一开始有1个插口,你的插排有 $ a $ 个插口,你需要 $ b $ 个插口,问你最少需要多少个插排。

解法:

暴力模拟。

CODE:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm> using namespace std; #define LL long long
#define N 100010 LL a,b,ans; int main() {
scanf("%lld%lld",&a,&b);
if(b == 1) {
puts("0");
return 0;
}
LL cnt = 1;
while(true) {
cnt = cnt + a - 1;
ans++;
if(cnt >= b) break;
}
printf("%lld",ans);
//system("pause");
return 0;
}

最新文章

  1. Topshelf 学习 跨平台
  2. org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [XXX] in DispatcherServlet with name &#39;springMVC&#39;
  3. 有关javascript的性能优化(合理的管理内存)
  4. poj 1701【数学几何】
  5. C++-继承名称的掩盖
  6. android中broadcastreceiver的用法-manifest中注册。
  7. FZU-竞技游戏
  8. JavaScript 字符串常用操作纪要
  9. uiwebview 加载html时字体变小 加载前或加载后改变字体大小
  10. spring,hibernate配置事务 beans.xml
  11. oracle数据库在mybatis中使用uuid
  12. 搭建ubuntu版hadoop集群
  13. [javascript 实践篇]——那些你不知道的“奇淫巧技”
  14. js 类
  15. 屏幕尺寸,分辨率,像素,PPI之间到底什么关系?
  16. linux命令学习之:chown
  17. 通过微信Android和iOS版,看两大系统的差异
  18. docker 快速搭建Nexus3
  19. vue基础——列表渲染
  20. 分割回文串 &#183; Palindrome Partitioning

热门文章

  1. 基因组所三代单分子测序PacBio完成技术升级—超长读长助力基因组学研究
  2. 补充:Python安装
  3. 2 webpack 4 加vue搭建开发环境最终配置
  4. 安装window、linux双系统
  5. ifeq ifneq ifdef ifndef
  6. httpd源码编译安装
  7. Ubuntu系统---C++之Eclipse 开始工程项目
  8. OpenCV VideoCapture.get()参数详解
  9. PHP获取文件大小的几种方法!
  10. webpack4 Cannot find module &#39;@babel/core&#39;