QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#518833 | #9168. Square Locator | Jun | WA | 0ms | 3916kb | C++14 | 1.0kb | 2024-08-14 13:01:36 | 2024-08-14 13:01:36 |
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;
long long bx, by;
if(BO <= DO)//B点在左边
{
dx = (long long) (mid_x + deta_y), dy = (long long) (mid_y + deta_x);
bx = (long long) (mid_x - deta_y), by = (long long) (mid_y - deta_x);
}
else
{
dx = (long long) (mid_x - deta_y), dy = (long long) (mid_y - deta_x);
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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3816kb
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: 3916kb
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: 3880kb
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