Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n, m = readmi()
a = readl()
a.sort()
d = defaultdict(int)
for i in a:
    if d[i]:
        d[i] += 1
    else:
        d[i] = 1

for i in range(m):
    x, y = map(int, input().split())
    for j in sorted(d):
        if y > j:
            w = d[j]
            ww = x
            d[j] -= ww
            x -= w
            d[y] += min(ww, w)
            if d[j] <= 0:
                del d[j]
            if x <= 0:
                break
        else:
            break
count = 0
for i in d:
    count += max(int(d[i]) * int(i),0)
print(count)

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n, m = readmi()
a = readl()
d = defaultdict(int)
k = []
for i in a:
    heapq.heappush(k,(-i, 1))
for i in range(m):
    x, y = readmi()
    heapq.heappush(k,(-y, x))
count = 0
while(n > 0):
    x, y = heapq.heappop(k)
    count += min(y * (-x), n * (-x))
    n = max(n - y, 0)
print(count)
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
import sys
sys.setrecursionlimit(10**5)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

R, G, B, N = map(int, input().split())
count = 0
for i in range(1, N + 1):
    j i n range(1, N + 1):
        t = N - (i * R + G * j)
        if t < 0:
            break
        if t % B == 0:
            count += 1
print(count)

Fixed submission:
# coding: UTF-8
import sys
sys.setrecursionlimit(10**5)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

R, G, B, N = map(int, input().split())
count = 0
for i in range(N + 1):
    for j in range(N + 1):
        t = N - (i * R + G * j)
        if t < 0:
            break
        if t % B == 0:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
    # coding: UTF-8
    import sys
    #sys.setrecursionlimit(n)
    import heapq
    import re
    import bisect
    import random
    import math
    import itertools
    from collections import defaultdict, deque
    from copy import deepcopy
    from decimal import *
     
    n, q = map(int, input().split())
    s = list(input())
     
    ss = ""
    a = [0] * n
    b = [0] * n
    for i in range(n):
        if s[i] == "A":
            ss = s[i]
        elif s[i] == "C":
            ss += s[i]
        if ss == "AC":
            a[i] = a[i - 1] - 1
            b[i] += b[i - 1] + 1
            ss = ""
        else:
            if i > 0:
                a[i] = a[i - 1]
                b[i] = b[i - 1]
     
    for i in range(q):
        x, y = map(int, input().split())
        print(max(0, b[y - 1] + a[x - 1]))

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n, q = map(int, input().split())
s = list(input())

ss = ""
b = [0] * n
for i in range(n):
    if s[i] == "A":
        ss = s[i]
    elif s[i] == "C":
        ss += s[i]
    else:
        ss = ""
    if ss == "AC":
        b[i] += b[i - 1] + 1
        ss = ""
    else:
        if i > 0:
            b[i] = b[i - 1]
for i in range(q):
    x, y = map(int, input().split())
    print(b[y - 1] - b[x - 1])
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

a, b = map(int, input().split())
d = defaultdict(int)
array = []
for i in range(a):
    x, y = map(int, input().split())
    d[x] = y
    array.append(x)
array.sort()


count = 0
for i in array:
        break
    if b <= d[i]:
        count += min(b, 0) * i
        break
    else:
        t = d[i]
        b -= t
        count += t * i
print(count)

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

a, b = map(int, input().split())
d = []
for i in range(a):
    x, y = map(int, input().split())
    d.append((x, y))
d.sort()
count = 0
for i in range(a):
    if b <= d[i][1]:
        count += b * d[i][0]
        break
    else:
        b -= d[i][1]
        count += d[i][0] * d[i][1]
print(count)
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

def find(x):
    if node[x] < 0:
        return x
    else:
        node[x] = find(node[x])
        return node[x]

def unite(x, y):
    x = find(x)
    y = find(y)
    ret = False
    if x != y:
        ret = True
        if rank[x] > rank[y]:
            node[x] += node[y]
            node[y] = x
        else:
            node[y] += node[x]
            node[x] = y
            if rank[x] == rank[y]:
                rank[y] += 1
    return ret

def is_same(x, y):
    return find(x) == find(y)

def size(x):
    return -node[find(x)]

