QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#516512#9168. Square LocatorJunWA 0ms3896kbC++14828b2024-08-12 17:45:342024-08-12 17:45:34

Judging History

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

  • [2024-08-12 17:45:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3896kb
  • [2024-08-12 17:45:34]
  • 提交

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