QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#419623 | #6563. Four Square | ohiostatescarlet | WA | 15ms | 10576kb | Python3 | 895b | 2024-05-24 04:34:41 | 2024-05-24 04:34:42 |
Judging History
answer
from itertools import permutations
def test(a):
if a[0][1] + a[2][1] == a[1][1] + a[3][1] and a[0][0] == a[2][0] and a[1][0] == a[3][0]:
return True
if a[0][1] + a[1][1] + a[2][1] == a[3][1] and a[0][0] == a[1][0] == a[2][0]:
return True
if a[0][0] == a[1][0] and a[0][1] + a[1][1] == a[2][1] == a[3][1]:
return True
if a[0][1] == a[1][1] == a[2][1] == a[3][1]:
return True
if a[0][1] + a[1][1] == a[3][1] and a[1][1] == a[2][1] and a[0][0] == a[1][0] + a[2][0]:
return True
return False
a = [list(map(int, input().split())) for _ in range(4)]
for swap in range(2**4):
b = [i.copy() for i in a]
for i in range(4):
if swap & (1 << i):
b[i] = b[i][::-1]
for i in permutations(b):
print(i)
if test(i):
print(1)
exit()
print(0)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 15ms
memory: 10576kb
input:
1 1 1 1 1 1 1 1
output:
([1, 1], [1, 1], [1, 1], [1, 1]) 1
result:
wrong answer 1st lines differ - expected: '1', found: '([1, 1], [1, 1], [1, 1], [1, 1])'