QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#201385#5151. Bottle Flipsalvator_noster#WA 0ms3856kbC++141.1kb2023-10-05 14:03:112023-10-05 14:03:12

Judging History

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

  • [2023-10-05 14:03:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3856kb
  • [2023-10-05 14:03:11]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef double db;

db h, r, da, dw;

db calc(db t) {
    db t1 = t * t / 2 * dw + (h * h - t * t) / 2 * da;
    db t2 = t * dw + (h - t) * da;
    return t1 / t2;
}

int main(void) {
    scanf("%lf%lf%lf%lf", &h, &r, &da, &dw);
    printf("%lf %lf\n", calc(0), calc(h));
    double t1 = h * h * da * da / (dw - da) / (dw - da);
    double t2 = h * h * da / (dw - da);
    double t3 = sqrt(t1 + t2);
    double t4 = h * da / (dw - da);
    double t = t3 - t4;
    printf("%.10f\n", t);
    // db le = 0.0, ri = r, ans = -1;
    // for (int i = 1; i <= 10; ++i) {
    //     ans = (le + ri) / 2;
    //     db step = (ri - le) / 3;
    //     db t1 = le + step, t2 = ri - step;
    //     db num1 = calc(t1), num2 = calc(t2);
    //     printf("t1 = %lf, t2 = %lf, num1 = %lf, num2 = %lf\n", t1, t2, num1,
    //            num2);
    //     if (num1 < num2) {
    //         ri = t2;
    //     } else {
    //         le = t1;
    //     }
    // }
    // printf("%.10f\n", ans);
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3856kb

input:

22 4 1 4

output:

11.000000 11.000000
7.3333333333

result:

wrong answer 1st numbers differ - expected: '7.3333333', found: '11.0000000', error = '0.5000000'