QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#515861 | #9168. Square Locator | clouds_ | WA | 0ms | 3612kb | C++14 | 765b | 2024-08-12 10:16:53 | 2024-08-12 10:16:53 |
Judging History
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