25温 @ 2022-08-31 18:50:21
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, yd = 0, sum = 0;
cin >> n >> k;
sum += n;
while (n >= k) {
yd = n % k;
n /= 3;
sum += n;
}
cout << sum;
return 0;
}
by OoXiao_QioO @ 2022-08-31 18:51:10
所以呢?你是警告还是求助
by 25温 @ 2022-08-31 18:55:30
HElp ME!!!!!!!!!!!!!!!!!
by OoXiao_QioO @ 2022-08-31 18:57:23
@25温 这道题可以不用循环,推一个式子就可以了
by Nevergonna_CCF @ 2022-08-31 18:57:33
@OoXiao_QioO 你的badge好了?
by Nevergonna_CCF @ 2022-08-31 18:57:53
同上上
by OoXiao_QioO @ 2022-08-31 18:58:37
@lmw_AK_noip 好了是好了,但是这个问题和lz的求助无关吧qwq
by Nevergonna_CCF @ 2022-08-31 18:59:30
az,借楼问一下
by 25温 @ 2022-08-31 19:00:17
@OoXiao_QioO OK
by OoXiao_QioO @ 2022-08-31 19:00:22
@lmw_AK_noip 您推荐的背景是真的好qwq
by Nevergonna_CCF @ 2022-08-31 19:00:33
问题还是很明显的,WA的原因可以自己随机几个样例,和题解对拍