QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#652560 | #9168. Square Locator | woodie_0064# | WA | 0ms | 3756kb | C++20 | 743b | 2024-10-18 18:51:30 | 2024-10-18 18:51:37 |
Judging History
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