QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#516512 | #9168. Square Locator | Jun | WA | 0ms | 3896kb | C++14 | 828b | 2024-08-12 17:45:34 | 2024-08-12 17:45:34 |
Judging History
answer
#include <bits/stdc++.h>
#define endl '\n'
#define IOS ios::sync_with_stdio(false),cin.tie(nullptr);
using namespace std;
double AO, BO, CO, DO;
void Jun()
{
cin >> AO >> BO >> CO >> DO;
double cx, cy;
cx = (4 * DO - 2 * AO - 2 * CO) / (4 * sqrt(AO)), cy = CO - cx * cx;
double mid_x, mid_y;
mid_x = cx / 2, mid_y = (sqrt(AO) + cy) / 2;
double deta_x, deta_y;
deta_x = cx / 2, deta_y = (sqrt(AO) - cy) / 2;
long long dx, dy;
dx = (long long) (mid_x + deta_y), dy = (long long) (mid_y + deta_x);
long long bx, by;
bx = (long long) (mid_x - deta_y), by = (long long) (mid_y - deta_x);
cout << sqrt(AO)<<" " << bx << " " << by << " " << cx << " " << cy << " " << dx << " " << dy << endl;
}
signed main()
{
IOS
Jun();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3896kb
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: 3676kb
input:
1 1 1 1
output:
1 0 1 0 1 0 1
result:
ok Answer is correct
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3824kb
input:
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000
output:
1e+09 499999999500000000 500000000500000000 0 1e+18 -499999999500000000 500000000500000000
result:
wrong output format Expected integer, but "1e+09" found