Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148051 罗迎甲 14能吸多少根烟 C++ Accepted 0 MS 272 KB 217 2026-02-09 15:27:28

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,k,a=0,sum=0; cin>>n>>k; while(n!=0){ sum+=n; a+=n; n=a/k; a%=k; } cout<<sum<<endl; return 0; }