n, m = map(int,input().split())
node = [-1 for i in range(n + 1)]
rank = [0 for i in range(n + 1)]
e = [[int(i) for i in input().split()] for i in range(m)]
ans = deque()
num = int((n * (n - 1)) // 2)
s = 0
for i in e[::-1]:
    s1 = size(i[0])
    s2 = size(i[1])
    ans.appendleft(num)
    if unite(i[0], i[1]):
        num -= s1 * s2
for i in ans:
    print(i)


Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

a, b, c = map(int, input().split())

cnt = 0
for i in range(c):
    if b >= a:
        cnt += 1
        b -= a
    else:
        break
print(cnt)
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
 
n = int(input())
a = list(map(int, input().split()))
a = deque(sorted(a))
ans = 0
for i in a:
    ans = math.gcd(ans, i)
print(ans)

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import fractions
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
 
n = int(input())
a = list(map(int, input().split()))
a = deque(sorted(a))
ans = 0
for i in a:
    ans = fractions.gcd(ans, i)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

h, w, k = map(int, input().split())
memo = defaultdict(lambda:defaultdict(int))

def dfs(x, y):
    if y == h:
        if x == k - 1:
            return 1
        else:
            return 0
    if memo[x][y]:
        return memo[x][y]
#    if y in memo[x]:
#        return memo[x][y]

    ans = 0
    for i in range(1 << w - 1):
        flg = True
        for j in range(w - 2):
            if i & (1 << j) and i & (1 << j + 1):
                flg = False
                break
        if flg:
            nx = x
            if x > 0 and i & (1 << x - 1):
                nx = x - 1
            elif i & (1 << x):
                nx = x + 1
            ans += dfs(nx, y + 1)
            ans %= 1000000000 + 7
    memo[x][y] = ans
    return ans
print(dfs(0, 0))


Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

h, w, k = map(int, input().split())
memo = defaultdict(lambda:defaultdict(int))

def dfs(x, y):
    if y == h:
        if x == k - 1:
            return 1
        else:
            return 0
    if y in memo[x]:
        return memo[x][y]

    ans = 0
    for i in range(1 << w - 1):
        flg = True
        for j in range(w - 2):
            if i & (1 << j) and i & (1 << j + 1):
                flg = False
                break
        if flg:
            nx = x
            if x > 0 and i & (1 << x - 1):
                nx = x - 1
            elif i & (1 << x):
                nx = x + 1
            ans += dfs(nx, y + 1)
            ans %= 1000000000 + 7
    memo[x][y] = ans
    return ans
print(dfs(0, 0))
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
v = list(map(int, input().split()))
a = defaultdict(int)
b = defaultdict(int)

nn = n // 2
for i in range(nn):
    a[v[i * 2]] += 1
    b[v[i * 2 + 1]] += 1

ma1 = max(a, key=a.get)
mb1 = max(b, key=b.get)
mva1 = a[ma1]
mvb1 = b[mb1]
a[ma1] = 0
b[mb1] = 0
ma2 = max(a, key=a.get)
mb2 = max(b, key=b.get)
mva2 = a[ma2]
mvb2 = b[mb2]
a[ma2] = 0
b[mb2] = 0

ma = [(ma1, mva1), (ma2, mva2)]
mb = [(mb1, mvb1), (mb2, mvb2)]
mx = 0xFFFFFFFF
for i in ma:
    for j in mb:
        if i[0] == j[0]:
            pass
        else:
            mx = min(sum(a.values()) + i[1] + sum(b.values()) + j[1], mx)
if mx == 0xFFFFFFFF:
    print(0)
else:
    print(mx

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
a = list(map(int, input().split()))
even = defaultdict(int)
odd = defaultdict(int)
for i in range(n):
    if i % 2 == 0:
        even[a[i]] += 1
    else:
        odd[a[i]] += 1
x = sorted(even.items(), reverse=True, key=lambda t:t[1])
y = sorted(odd.items(), reverse=True, key=lambda t:t[1])
even_index = 0
odd_index = 0
if x[0][0] == y[0][0]:
    if x[0][1] > y[0][1]:
        even_index = 0
        odd_index = 1
    elif x[0][1] < y[0][1]:
        odd_index = 0
        even_index = 1
    else:
        if len(x) > 1:
            print(n - x[0][1] - max(x[1][1], y[1][1]))
        else:
            print(n // 2)
        exit()
            
else:
    even_index = 0
    odd_index = 0
print(n - x[even_index][1] - y[odd_index][1])
Buggy python submission (verdict: Time Limit Exceeded):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
count = 0
def prime_decomposition(n):
    i = 2
    table = []
    global count
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
            if i == 2:
                count += 1
        i += 1
    if n > 1:
        table.append(i)
        if i == 2:
            count += 1
    return table
readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
p = readl()

for i in p:
    prime_decomposition(i)
print(count)


Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
p = readl()
count = 0
for i in p:
    while(i % 2 == 0):
        i //= 2
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if abs(a-c) <= d or (abs(a-b) <= d && abs(b-c) <= d):
	print('Yes')
else:
	print('No')

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
    a, b, c, d = map(int, input().split())
    if abs(a-c) <= d or (abs(a-b) <= d && abs(b-c) <= d):
    	print('Yes')
    else:
       	print('No')

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = map(int, input().split())
m.sort(reverse=True)
a = 0
b = 0
t = True
for i in m:
  if t:
    a += i
  else:
    b += i
  t = True if t else False
print(a-b)

Fixed submission:
n = int(input())
m = list(map(int, input().split()))
m.sort(reverse=True)
a = 0
b = 0
t = True
for i in m:
  if t:
    a += i
  else:
    b += i
  t = True if not(t) else False
print(a-b)
Buggy python submission (verdict: Runtime Error):
read = lambda: sys.stdin.readline().rstrip()
s1 = read()
s2 = read()
if s1[0] == s2[2] and s1[1] == s2[1] and s1[2] == s2[0]:
  print("YES")
else:
  print("NO")

Fixed submission:
import sys
read = lambda: sys.stdin.readline().rstrip()
s1 = read()
s2 = read()
if s1[0] == s2[2] and s1[1] == s2[1] and s1[2] == s2[0]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
#sys.setrecursionlimit(n)
import heapq
from collections import defaultdict, deque
import itertools

import itertools
from heapq import heappop, heappush
N, M, R = map(int, input().split())

r = [int(i) for i in input().split()]
mp = defaultdict(lambda:defaultdict(list))
for _ in range(M):
    a, b, c= map(int, input().split())
    mp[a][b] = c
    mp[b][a] = c

v = [[float('inf')] * (N + 1) for _ in [0] * (N + 1)]
def dijkstra(start):
    q = []
    global v
    heapq.heappush(q, (0, start))
    vv = v[start]
    vv[start] = 0
    while(q):
        vc, vs = heapq.heappop(q)
        for i in mp[vs]:
            vsc = mp[vs][i]
            cost = vv[i]
            newcost = vsc + vc
            if cost > newcost:
                vv[i] = newcost
                heapq.heappush(q, (newcost, i))

ans = float('inf')
for i in range(N + 1):
    dijkstra(i)

ans = float('inf')
for i in itertools.permutations(r):
    t_ans = 0
    for j in range(R - 1):
        t_ans += v[i[j]][i[j + 1]]
    if ans > t_ans:
        ans = t_ans
print(ans)


Fixed submission:
import sys
#sys.setrecursionlimit(n)
import heapq
from collections import defaultdict, deque
import itertools

import itertools
from heapq import heappop, heappush
N, M, R = map(int, input().split())

r = [int(i) for i in input().split()]
mp = defaultdict(lambda:defaultdict(list))
for _ in range(M):
    a, b, c= map(int, input().split())
    mp[a][b] = c
    mp[b][a] = c

v = [[float('inf')] * (N + 1) for _ in [0] * (N + 1)]
def dijkstra(start):
    q = []
    global v
    heapq.heappush(q, (0, start))
    vv = v[start]
    vv[start] = 0
    while(q):
        vc, vs = heapq.heappop(q)
        for i in mp[vs]:
            vsc = mp[vs][i]
            cost = vv[i]
            newcost = vsc + vc
            if cost > newcost:
                vv[i] = newcost
                heapq.heappush(q, (newcost, i))

for i in r:
    dijkstra(i)

ans = float('inf')
for i in itertools.permutations(r):
    t_ans = 0
    for j in range(R - 1):
        t_ans += v[i[j]][i[j + 1]]
    if ans > t_ans:
        ans = t_ans
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k, = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)


Fixed submission:
k,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n-1):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)

Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)

