QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#558206 | #8081. Minimum Manhattan Distance | retired_midlights# | WA | 0ms | 3824kb | C++14 | 898b | 2024-09-11 14:53:26 | 2024-09-11 14:53:27 |
Judging History
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;
}
詳細信息
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