QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#419623#6563. Four SquareohiostatescarletWA 15ms10576kbPython3895b2024-05-24 04:34:412024-05-24 04:34:42

Judging History

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

  • [2024-05-24 04:34:42]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10576kb
  • [2024-05-24 04:34:41]
  • 提交

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)

詳細信息

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])'