QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#512735 | #9168. Square Locator | ucup-team3282# | WA | 0ms | 3700kb | C++14 | 781b | 2024-08-10 15:34:34 | 2024-08-10 15:34:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll OA2,OB2,OC2,OD2;
ll xA,yA,xB,yB,xC,yC,xD,yD;
ll xA1,yA1;
//
int main(){
ios::sync_with_stdio(0);
cin>>OA2>>OB2>>OC2>>OD2;
xA=0;yA=sqrtl(OA2);
ll t=yA;
ld c=(OD2-OB2)/(2*t)+t;
ld yD1=(c+sqrtl(2*OD2-c*c))/2;
ld yD2=(c-sqrtl(2*OD2-c*c))/2;
yD=round(yD1);
xD=round(sqrtl(OD2-yD*yD));
xC=xD-(yA-yD);yC=yD-xD;
xB=-(yA-yD);yB=yA-xD;
if(xB*xB+yB*yB==OB2&&xC*xC+yC*yC==OC2){
cout<<yA<<' '<<xB<<' '<<yB<<' '<<xC<<' '<<yC<<' '<<xD<<' '<<yD<<endl;
return 0;
}
yD=round(yD2);
xD=round(sqrtl(OD2-yD*yD));
xC=xD-(yA-yD);yC=yD-xD;
xB=-(yA-yD);yB=yA-xD;
cout<<yA<<' '<<xB<<' '<<yB<<' '<<xC<<' '<<yC<<' '<<xD<<' '<<yD<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
36 5 10 41
output:
6 -1 2 3 1 4 5
result:
ok Answer is correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 1 1 1
output:
1 0 1 0 1 0 1
result:
ok Answer is correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
output:
1000000000 0 1000000000 0 1000000000 0 1000000000
result:
ok Answer is correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
4 10 8 2
output:
2 -3 1 -2 -2 1 -1
result:
ok Answer is correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
4 50 104 58
output:
2 -5 -5 2 -10 7 -3
result:
ok Answer is correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
9 16 65 58
output:
3 4 0 7 4 3 7
result:
ok Answer is correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
25 13 101 113
output:
5 3 -2 10 1 7 8
result:
ok Answer is correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
16 25 58 49
output:
4 3 4 3 7 0 7
result:
ok Answer is correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
374544 2235250 4453364 2592658
output:
612 -1205 -885 292 -2090 1497 -593
result:
ok Answer is correct
Test #10:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
126736 551200 1838608 1414144
output:
356 732 -124 1212 608 480 1088
result:
ok Answer is correct
Test #11:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
6007401 6936277 5051405 4122529
output:
2451 -2599 426 -574 -2173 2025 -148
result:
ok Answer is correct
Test #12:
score: -100
Wrong Answer
time: 0ms
memory: 3620kb
input:
2209 2536706 4875777 2341280
output:
47 -1435 -597 -791 -2032 644 -1388
result:
wrong answer Squared distances are incorrect