Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        A = [list(map(int, input().split())) for _ in range(N)]

        already_p = set()
        days = 0
        done = set()
        while True:
            for i, a in enumerate(A):
                if len(a) == 0:
                    done.add(i + 1)
                    continue
                if i + 1 not in already_p:
                    if a[0] not in already_p:
                        if A[a[0] - 1][0] == i + 1:
                            already_p.add(i + 1)
                            already_p.add(a[0])
                            A[a[0] - 1] = A[a[0] - 1][1:]
                            A[i] = a[1:]

            if len(done) == N:
                break

            if len(already_p) == 0:
                print(-1)
                exit()

            already_p = set()
            days += 1

        print(days)


if __name__ == '__main__':
    AtCoder().main()

Fixed submission:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        S = input().rstrip()
        T = input().rstrip()

        ans = 0
        for i, s in enumerate(S):
            if s == T[i]:
                ans += 1
        print(ans)


if __name__ == '__main__':
    AtCoder().main()
Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
A = [int(input()) for i in range(N)]

jumpIndex = -1

for i in range(N):
    if i < jumpIndex:
        A.remove(A[i])
        print(tmpMax)
        continue
    tmp = copy.copy(A)
    tmp.remove(A[i])
    tmpMax = max(tmp)
    for j in range(i + 1, N):
        if A[i] == tmpMax:
            jumpIndex = i
    print(tmpMax)

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]

maxNum = max(A)
index = -1
for i in range(N):
    if A[i] == maxNum:
        index = i

for i in range(N):
    if i != index:
        print(maxNum)
        continue
    else:
        A.remove(maxNum)
        print(max(A))

Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
A = [int(input()) for i in range(N)]

jumpIndex = -1

for i in range(N):
    if i < jumpIndex:
        print(tmpMax)
        continue
    tmp = copy.copy(A)
    tmp.remove(A[i])
    tmpMax = max(tmp)
    for j in range(i + 1, N):
        if A[i] == tmpMax:
            jumpIndex = i
    print(tmpMax)

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]

maxNum = max(A)
index = -1
for i in range(N):
    if A[i] == maxNum:
        index = i

for i in range(N):
    if i != index:
        print(maxNum)
        continue
    else:
        A.remove(maxNum)
        print(max(A))

Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
A = [int(input()) for i in range(N)]

jumpIndex = -1

for i in range(N):
    if i == jumpIndex - 1:
        print(tmpMax)
        continue
    tmp = copy.copy(A)
    tmp.remove(A[i])
    tmpMax = max(tmp)
    for j in range(i + 1, N):
        if A[i] == tmpMax:
            jumpIndex = i
    print(tmpMax)


Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]

maxNum = max(A)
index = -1
for i in range(N):
    if A[i] == maxNum:
        index = i

for i in range(N):
    if i != index:
        print(maxNum)
        continue
    else:
        A.remove(maxNum)
        print(max(A))

Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
A = [int(input()) for i in range(N)]

for i in range(N):
    tmp = copy.copy(A)
    tmp.remove(A[i])
    print(max(tmp))

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]

maxNum = max(A)
index = -1
for i in range(N):
    if A[i] == maxNum:
        index = i

for i in range(N):
    if i != index:
        print(maxNum)
        continue
    else:
        A.remove(maxNum)
        print(max(A))