# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
872426 | 2023-11-13T05:22:13 Z | browntoad | Minerals (JOI19_minerals) | C++14 | 0 ms | 0 KB |
#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; } }