QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#512781#9168. Square Locatorucup-team3282#WA 15ms10684kbPython3641b2024-08-10 15:45:362024-08-10 15:45:38

Judging History

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

  • [2024-08-10 15:45:38]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10684kb
  • [2024-08-10 15:45:36]
  • 提交

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(lambda x: int(round(x)),(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(lambda x: int(round(x)),(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: 15ms
memory: 10684kb

input:

36 5 10 41

output:

6 -1 2 3 1 4 5

result:

ok Answer is correct

Test #2:

score: 0
Accepted
time: 9ms
memory: 10580kb

input:

1 1 1 1

output:

1 0 1 0 1 0 1

result:

ok Answer is correct

Test #3:

score: 0
Accepted
time: 10ms
memory: 10600kb

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: 15ms
memory: 10640kb

input:

4 10 8 2

output:

2 -1 1 0 0 1 1

result:

wrong answer Squared distances are incorrect