Atcoder ABC 139B
2024-10-06 15:13:01
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;
}
最新文章
- Topshelf 学习 跨平台
- org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [XXX] in DispatcherServlet with name &#39;springMVC&#39;
- 有关javascript的性能优化(合理的管理内存)
- poj 1701【数学几何】
- C++-继承名称的掩盖
- android中broadcastreceiver的用法-manifest中注册。
- FZU-竞技游戏
- JavaScript 字符串常用操作纪要
- uiwebview 加载html时字体变小 加载前或加载后改变字体大小
- spring,hibernate配置事务 beans.xml
- oracle数据库在mybatis中使用uuid
- 搭建ubuntu版hadoop集群
- [javascript 实践篇]——那些你不知道的“奇淫巧技”
- js 类
- 屏幕尺寸,分辨率,像素,PPI之间到底什么关系?
- linux命令学习之:chown
- 通过微信Android和iOS版,看两大系统的差异
- docker 快速搭建Nexus3
- vue基础——列表渲染
- 分割回文串 &#183; Palindrome Partitioning
热门文章
- 基因组所三代单分子测序PacBio完成技术升级—超长读长助力基因组学研究
- 补充:Python安装
- 2 webpack 4 加vue搭建开发环境最终配置
- 安装window、linux双系统
- ifeq ifneq ifdef ifndef
- httpd源码编译安装
- Ubuntu系统---C++之Eclipse 开始工程项目
- OpenCV VideoCapture.get()参数详解
- PHP获取文件大小的几种方法!
- webpack4 Cannot find module &#39;@babel/core&#39;