当前位置:网站首页>【CF】 A. New Year Candles
【CF】 A. New Year Candles
2022-06-11 07:10:00 【percation】
The question and A. Vasya and Socks Very much alike , Almost the same idea .
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 10;
int a,b;
int main(){
cin >> a >> b;
int ans = a + a / b;
int u = a / b;
int r = a % b;
while(u != 0){
if(r != 0){
u += r;
}
r = u % b;
u /= b;
ans += u;
}
cout << ans << endl;
return 0;
}
边栏推荐
- Shuttle inside and outside margins
- WPF data binding (IV)
- Leetcode-9. Palindrome Numbber
- Cross-Modal Pattern-Propagation for RGB-T Tracking
- 22年五月毕设
- Leetcode hot topic 100 topic 6-10 solution
- [deploy private warehouse based on harbor] 4 push image to harbor
- Comparison of DOM tags of wechat applet development (native and uniapp)
- The meaning and research significance of mathematical methodology
- [deploy private warehouse based on harbor] 2 machine preparation
猜你喜欢
![[advanced concurrency] - thread pool summary](/img/69/dc8146dafc30f8a8efa012b67aa05c.png)
[advanced concurrency] - thread pool summary

Whether the ZABBIX monitoring host is online

webserver

Education expert wangzhongze solves students' problems with one move

Detailed explanation of mutationobserver

.NET C#基础(6):命名空间 - 有名字的作用域

matplotlib的cmap

Outer margin collapse

教育专家王中泽老师:家庭教育重在自己成长

CMAP of Matplotlib
随机推荐
es5和es6的学习小记
[deploy private warehouse based on harbor] 2 machine preparation
Luogu p1091 chorus formation (longest ascending subsequence)
22年五月毕设
1190. invert the substring between each pair of parentheses
1734. arrangement after decoding XOR
1269. number of options left in place
Common modules of saltstack
Difference between byte and bit
byte和bit的区别
Phi and phi (Mobius inversion + formula)
二、用户登录和注册
Concurrent tool class
213. house raiding II
Explain the difference between void 0 and undefined
Education expert Mr. wangzhongze: family education focuses on self growth
Whether the ZABBIX monitoring host is online
[Xunwei dry goods] opencv test of Godson 2k1000 development board
ESP32学习笔记(49)——ESP-WIFI-MESH接口使用
Experience record of rural housing integration script