1 条题解
-
6
#include<bits/stdc++.h> using namespace std; int f(int m,int k,int s,int b) { double h=m; int n=1; bool u=false; const double e=1e-9; while(true) { int t=s+n-1; double a=1.0*k*n; if(b==n&&!u) { h-=0.1*m; u=true; if(h<=e)return n; } double d=a*t; if(h<=d+e)return n; h-=d; n++; } } int main() { int m,k,s; cin>>m>>k>>s; int r=INT_MAX; r=min(r,f(m,k,s,0)); for(int x=1; x<=2000; x++)r=min(r,f(m,k,s,x)); cout<<r<<endl; return 0; }
- 1
信息
- ID
- 238
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 9
- 标签
- (无)
- 递交数
- 9
- 已通过
- 4
- 上传者