QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#512804#9168. Square Locatorucup-team3282#Compile Error//Python31.2kb2024-08-10 15:52:062024-08-10 15:52:07

Judging History

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

  • [2024-08-10 15:52:07]
  • 评测
  • [2024-08-10 15:52:06]
  • 提交

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);
	ll xD1=round(sqrtl(OD2-yD*yD));
	xD=xD1;
	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;
	}
	xD=-xD1;
	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);
	xD1=round(sqrtl(OD2-yD*yD));
	xD=xD1;
	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;
	}
	xD=-xD1;
	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;
	}
	return 0;
}

Details

  File "answer.code", line 2
    using namespace std;
          ^^^^^^^^^
SyntaxError: invalid syntax