Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
328959 | 钟宜辰 | 【C3-7】阿凡提的难题 | C++ | 解答错误 | 0 | 1 MS | 240 KB | 276 | 2025-07-07 17:15:41 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,d,t=0,f=1; cin>>n>>d; for(int i=1;;i++){ for(int j=1;j<=i;j++){ n-=d; t++; if(n<=0){ f=0; break; } } if(f==0){ break; } t++; } cout<<t<<endl; return 0; }