QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#518833#9168. Square LocatorJunWA 0ms3916kbC++141.0kb2024-08-14 13:01:362024-08-14 13:01:36

Judging History

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

  • [2024-08-14 13:01:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3916kb
  • [2024-08-14 13:01:36]
  • 提交

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