QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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;
}
Details
Tip: Click on the bar to expand more detailed information
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'