mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 18:48:48 +00:00
#1971. 【Public NOIP Round #5】青鱼和怪兽
https://sjzezoj.com/submission/72577
This commit is contained in:
parent
ded1af697d
commit
d7bd7cf57e
54
S2OJ/1971/1971.cpp
Normal file
54
S2OJ/1971/1971.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 1005;
|
||||
const double eps = 1e-6;
|
||||
|
||||
int n, m, c;
|
||||
double p, f[N][N];
|
||||
|
||||
bool check(double x) {
|
||||
for (int i = 0; i <= m; i++) {
|
||||
f[0][i] = x;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
for (int j = 1; j <= m; j++) {
|
||||
f[i][j] = std::min(x, f[i - 1][j] * (1.0 - p) + f[i][j - 1] * p + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return f[n][m] < x;
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n >> m >> c;
|
||||
|
||||
p = c / 100.0;
|
||||
|
||||
double l = 0,
|
||||
r = 1e9,
|
||||
res = 1e9;
|
||||
|
||||
while (r - l > eps) {
|
||||
double mid = (l + r) / 2;
|
||||
|
||||
if (check(mid)) {
|
||||
r = mid;
|
||||
res = mid;
|
||||
} else {
|
||||
l = mid;
|
||||
}
|
||||
}
|
||||
|
||||
cout << std::fixed << std::setprecision(12) << res << endl;
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/1971/data/boss1.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss10.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss10.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss100.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss100.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss100.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss100.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss11.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss11.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss11.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss12.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss12.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss12.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss13.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss13.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss13.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss14.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss14.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss14.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss15.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss15.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss15.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss16.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss16.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss16.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss17.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss17.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss17.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss18.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss18.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss18.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss19.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss19.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss19.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss2.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss20.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss20.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss20.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss21.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss21.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss21.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss21.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss22.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss22.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss22.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss22.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss23.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss23.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss23.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss23.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss24.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss24.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss24.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss24.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss25.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss25.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss25.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss25.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss26.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss26.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss26.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss26.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss27.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss27.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss27.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss27.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss28.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss28.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss28.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss28.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss29.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss29.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss29.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss29.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss3.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss30.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss30.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss30.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss30.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss31.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss31.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss31.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss31.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss32.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss32.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss32.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss32.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss33.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss33.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss33.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss33.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss34.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss34.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss34.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss34.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss35.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss35.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss35.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss35.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss36.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss36.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss36.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss36.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss37.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss37.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss37.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss37.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss38.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss38.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss38.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss38.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss39.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss39.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss39.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss39.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss4.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss40.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss40.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss40.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss40.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss41.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss41.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss41.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss41.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss42.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss42.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss42.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss42.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss43.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss43.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss43.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss43.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss44.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss44.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss44.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss44.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss45.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss45.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss45.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss45.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss46.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss46.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss46.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss46.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss47.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss47.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss47.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss47.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss48.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss48.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss48.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss48.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss49.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss49.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss49.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss49.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss5.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss5.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss50.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss50.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss50.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss50.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss51.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss51.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss51.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss51.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss52.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss52.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss52.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss52.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1971/data/boss53.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1971/data/boss53.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user