Fixed submission:
k,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n-1):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)
Buggy python submission (verdict: Runtime Error):
N=input()

if N[-1]　==　"3":
	print("bon")
elif N[-1] in ["1","6","8"]:
	print("pon")
else:
	print("hon")

Fixed submission:
N=input()


if N[-1]=="3":
	print("bon")
elif N[-1] in ["0","1","6","8"]:
	print("pon")
else:
	print("hon")
Buggy python submission (verdict: Runtime Error):
if (A+B)%2==0:
	print((A+B)//2)
else:
	print("IMPOSSIBLE")

Fixed submission:
A,B,=map(int,input().split())


if (A+B)%2==0:
	print((A+B)//2)
else:
	print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n=input()


ans=""

if n[0]=="1":
ans=ans+"9"
else:
ans=ans+"1" 

if n[1]=="1":
ans=ans+"9"
else:
ans=ans+"1" 


if n[2]=="1":
ans=ans+"9"
else:
ans=ans+"1"


print(ans) 

Fixed submission:
n=input()


ans=""

if n[0]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[1]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[2]=="1":
	ans=ans+"9"
else:
	ans=ans+"1"


print(ans)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())

if N%K==0:
	print(0)
	else:
		print(1)

Fixed submission:
N,K=map(int,input().split())

if N%K==0:
	print(0)
else:
	print(1)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())

