QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#575428#8081. Minimum Manhattan Distancehahahalz#WA 159ms3932kbC++20712b2024-09-19 14:13:372024-09-19 14:13:37

Judging History

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

  • [2024-09-19 14:13:37]
  • 评测
  • 测评结果:WA
  • 用时:159ms
  • 内存:3932kb
  • [2024-09-19 14:13:37]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define lb long double
const int Max = 2*(int)1e3;
int mid[Max][Max],a[Max];
void solve() {
    lb x1,x2,x3,x4,x5,x6,x7,x8;
    lb a,b,c,d,r=0;
    cin>>x1>>x2>>x3>>x4>>x5>>x6>>x7>>x8;
    a=(x1+x3)/(lb)2.0,b=(x2+x4)/(lb)2.0,c=(x5+x7)/(lb)2.0,d=(x6+x8)/(lb)2.0;
    r=(x8-x6)*(x8-x6)+(x5-x7)*(x5-x7);
    r=sqrtl(2*r)/2;
    lb ans=c+d-a-b-r;
    cout<<fixed<<setprecision(12)<<ans<<"\n";
}
 signed main() {
#ifdef ACM_LOCAL
    freopen("data.in","r",stdin);
    freopen("data.out","w",stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    cin>>t;
    while(t--) {
        solve();
    }
}


詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3932kb

input:

1
0 0 2 1
4 5 5 2

output:

4.263932022500

result:

ok Your answer is acceptable!^ ^

Test #2:

score: -100
Wrong Answer
time: 159ms
memory: 3896kb

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:

-60147.507313596791
-261665.697298559339
-57674.893964693344
-129849.555419953954
-66055.476810531139
25362.416322626161
106258.702187296652
-62922.969651511017
-98795.621656591725
-64811.004866325868
110927.182439468239
121482.255326366726
-168426.948571961091
-234097.130069096655
-88533.8223977550...

result:

wrong answer Except 77664.492686403202, but found -60147.507313596790!QAQ