QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#515861#9168. Square Locatorclouds_WA 0ms3612kbC++14765b2024-08-12 10:16:532024-08-12 10:16:53

Judging History

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

  • [2024-08-12 10:16:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2024-08-12 10:16:53]
  • 提交

answer


#include<bits/stdc++.h>
#define endl '\n'
#define int long long
#define ios ios::sync_with_stdio(false), cin.tie(nullptr)
using namespace std;
const int N=1e6+10;
typedef pair<int, int> pii;

void solve()
{
    int A,B,C,D;
    cin>>A>>B>>C>>D;
    int a=sqrtl(A)+0.5;
    int d=(B-D)/2/a;
    // debug(a,d);
    // debug(2,2*(a+d),(a*a+d*d-D));
    int x=-(a+d)+(sqrtl((a+d)*(a+d)-2*(a*a+d*d-D))+0.5);
    x/=2;
    int y=x+d;
    cout<<a<<' '<<x<<' '<<a+y<<' '<<x-y<<' '<<a+x+y<<' '<<-y<<' '<<a+x<<endl;
}

signed main()
{
    ios;
    int T = 1;
    // cin >> T;
    // cout << fixed << setprecision(8);
    for (int i = 1; i <= T; i++)
    {
        // cout << "Case " << i << ": ";
        solve();
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3612kb

input:

36 5 10 41

output:

6 0 3 3 3 3 6

result:

wrong answer Squared distances are incorrect