QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#436533 | #8768. Arrested Development | USP_USP_USP# | WA | 0ms | 3848kb | C++23 | 1.1kb | 2024-06-09 01:31:34 | 2024-06-09 01:31:34 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define int ll
void dbg_out() { cerr << endl; }
template<typename H, typename... T>
void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); }
#define dbg(...) { cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); }
void solve() {
int n, m; double p; cin >> n >> m >> p;
// p = p - 0.5;
vector memo (n, vector<double> (m));
double meanP = p / 2;
for (int i = n - 1; i >= 0; i--) {
for (int j = m - 1; j >= 0; j--) {
if (i == n - 1 && j == m - 1) continue;
double dir = j + 1 < m ? memo[i][j + 1] : 1e18;
double esq = i + 1 < n ? memo[i + 1][j] : 1e18;
memo[i][j] += 0.5 * (min<double> (dir, esq + meanP));
memo[i][j] += 0.5 * (min<double> (esq, dir + meanP));
dbg (i, j, memo[i][j]);
}
}
cout << setprecision (10) << fixed;
cout << memo[0][0] << "\n";
}
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
solve();
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3848kb
input:
4 100 1 1 90 1 20 1 20
output:
24.0000000000
result:
wrong answer 1st lines differ - expected: '3', found: '24.0000000000'