QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#512775 | #9168. Square Locator | ucup-team3282# | WA | 14ms | 10724kb | Python3 | 601b | 2024-08-10 15:44:09 | 2024-08-10 15:44:09 |
Judging History
answer
OA2, OB2, OC2, OD2 = map(int, input().split())
def sqrt(x):
return x**0.5
yA = sqrt(OA2)
t = yA
c = (OD2-OB2)/(2*t)+t
yD1=(c+sqrt(2*OD2-c*c))/2
yD2=(c-sqrt(2*OD2-c*c))/2
yD=yD1
xD=sqrt(OD2-yD*yD)
xC=xD-(yA-yD)
yC=yD-xD
xB=-(yA-yD)
yB=yA-xD
yA,xB,yB,xC,yC,xD,yD = map(int,(yA,xB,yB,xC,yC,xD,yD))
if xB*xB+yB*yB==OB2 and xC*xC+yC*yC==OC2 :
print(yA,xB,yB,xC,yC,xD,yD)
else:
yD=yD1
xD=sqrt(OD2-yD*yD)
xC=xD-(yA-yD)
yC=yD-xD
xB=-(yA-yD)
yB=yA-xD
yA,xB,yB,xC,yC,xD,yD = map(int,(yA,xB,yB,xC,yC,xD,yD))
print(yA,xB,yB,xC,yC,xD,yD)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 10ms
memory: 10724kb
input:
36 5 10 41
output:
6 -1 2 3 1 4 5
result:
ok Answer is correct
Test #2:
score: 0
Accepted
time: 14ms
memory: 10632kb
input:
1 1 1 1
output:
1 0 1 0 1 0 1
result:
ok Answer is correct
Test #3:
score: 0
Accepted
time: 3ms
memory: 10632kb
input:
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
output:
1000000000 0 1000000000 0 1000000000 0 1000000000
result:
ok Answer is correct
Test #4:
score: -100
Wrong Answer
time: 8ms
memory: 10616kb
input:
4 10 8 2
output:
2 -1 1 0 0 1 1
result:
wrong answer Squared distances are incorrect