QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#406029 | #6563. Four Square | liuzhenhao09# | WA | 1ms | 3836kb | C++20 | 630b | 2024-05-06 19:01:38 | 2024-05-06 19:01:39 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int w[5],h[5],id[5],W[5],H[5];
signed main(){
for(int i = 1; i <= 4; i++) scanf("%lld %lld",&w[i],&h[i]),id[i] = i;
do{
for(int s = 0; s < 16; s++){
for(int u = 1; u <= 4; u++){
int i = id[u];
W[i] = w[i],H[i] = h[i];
if(s & (1LL << (u - 1))) swap(W[i],H[i]);
}
if(W[1] + W[3] != W[2] + W[4] || H[1] + H[2] != H[3] + H[4] || W[1] + W[3] != H[1] + H[2]) continue;
if(W[1] == W[2] || H[1] == H[3]){
printf("1");
return 0;
}
}
}
while(next_permutation(id + 1,id + 5));
printf("0");
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3836kb
input:
1 1 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
3 1 3 3 2 2 3 3
output:
0
result:
ok single line: '0'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3788kb
input:
2 8 2 8 2 8 2 8
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'