Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
59197 | 周梓易 | 14能吸多少根烟 | C++ | Accepted | 3 MS | 268 KB | 258 | 2023-10-19 19:07:29 |
# include<iostream> # include<cstdio> using namespace std; int main(){ int n=0,k=0; scanf("%d%d",&n,&k); int counts=n; int a = n; while (a / k){ counts += a / k; a = a / k + a % k; } printf("%d",counts); return 0; }