QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#702017 | #8081. Minimum Manhattan Distance | test_algth | WA | 57ms | 3964kb | C++14 | 1.2kb | 2024-11-02 15:07:02 | 2024-11-02 15:07:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define mkp make_pair
#define pb push_back
typedef pair <int, int> pii;
const double PI = acos(-1);
inline int read() {
int x = 0, f = 0;
char c = getchar();
while (!isdigit(c)) {if (c == '-') f = 1; c = getchar();}
while (isdigit(c)) x = (x << 1) + (x << 3) + (c & 15), c = getchar();
return f? -x : x;
}
void getc(int x1, int y1, int x2, int y2, double &x, double &y, double &r) {
x = (x1 + x2) * 0.5;
y = (y1 + y2) * 0.5;
r = sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))) * 0.5;
}
signed main() {
// freopen ("std.in", "r", stdin);
// freopen ("std.out", "w", stdout);
int T;
T = read();
while (T--) {
int t1, t2, t3, t4;
double x1, y1, r1, x2, y2, r2;
t1 = read(), t2 = read(), t3 = read(), t4 = read();
getc(t1, t2, t3, t4, x1, y1, r1);
t1 = read(), t2 = read(), t3 = read(), t4 = read();
getc(t1, t2, t3, t4, x2, y2, r2);
double x = fabs(x2 - x1);
double y = fabs(y2 - y1);
x = x - r2 * sqrt(2.0) * 0.5;
y = y - r2 * sqrt(2.0) * 0.5;
printf("%.10lf", x + y);
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3964kb
input:
1 0 0 2 1 4 5 5 2
output:
4.2639320225
result:
ok Your answer is acceptable!^ ^
Test #2:
score: -100
Wrong Answer
time: 57ms
memory: 3852kb
input:
100000 64184 -33682 59295 3067 16568 83379 -30901 17899 4747 16156 33365 80028 -41011 -93961 -89583 -95743 96914 -33206 12828 -88885 -93518 29681 -82022 42270 40225 76998 25677 84480 66361 -32945 94822 -81258 -17979 41800 -91442 80586 40229 -78184 30070 -89624 -21082 -94587 48262 -87979 -95197 91518...
output:
77664.4926864032192928.3027014407227607.1060353066145831.4445800461224138.5231894688203168.4163226262106258.7021872966114459.0303484890130191.378343408392639.9951336741110927.1824394682121482.2553263667130471.0514280389193239.8699309033101942.1776022449228879.0586081132128129.564658762783809.4379227...
result:
wrong output format Expected double, but "77664.4926864032192928.3027014...91562.08474742361638.9718864969" found