QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#227594 | #6563. Four Square | Nerovix# | WA | 1ms | 3404kb | C++20 | 1.2kb | 2023-10-27 19:20:44 | 2023-10-27 19:20:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pii;
pii a[4];
signed main() {
for(int i = 0; i < 4; i++)
cin >> a[i].fi >> a[i].se;
do {
for(int s = 0; s < 1 << 4; s++) {
pii b[4];
for(int i = 0; i < 4; i++) {
b[i] = a[i];
if(s >> i & 1) swap(b[i].fi, b[i].se);
}
if(b[0].fi == b[1].se + b[2].se && b[1].fi == b[2].fi &&
b[0].se + b[1].fi == b[3].fi && b[3].fi == b[0].fi + b[0].se) {
cout << "1\n";
return 0;
} else if(b[0].fi == b[1].fi + b[2].fi && b[1].se == b[2].se &&
b[0].fi == b[3].fi && b[0].fi == b[0].se + b[1].se + b[3].se) {
cout << "1\n";
return 0;
} else if(b[0].fi + b[1].fi == b[2].fi + b[2].se && b[0].se == b[1].se &&
b[0].se + b[2].se == b[0].fi + b[1].fi && b[2].se == b[3].se) {
cout << "1\n";
return 0;
}
}
} while(next_permutation(a, a + 4));
cout << "0\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3332kb
input:
1 1 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3328kb
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: 3404kb
input:
2 8 2 8 2 8 2 8
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'