QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#406029#6563. Four Squareliuzhenhao09#WA 1ms3836kbC++20630b2024-05-06 19:01:382024-05-06 19:01:39

Judging History

你现在查看的是最新测评结果

  • [2024-05-06 19:01:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3836kb
  • [2024-05-06 19:01:38]
  • 提交

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'