Atcoder ABC 139B
题意:
一开始有1个插口,你的插排有
个插口,你需要
个插口,问你最少需要多少个插排。
解法:
暴力模拟。
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; }