QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#111014 | #6563. Four Square | Tobo# | WA | 2ms | 3396kb | C++20 | 925b | 2023-06-05 14:13:27 | 2023-06-05 14:13:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define N 2005
int x[4], y[4], sum;
void solve()
{
for (int i = 0; i < 4; i++)
cin >> x[i] >> y[i], sum += x[i] * y[i];
int a = sqrt(sum + 0.5);
if (a * a != sum)
{
cout << 0;
return;
}
for (int i = 0; i < 16; i++)
{
int b = 0, c = 0;
for (int j = 0; j < 4; j++)
{
if (i >> j & 1)
b += x[j], c += y[j];
else
b += y[j], c += x[j];
}
if (b & 1 || c & 1)
continue;
b >>= 1, c >>= 1;
if (a == b && a == c)
{
cout << 1;
return;
}
}
cout << 0;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while (t--)
solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3380kb
input:
1 1 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
3 1 3 3 2 2 3 3
output:
0
result:
ok single line: '0'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3380kb
input:
2 8 2 8 2 8 2 8
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'