Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ai = [int(x) for x in input().split()]
bn = [0] * n
cn = [0] * n

for i in range(0,n):
    j = n - 1 - i
    if (n//(j+1)<1):
        bn[j] = ai[j]
    else:
        bn[j] = (cn[j] + ai[j]) % 2

    if bn[j] == 1 and not(n//(j+1) < 1):
        for k in range(0,((j+1)//2)+1):
            if (j+1)%(k+1) == 0:
                cn[k] += 1

m = sum(bn)
print(m)
for i in range(0,n):
    if bn[i] == 1:
        print(i+1, end=" ")



Fixed submission:
n = int(input())
ai = [int(x) for x in input().split()]
bn = [0] * n

for i in range(0,n):
    j = n - 1 - i
    c = 0
    for k in range(2, n+1):
        idx = k * (j + 1) - 1
        if  idx > n-1:
            break
        c += bn[idx]
    
    bn[j] = (c + ai[j]) % 2


m = sum(bn)
print(m)
for i in range(0,n):
    if bn[i] == 1:
        print(i+1, end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ai = [int(x) for x in input().split()]
bn = [0] * n
cn = [0] * n
dn = [0] * n

for i in range(0,n):
    j = n - 1 - i
    if (n//(j+1)<1):
        bn[j] = ai[j]
    else:
        bn[j] = (cn[j] + ai[j]) % 2

    if bn[j] == 1:
        for k in range(0,((j+1)//2)+1):
            if (j+1)%(k+1) == 0:
                cn[k] += 1

m = sum(bn)
print(m)
for i in range(0,n):
    if bn[i] == 1:
        print(i+1, end=" ")


Fixed submission:
n = int(input())
ai = [int(x) for x in input().split()]
bn = [0] * n

for i in range(0,n):
    j = n - 1 - i
    c = 0
    for k in range(2, n+1):
        idx = k * (j + 1) - 1
        if  idx > n-1:
            break
        c += bn[idx]
    
    bn[j] = (c + ai[j]) % 2


m = sum(bn)
print(m)
for i in range(0,n):
    if bn[i] == 1:
        print(i+1, end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ai = [int(x) for x in input().split()]
bn = [0] * n
cn = [0] * n
dn = [0] * n

for i in range(0,n):
    j = n - 1 - i
    if (n//(j+1)<1):
        bn[j] = ai[j]
    else:
        bn[j] = (cn[j] + ai[j]) % 2

    if bn[j] == 1:
        for k in range(0,j):
            if (j+1)%(k+1) == 0:
                cn[k] += 1

m = sum(bn)
print(m)
for i in range(0,n):
    if bn[i] == 1:
        print(i+1, end=" ")


Fixed submission:
n = int(input())
ai = [int(x) for x in input().split()]
bn = [0] * n

for i in range(0,n):
    j = n - 1 - i
    c = 0
    for k in range(2, n+1):
        idx = k * (j + 1) - 1
        if  idx > n-1:
            break
        c += bn[idx]
    
    bn[j] = (c + ai[j]) % 2


m = sum(bn)
print(m)
for i in range(0,n):
    if bn[i] == 1:
        print(i+1, end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
alphas = [chr(i).lower() for i in range(65, 65+26)]

n = int(input())

same_count = 0
sorted_list = []
for index in range(n):
  s = input()
  sorted_s = ''.join(sorted(s))
  same_count += sorted_list.count(sorted_s)

  sorted_list.append(sorted_s)
print(same_count)

Fixed submission:
import math

n = int(input())

setmap = dict()
for index in range(n):
  s = input()
  sorted_s = ''.join(sorted(s))
  if setmap.get(sorted_s) is not None:
    setmap[sorted_s] = setmap[sorted_s] + 1
  else:
    setmap[sorted_s] = 1

same_count = 0
for val in setmap.values():
  if val != 1:
    same_count += int(math.factorial(val) / (2 *  math.factorial(val - 2)))
print(same_count)
Buggy python submission (verdict: Runtime Error):
    X, A = map(int, input().split())
    if  X >= A:
        print(10)
    else:
        print(0)

Fixed submission:
X, A = map(int, input().split())
if  X >= A:
    print(10)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
def prison():
    N, M = (int(i) for i in input().split())
    L_max = 0
    R_min = float("inf")
    for _ in range(M):
        L, R = (int(i) for i in input().split())
        L_max = max(L, L_max)
        R_min = min(R, R_min)
	result = max(R_min - L_max + 1, 0)
    return result


print(prison())

Fixed submission:
def prison():
    N, M = (int(i) for i in input().split())
    L_max = 0
    R_min = float("inf")
    for _ in range(M):
        L, R = (int(i) for i in input().split())
        L_max = max(L, L_max)
        R_min = min(R, R_min)
        result = max(R_min - L_max + 1, 0)
    return result


print(prison())

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


def prison():
    N, M = (int(_) for _ in input().split())
    id_l = set(range(1, N+1))
    for _ in range(M):
        L, R = (int(_) for _ in input().split())
        id_l = id_l & set(range(L, R+1))
    return len(id_l)


print(prison())

Fixed submission:
def prison():
    N, M = (int(i) for i in input().split())
    L_max = 0
    R_min = float("inf")
    for _ in range(M):
        L, R = (int(i) for i in input().split())
        L_max = max(L, L_max)
        R_min = min(R, R_min)
        result = max(R_min - L_max + 1, 0)
    return result


print(prison())

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
def prison():
    N, M = map(int, input().split())
    id_l = set(range(1, N+1))
    for _ in range(M):
        L, R = map(int, input().split())
        id_l = id_l & set(range(L, R+1))
    return len(id_l)


print(prison())

Fixed submission:
def prison():
    N, M = (int(i) for i in input().split())
    L_max = 0
    R_min = float("inf")
    for _ in range(M):
        L, R = (int(i) for i in input().split())
        L_max = max(L, L_max)
        R_min = min(R, R_min)
        result = max(R_min - L_max + 1, 0)
    return result


print(prison())

Buggy python submission (verdict: Time Limit Exceeded):
def prison():
    N, M = map(int, input().split())
    id_l = set(range(1, N+1))
    for _ in range(M):
            L, R = map(int, input().split())
            id_l = id_l & set(range(L, R+1))
    return len(id_l)

print(prison())

Fixed submission:
def prison():
    N, M = (int(i) for i in input().split())
    L_max = 0
    R_min = float("inf")
    for _ in range(M):
        L, R = (int(i) for i in input().split())
        L_max = max(L, L_max)
        R_min = min(R, R_min)
        result = max(R_min - L_max + 1, 0)
    return result


print(prison())
Buggy python submission (verdict: Runtime Error):
#A
N, K = map(int, input().split())
S = input()
print(S.replace(S[K],S[K].lower()))

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:N])
Buggy python submission (verdict: Runtime Error):
#DivRem number
N  = int(input())
ans = 0
def divisor(N):
    div_lst = [N]
    for n in range(2, int(N ** 0.5 + 1)):
        if N % n == 0:
            if  n == int(N / n):
                div_lst.append(n)
            else:
                div_lst.append(n)
                div_lst.append(int(N / n))

    return div_lst

div_lst = divisor(N)
for m in div_lst:
    m = m - 1
    if int(N / m) == N % m:
        ans += m
print(ans)
        

Fixed submission:
#DivRem number
N  = int(input())
ans = 0
def divisor(N):
    div_lst = [N] if N != 1 else []
    for n in range(2, int(N ** 0.5 + 1)):
        if N % n == 0:
            if  n == N // n:
                div_lst.append(n)
            else:
                div_lst.append(n)
                div_lst.append(N // n)

    return div_lst

div_lst = divisor(N)
for m in div_lst:
    m = m - 1
    if N // m == N % m:
        ans += m
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#DivRem number
N  = int(input())
ans = 0
for m in range(1, N):
    if int(N / m) == N % m:
        ans += m
print(ans)

Fixed submission:
#DivRem number
N  = int(input())
ans = 0
def divisor(N):
    div_lst = [N] if N != 1 else []
    for n in range(2, int(N ** 0.5 + 1)):
        if N % n == 0:
            if  n == N // n:
                div_lst.append(n)
            else:
                div_lst.append(n)
                div_lst.append(N // n)

    return div_lst

div_lst = divisor(N)
for m in div_lst:
    m = m - 1
    if N // m == N % m:
        ans += m
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#Knapsack1
N, W = map(int, input().split())
weight = []
value = []
# N,W =3, 8
# wv_lst = [list(map(int, input().split())) for _ in range(N)]
for i in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)
# weight = [3, 4, 5]
# value = [30, 50, 60]

dp = [[0] * (W+1) for _ in range(N+1)]

for n in range(1, N+1):
    weigh = weight[n-1]
    val = value[n-1]
    for w in range(W+1):
        if w < weigh:
            dp[n][w] = dp[n-1][w]
        else:
            dp[n][w] = max(dp[n-1][w], 
                        dp[n-1][w-weigh] + val)
        
# print([dp[i] for i in range(N+1)])
print(dp[-1][-1])
        



Fixed submission:
#Knapsack1
N, W = map(int, input().split())
weight = []
value = []
# N,W =3, 8
# wv_lst = [list(map(int, input().split())) for _ in range(N)]
for i in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)
# weight = [3, 4, 5]
# value = [30, 50, 60]

dp = [[0] * (W+1) for _ in range(N+1)]

for n in range(1, N+1):
    weigh = weight[n-1]
    val = value[n-1]
    for w in range(W+1):
        if w < weigh:
            dp[n][w] = dp[n-1][w]
        else:
            dp[n][w] = max(dp[n-1][w], 
                        dp[n-1][w-weigh] + val)
        
# print([dp[i] for i in range(N+1)])
print(dp[-1][-1])
Buggy python submission (verdict: Runtime Error):

N=int(input())
S=list(input())
change_min=N
for leader in range(N):
    S_west=S[:leader]
    S_east=S[leader+1:N]
    change=S_west.count("W")+S_east.count("E")
    if change<=change_min:
        change_min=change
print(change_min)
        

Fixed submission:
a,b=map(int, input().split())
ab_sum=a+b
ab_dif=a-b
ab_pro=a*b
ab_max=max(ab_sum,ab_dif,ab_pro)
print(ab_max)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
S_list=list(S)
S_max=0
for n in range(N):
    S_list_former=set(S_list[:n])
    S_list_latter=set(S_list[n:N])
    S_list_com=len(S_list_former & S_list_latter)
    if S_list_com>=S_max:
        S_max=S_list_com
print(S_max)

Fixed submission:
a,b=map(int, input().split())
ab_sum=a+b
ab_dif=a-b
ab_pro=a*b
ab_max=max(ab_sum,ab_dif,ab_pro)
print(ab_max)
Buggy python submission (verdict: Time Limit Exceeded):
"""
AtCoder
    :author: vierbein
"""
from __future__ import absolute_import, division, print_function

# import itertools as it
import collections
import sys

BIGINT = int(1e9) + 7

def pp(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

S = input().strip()

slots = [0] * 13
slots[0] = 1

for p, c in enumerate(reversed(S)):
    xx = pow(10, p, 13)
    new_slots = [0] * 13
    if c == "?":
        for i in range(10):
            for k in range(13):
                idx = (i * xx + k) % 13
                new_slots[idx] = (new_slots[idx] + slots[k]) % BIGINT
    else:
        n = int(c)
        for k in range(13):
            new_slots[(n * xx + k) % 13] = slots[k]
    slots = new_slots

print(slots[5])

Fixed submission:
"""
AtCoder
    :author: vierbein
"""
from __future__ import absolute_import, division, print_function

# import itertools as it
import collections
import sys

BIGINT = int(1e9) + 7

def pp(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

S = input().strip()

slots = [0] * 13
slots[0] = 1

for p, c in enumerate(reversed(S)):
    xx = pow(10, p, 13)
    new_slots = [0] * 13
    if c == "?":
        for i in range(10):
            for k in range(13):
                idx = (i * xx + k) % 13
                new_slots[idx] = (new_slots[idx] + slots[k]) % BIGINT
    else:
        n = int(c)
        for k in range(13):
            new_slots[(n * xx + k) % 13] = slots[k]
    slots = new_slots

print(slots[5])
Buggy python submission (verdict: Time Limit Exceeded):
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_d

D - Knapsack 1
"""
INF = 100000007


def solve(wv_pairs):
    dp = [0] * (W + 1)
    for i in range(N):
        w_i, v_i = wv_pairs[i]
        for ww in range(W, w_i - 1, -1):
            dp[ww] = max(dp[ww], dp[ww - w_i] + v_i)
    return max(dp[ww] for ww in range(W + 1))


N, W = map(int, input().split())
pairs = [[int(s) for s in input().split()] for _ in range(N)]
res = solve(pairs)
print(res)


Fixed submission:
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_d

D - Knapsack 1
"""

def solve(wv_pairs):
    dp = [0] * (W + 1)
    for i in range(N):
        w_i, v_i = wv_pairs[i]
        for ww in range(W, w_i - 1, -1):
            dp[ww] = max(dp[ww], dp[ww - w_i] + v_i)
    return max(dp)


N, W = map(int, input().split())
pairs = [[int(s) for s in input().split()] for _ in range(N)]
res = solve(pairs)
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_d

D - Knapsack 1
"""
INF = 100000007
import collections

def solve(wv_pairs):
    ws, vs = zip(*wv_pairs)
    dp = collections.defaultdict(lambda: -INF)
    dp[(-1, 0)] = 0
    for i in range(N):
        for ww in range(W + 1):
            dp[(i, ww)] = max(
                dp[(i - 1, ww)],
                dp[(i - 1, ww - ws[i])] + vs[i]
            )
    return max(dp[(N - 1, ww)] for ww in range(W + 1))

N, W = map(int, input().split())
pairs = [[int(s) for s in input().split()] for _ in range(N)]
res = solve(pairs)
print(res)


Fixed submission:
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_d

D - Knapsack 1
"""

def solve(wv_pairs):
    dp = [0] * (W + 1)
    for i in range(N):
        w_i, v_i = wv_pairs[i]
        for ww in range(W, w_i - 1, -1):
            dp[ww] = max(dp[ww], dp[ww - w_i] + v_i)
    return max(dp)


N, W = map(int, input().split())
pairs = [[int(s) for s in input().split()] for _ in range(N)]
res = solve(pairs)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_i

I - Coins

"""
import collections


def solve(ps):
    dp = collections.defaultdict(float)
    dp[0] = 1.0
    for p_i in ps:
        for head_count in reversed(range(N + 1)):
            dp[head_count] = p_i * dp[head_count - 1] + (1 - p_i) * dp[head_count]

    more_than_half = (N + 2) // 2
    res = sum(dp[head_count] for head_count in range(more_than_half, N + 1))
    return res
 

N = int(input())
ps = [float(s) for s in input().split()]
res = solve(ps)
print(res)


Fixed submission:
"""
AtCoder Educational DP Contest
https://atcoder.jp/contests/dp/tasks/dp_i

I - Coins

"""
import collections


def solve(ps):
    dp = collections.defaultdict(float)
    dp[0] = 1.0
    for p_i in ps:
        for head_count in reversed(range(N + 1)):
            dp[head_count] = p_i * dp[head_count - 1] + (1 - p_i) * dp[head_count]

    more_than_half = (N + 2) // 2
    res = sum(dp[head_count] for head_count in range(more_than_half, N + 1))
    return res
 

N = int(input())
ps = [float(s) for s in input().split()]
res = solve(ps)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc103/tasks/abc103_d
import sys

def solve():
    pairs.sort(key=lambda pair: pair[1])
    done = set()
    cnt = 0
    i = 0
    while i < m:
        if i in done:
            i += 1
            continue
        _, b0 = pairs[i]
        cnt += 1
        done.add(i)
        for j, (a, _) in enumerate(pairs[i+1:], start=(i+1)):
            if a < b0:
                done.add(j)
    return cnt

n, m = map(int, input().split())
pairs = [tuple(int(c) for c in input().split()) for _ in range(m)]
print(n, pairs, file=sys.stderr)
print(solve())

Fixed submission:
# https://atcoder.jp/contests/abc103/tasks/abc103_d
import sys

def solve():
    pairs.sort(key=lambda pair: pair[1])
    cnt = 0
    base = 0
    for (a, b) in pairs:
        if a >= base:
            cnt += 1
            base = b
    return cnt

n, m = map(int, input().split())
pairs = [tuple(int(c) for c in input().split()) for _ in range(m)]
print(n, pairs, file=sys.stderr)
print(solve())

Buggy python submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc103/tasks/abc103_d

def solve(n, pairs):
    pairs.sort(key=lambda pair: pair[1])
    cnt = 0
    while pairs:
        _, b0 = pairs[0]
        cnt += 1
        for (a, b) in pairs:
            if a < b0:
                pairs.remove((a, b))
    return cnt

n, m = map(int, input().split())
pairs = [[int(c) for c in input().split()] for _ in range(m)]
print(solve(n, pairs))

Fixed submission:
# https://atcoder.jp/contests/abc103/tasks/abc103_d
import sys

def solve():
    pairs.sort(key=lambda pair: pair[1])
    cnt = 0
    base = 0
    for (a, b) in pairs:
        if a >= base:
            cnt += 1
            base = b
    return cnt

n, m = map(int, input().split())
pairs = [tuple(int(c) for c in input().split()) for _ in range(m)]
print(n, pairs, file=sys.stderr)
print(solve())
Buggy python submission (verdict: Runtime Error):
import numpy as np
h, w = list(map(int, input().split()))
loc_array = [list(input().replace("#", "1").replace(".", "0")) for _ in range(h)]
loc_array = np.array([list(map(int, l)) for l in loc_array])
row_sum = loc_array.sum(axis=1)
col_sum = loc_array.sum(axis=0)
while 0 in row_sum or 0 in col_sum:
  for i, r in enumerate(row_sum):
    if r == 0:
      loc_array = np.delete(loc_array, i, axis=0)
  for i, c in enumerate(col_sum):
    if c == 0:
      loc_array = np.delete(loc_array, i, axis=1)
  row_sum = loc_array.sum(axis=1)
  col_sum = loc_array.sum(axis=0)

loc_str = [list(map(str, loc_array[i,:])) for i in range(loc_array.shape[0])]
loc_str = ["".join(l).replace("1", "#").replace("0", ".") for l in loc_str]
for l in loc_str:
  print(l)


Fixed submission:
import numpy as np
h, w = list(map(int, input().split()))
loc_array = [list(input().replace("#", "1").replace(".", "0")) for _ in range(h)]
loc_array = np.array([list(map(int, l)) for l in loc_array])
row_sum = loc_array.sum(axis=1)
col_sum = loc_array.sum(axis=0)
while 0 in row_sum or 0 in col_sum:
  row_rm = [i for i, r in enumerate(row_sum) if r == 0]
  loc_array = np.delete(loc_array, row_rm, axis=0)
  col_rm = [i for i, c in enumerate(col_sum) if c == 0]
  loc_array = np.delete(loc_array, col_rm, axis=1)
  row_sum = loc_array.sum(axis=1)
  col_sum = loc_array.sum(axis=0)

loc_str = [list(map(str, loc_array[i,:])) for i in range(loc_array.shape[0])]
loc_str = ["".join(l).replace("1", "#").replace("0", ".") for l in loc_str]
for l in loc_str:
  print(l)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [''.join(sorted(input())) for _ in range(0, N)]
d = {}

for s in S:
    if s[0] in d.keys():
        d[s[0]].append(s)
    else:
        d[s[0]] = [s]

result = 0

for k in d.values():
    if len(k) > 1:
        for i, s in enumerate(k):
            for j in range(i + 1, len(k)):
                if s == k[j]:
                    result += 1

print(result)

Fixed submission:
N = int(input())
S = [''.join(sorted(input())) for _ in range(0, N)]
d = {}
result = 0
for s in S:
    if s in d.keys():
        result += d[s]
        d[s] += 1
    else:
        d[s] = 1
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [''.join(sorted(input())) for _ in range(0, N)]
result = 0
for i, s in enumerate(S):
    for j in range(i + 1, len(S)):
        if s == S[j]:
            result += 1
print(result)

Fixed submission:
N = int(input())
S = [''.join(sorted(input())) for _ in range(0, N)]
d = {}
result = 0
for s in S:
    if s in d.keys():
        result += d[s]
        d[s] += 1
    else:
        d[s] = 1
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
S = [collections.Counter(list(input())) for _ in range(0, N)]
result = 0
for i, s in enumerate(S):
    for j in range(i + 1, len(S)):
        if s == S[j]:
            result += 1
print(result)


Fixed submission:
N = int(input())
S = [''.join(sorted(input())) for _ in range(0, N)]
d = {}
result = 0
for s in S:
    if s in d.keys():
        result += d[s]
        d[s] += 1
    else:
        d[s] = 1
print(result)
Buggy python submission (verdict: Runtime Error):
import math

A, B, C, D = (int(i) for i in input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


one_to_b = B - ((B // C) + (B // D) - (B // lcm(C, D)))
one_to_a = A - 1 - ((((A - 1) // C) +
                     ((A - 1) // D) -
                     (A - 1) // lcm(C, D)))

print(one_to_b - one_to_a)


Fixed submission:
import fractions

A, B, C, D = (int(i) for i in input().split())


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


one_to_b = B - ((B // C) + (B // D) - (B // lcm(C, D)))
one_to_a = A - 1 - ((((A - 1) // C) +
                     ((A - 1) // D) -
                     (A - 1) // lcm(C, D)))

print(one_to_b - one_to_a)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
W = []
for _ in range(N):
    n = input()
    if n in W:
        W.remove(n)
    else:
        W.append(n)
print(len(W))


Fixed submission:
import collections

N = int(input())
W = [int(input()) for _ in range(N)]
c = collections.Counter(W)
print(len([i for i in c.values() if i % 2 != 0]))
Buggy python submission (verdict: Runtime Error):
def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()

# start

n = int_single()

r = 0
for i in range(1, n):
    if (len(str(i)) % 2 == 1):
        res += 1

print(res)


Fixed submission:
def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()

# start

n = int_single()

r = 0
for i in range(1, n+1):
    if (len(str(i)) % 2 == 1):
        r += 1

print(r)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
li = []
ans = 0
N = int(input())
for i in range(N):
    x = Counter(input())
    for j in li:
        if x == j:
            ans += 1
    li.append(x)

print(ans)


Fixed submission:
dic = {}
ans = 0
N = int(input())
for i in range(N):
    x = sorted(input())
    x = "".join(x)
    if x in dic:
        dic[x] += 1
    else:
        dic[x] = 1

for i in dic:
    x = dic[i]
    if x > 1:
        ans += x*(x-1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())

if A < C and C < B:
    print("Yes")
elif: B < C and C < A
    print("Yes")
else:
    print("No")


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

if A < C and C < B:
    print("Yes")
elif B < C and C < A:
    print("Yes")
else:
    print("No")