# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
872426 | browntoad | Minerals (JOI19_minerals) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
long double p = 0.10;
int f(int a){
if (a <= 1) return 0;
if (a == 2) return 2;
int tmp = max((int)(p*a), 1);
return f(tmp)+f(a-tmp)+a+tmp-1;
}
signed main(){
int n = 43000;
p = 0.39;
cout<<f(3)<<endl;
p = 0.10;
while(p < 0.70){
cout<<p<<' '<<f(n)+2*n<<endl;
p += 0.01;
}
}