QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#512704 | #9168. Square Locator | ucup-team3282# | WA | 0ms | 3740kb | C++14 | 779b | 2024-08-10 15:28:12 | 2024-08-10 15:28:13 |
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=sqrt(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^2));
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: 3620kb
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: 3740kb
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: 3624kb
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: 3616kb
input:
4 10 8 2
output:
2 -3 1 -2 -2 1 -1
result:
ok Answer is correct
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3700kb
input:
4 50 104 58
output:
2 -5 -6 3 -11 8 -3
result:
wrong answer Squared distances are incorrect