QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#419620 | #6563. Four Square | ohiostatescarlet | WA | 10ms | 9640kb | Python3 | 879b | 2024-05-24 04:27:31 | 2024-05-24 04:27:33 |
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][1]:
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):
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: 10ms
memory: 9640kb
input:
1 1 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 9ms
memory: 9536kb
input:
3 1 3 3 2 2 3 3
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 9ms
memory: 9640kb
input:
2 8 2 8 2 8 2 8
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 6ms
memory: 9536kb
input:
5 3 5 5 3 3 3 5
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 5ms
memory: 9600kb
input:
1 2 4 8 16 32 64 128
output:
0
result:
ok single line: '0'
Test #6:
score: -100
Wrong Answer
time: 10ms
memory: 9596kb
input:
4 4 2 1 4 4 2 1
output:
1
result:
wrong answer 1st lines differ - expected: '0', found: '1'