QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#419624 | #6563. Four Square | ohiostatescarlet | WA | 15ms | 10708kb | Python3 | 897b | 2024-05-24 04:35:16 | 2024-05-24 04:35:17 |
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: 100
Accepted
time: 15ms
memory: 10644kb
input:
1 1 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 14ms
memory: 10524kb
input:
3 1 3 3 2 2 3 3
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 12ms
memory: 10572kb
input:
2 8 2 8 2 8 2 8
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 7ms
memory: 10604kb
input:
5 3 5 5 3 3 3 5
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 9ms
memory: 10576kb
input:
1 2 4 8 16 32 64 128
output:
0
result:
ok single line: '0'
Test #6:
score: -100
Wrong Answer
time: 2ms
memory: 10708kb
input:
4 4 2 1 4 4 2 1
output:
1
result:
wrong answer 1st lines differ - expected: '0', found: '1'