Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
    # N, M = map(int, input().split())
    # PS = {}
    # for i in range(M):
    #     row = input().split()
    #     row[0] = int(row[0])
    #     if row[0] not in PS:
    #         PS[row[0]] = [row[1]]
    #     else:
    #         PS[row[0]].append(row[1])

    # n_correct = 0
    # n_penalty = 0
    # for p in PS:
    #     if 'AC' in PS[p]:
    #         n_correct += 1
    #         for result in PS[p]:
    #             if result == 'AC':
    #                 break
    #             if result == 'WA':
    #                 n_penalty += 1
    
    # print('{} {}'.format(n_correct, n_penalty))

    
    N, M = map(int, input().split())
    acc = [False] * (N+1)
    pen = [0] * (N+1)
    for _ in range(M):
        p, S = input().split()
        p = int(p)
        if S[0] == 'A':
            acc[p] = True
        else:
            pen[p] += 1
    pen = 0
    for i in range(1, N+1):
        if not acc[p]:
            pen += pen[p]
    print('{} {}'.format(sum(acc), pen))

    

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np

def main():
    N, M = map(int, input().split())
    PS = {}
    for i in range(M):
        row = input().split()
        row[0] = int(row[0])
        if row[0] not in PS:
            PS[row[0]] = [row[1]]
        else:
            PS[row[0]].append(row[1])

    n_correct = 0
    n_penalty = 0
    for p in PS:
        if 'AC' in PS[p]:
            n_correct += 1
            for result in PS[p]:
                if result == 'AC':
                    break
                if result == 'WA':
                    n_penalty += 1
    
    print('{} {}'.format(n_correct, n_penalty))
        


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
acc = [False] * N
pen = 0
for _ in range(M):
	p, S = input().split()
	p = int(p) - 1
	if S[0] == 'A':
		acc[p] = True
	else:
		if not acc[p]:
            pen += 1
print('{} {}'.format(sum(acc), pen))

Fixed submission:
import numpy as np

def main():
    N, M = map(int, input().split())
    PS = {}
    for i in range(M):
        row = input().split()
        row[0] = int(row[0])
        if row[0] not in PS:
            PS[row[0]] = [row[1]]
        else:
            PS[row[0]].append(row[1])

    n_correct = 0
    n_penalty = 0
    for p in PS:
        if 'AC' in PS[p]:
            n_correct += 1
            for result in PS[p]:
                if result == 'AC':
                    break
                if result == 'WA':
                    n_penalty += 1
    
    print('{} {}'.format(n_correct, n_penalty))
        


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
acc = [False] * N
pen = 0
for _ in range(M):
  p, S = input().split()
  p = int(p) - 1
  if S[0] == 'A':
    acc[p] = True
  else:
  	if not acc[p]:
      pen += 1
print('{} {}'.format(sum(acc), pen))


Fixed submission:
import numpy as np

def main():
    N, M = map(int, input().split())
    PS = {}
    for i in range(M):
        row = input().split()
        row[0] = int(row[0])
        if row[0] not in PS:
            PS[row[0]] = [row[1]]
        else:
            PS[row[0]].append(row[1])

    n_correct = 0
    n_penalty = 0
    for p in PS:
        if 'AC' in PS[p]:
            n_correct += 1
            for result in PS[p]:
                if result == 'AC':
                    break
                if result == 'WA':
                    n_penalty += 1
    
    print('{} {}'.format(n_correct, n_penalty))
        


if __name__ == '__main__':
    main()