if N%K==0:
	print(0)
	elif N%K!=0:
		print(1)

Fixed submission:
N,K=map(int,input().split())

if N%K==0:
	print(0)
else:
	print(1)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())

if N%5==0:
	print(0)
	elif N%5!=0:
		print(1)

Fixed submission:
N,K=map(int,input().split())

if N%K==0:
	print(0)
else:
	print(1)
Buggy python submission (verdict: Runtime Error):
ans = "No"
for i in range(len(S)):
	if S[:i] + S[0:i] == T:
		ans = "Yes"

print(ans)

Fixed submission:
S=input()
T=input()

ans = "No"
for i in range(len(S)):
	if S[i:] + S[0:i] == T:
		ans = "Yes"

print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())

if =1<N<=999:
	print("ABC")
elif 999<N<=1998:
 	print("ABD")


Fixed submission:
N=int(input())

if 1<=N<=999:
	print("ABC")
elif 999<N<=1998:
 	print("ABD")
Buggy python submission (verdict: Runtime Error):
U=input()
M=input()
B=input()

print(U[0].M[1].B[2])

Fixed submission:

U=input()
M=input()
B=input()

print(U[0]+M[1]+B[2])

Buggy python submission (verdict: Runtime Error):
U=int(input())
M=int(input())
B=int(input())

print(U[0].M[1].B[2])

Fixed submission:

U=input()
M=input()
B=input()

print(U[0]+M[1]+B[2])

Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()

print(A[0].B[1].C[2])

Fixed submission:

U=input()
M=input()
B=input()

print(U[0]+M[1]+B[2])

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())

print(A[0].B[1].C[2])

Fixed submission:

U=input()
M=input()
B=input()

print(U[0]+M[1]+B[2])

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())

print(A[0],B[1],C[2])

Fixed submission:

U=input()
M=input()
B=input()

print(U[0]+M[1]+B[2])
Buggy python submission (verdict: Runtime Error):
D,T,S = map(int,input().split)

if D <= T*S:
    print("Yes")
else:
    print("No")

Fixed submission:
D,T,S = map(int,input().split())

if D <= T*S:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S=input()
if S[1]=="R":
  if S[2]=="R":
    if S[3]=="R":
      print(3)
    else:
      print(2)
  else:
    print(1)
elif S[2]=="R":
  if S[3]=="R":
    print(2)
  else:
    print(1)
elif S[3]=="R":
  print(1)
else:
  print(0)

Fixed submission:
S=input()
if S[1-1]=='R':
  if S[2-1]=='R':
    if S[3-1]=='R':
      print(3)
    else:
      print(2)
  else:
    print(1)
elif S[2-1]=='R':
  if S[3-1]=='R':
    print(2)
  else:
    print(1)
elif S[3-1]=='R':
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
AC=0
WA=0
TLE=0
RE=0
for i in range(0,N):
  j = str(input())
  if j = "AC":
    AC+=1
  elif j = "WA":
    WA+=1
  elif j = "TLE":
    TLE+=1
  else:
    RE+=1
print("AC x {}".format(AC))
print("WA x {}".format(WA))
print("TLE x {}".format(TLE))
print("RE x {}".format(RE))

Fixed submission:
N = int(input())
AC=0
WA=0
TLE=0
RE=0
for i in range(0,N):
  j = str(input())
  if j == "AC":
    AC+=1
  elif j == "WA":
    WA+=1
  elif j == "TLE":
    TLE+=1
  else:
    RE+=1
print("AC x {}".format(AC))
print("WA x {}".format(WA))
print("TLE x {}".format(TLE))
print("RE x {}".format(RE))
Buggy python submission (verdict: Runtime Error):
N = input()
f = N % 10
if(f==3):
  print("bon")
elif(f==0,1,6,8):
  print("pon")
else:
  print("hon")

Fixed submission:
N=int(input())
f = N % 10
if f==3:
  print("bon")
elif f==0 or f==1 or f==6 or f==8:
  print("pon")
else:
  print("hon")

Buggy python submission (verdict: Runtime Error):
N = input()
f = N % 10 
if (f==3):
  print("bon")
elif (f==0 || f==1 || f== 6 || f==8):
  print("pon")
else:
  print("hon")

Fixed submission:
N=int(input())
f = N % 10
if f==3:
  print("bon")
elif f==0 or f==1 or f==6 or f==8:
  print("pon")
else:
  print("hon")