QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#436533#8768. Arrested DevelopmentUSP_USP_USP#WA 0ms3848kbC++231.1kb2024-06-09 01:31:342024-06-09 01:31:34

Judging History

你现在查看的是最新测评结果

  • [2024-06-09 01:31:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3848kb
  • [2024-06-09 01:31:34]
  • 提交

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'