QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#652560#9168. Square Locatorwoodie_0064#WA 0ms3756kbC++20743b2024-10-18 18:51:302024-10-18 18:51:37

Judging History

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

  • [2024-10-18 18:51:37]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3756kb
  • [2024-10-18 18:51:30]
  • 提交

answer

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
using i64 = long long;
using par = pair<i64 , i64>;
const int N = 1e5 + 3;
int T;
int n, num;
i64 a, b, c, d;

void work(){
	cin >> a >> b >> c >> d;
	a = sqrt(a);
	par B, C, D;
	i64 x = (2 * d - a * a - c) / 2 / a;
	i64 y = sqrt(c - x * x) + a;
	cout << x << " " << y << "\n";
	B = {(x + y)/2 - a,  (y-x)/2}, C = {x, y-a}, D = {(x-y)/2 + a, (x + y)/2};
	cout << a << " " << B.first << " " << B.second << " " << C.first << " " << C.second << " " << D.first << " " << D.second;
	
}


int main(){
//	freopen("test.txt", "r", stdin);
	ios::sync_with_stdio(false);
	cin.tie(0);
	work();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3756kb

input:

36 5 10 41

output:

3 7
6 -1 2 3 1 4 5

result:

wrong answer Squared distances are incorrect