Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
59733 | 余慕涵 | 14能吸多少根烟 | C++ | Accepted | 1 MS | 276 KB | 285 | 2023-11-03 20:40:27 |
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main(){ int s=0; int x=0,n=0,m=0; cin>>x>>n; while(x>=0){ if(s==n){ s=0; x++;} s++; x--; m++; } cout<<m-1; return 0; }