QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#558206#8081. Minimum Manhattan Distanceretired_midlights#WA 0ms3824kbC++14898b2024-09-11 14:53:262024-09-11 14:53:27

Judging History

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

  • [2024-09-11 14:53:27]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2024-09-11 14:53:26]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define ls p << 1
#define rs p << 1 | 1
#define rep(i, a, b) for(int i = (int)a; i <= (int)b; i ++)
#define per(i, a, b) for(int i = (int)a; i >= (int)b; i --)\

void solve() {
    double a, b, c, d;
    std :: cin >> a >> b >> c >> d;
    double x1 = (a + c) / 2, y1 = (b + d) / 2;
    double r1 = sqrt((a - c) * (a - c) + (b - d) * (b - d));
    std :: cin >> a >> b >> c >> d;
    double x2 = (a + c) / 2, y2 = (b + d) / 2;
    double r2 = sqrt((a - c) * (a - c) + (b - d) * (b - d));

    std :: cout << std :: fixed << std :: setprecision(15) << fabs(x1 - x2) + fabs(y1 - y2) - sqrt(0.5) * r2 << "\n";
    std :: cout << fabs(x1 - x2) + fabs(y1 - y2) << std :: endl;
}

int main() {
    std :: ios :: sync_with_stdio(false);
    std :: cin.tie(0);
    int T;
    std :: cin >> T;
    while(T --) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
0 0 2 1
4 5 5 2

output:

4.263932022500210
6.500000000000000

result:

wrong output format Extra information in the output file