mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1163 银行贷款
R40521435
This commit is contained in:
parent
19ff441b6e
commit
9575e7d641
21
problem/P1163/P1163.cpp
Normal file
21
problem/P1163/P1163.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
double n, m, k, l, r, mid;
|
||||
cin >> n >> m >> k;
|
||||
l = 00.0;
|
||||
r = 10.0;
|
||||
while (r - l >= 0.0001) {
|
||||
mid = (l + r) / 2;
|
||||
if (pow(1.0 / (1.0 + mid), k) >= 1 - n / m * mid) {
|
||||
r = mid;
|
||||
}
|
||||
else {
|
||||
l = mid;
|
||||
}
|
||||
}
|
||||
cout << fixed << setprecision(1) << l * 100 << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user