Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

num = [i for i in range(1, N)]
print(sum(num))

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

# print(int(N*(N - 1)/2))
if N%2 == 0:
	print((ceil(N/2) - 1)*N + N//2)
else:
	print((ceil(N/2) - 1)*N)
Buggy python submission (verdict: Runtime Error):
ort sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
A, B = MAP()
 
if A >= 13:
  print(B)
  exit()
if A <= 5:
  print(0)
  exit()
print(B//2)

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
A, B = MAP()
 
if A >= 13:
  print(B)
  exit()
if A <= 5:
  print(0)
  exit()
print(B//2)
Buggy python submission (verdict: Runtime Error):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
S = input()

if S[K - 1] == "A":
  S[K - 1] = "a"
if S[K - 1] == "B":
  S[K - 1] = "b"
if S[K - 1] == "C":
  S[K - 1] = "c"

print(S)

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N, K = MAP()
S = input()
 
if S[K - 1] == "A":
  S = S[0:K - 1] + "a" + S[K:]
if S[K - 1] == "B":
  S = S[0:K - 1] + "b" + S[K:]
if S[K - 1] == "C":
  S = S[0:K - 1] + "c" + S[K:]

print(S)
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, Q = MAP()
S = input()
L = [LIST() for _ in range(Q)]

for i in range(Q):
	a = S[L[i][0] - 1:L[i][1]]
	a_s = a.replace("AC", "#")
	print(len(a) - len(a_s))

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, Q = MAP()
S = input()
L = [LIST() for _ in range(Q)]

a = [0]*len(S)
for i in range(1, len(S)):
	if (S[i-1]=="A") and (S[i]=="C"):
		a[i] = a[i-1] + 1
	else:
		a[i] = a[i-1]

for i in range(Q):
	print(a[L[i][1] - 1] - a[L[i][0] - 1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
path = [LIST() for _ in range(M)]

# graph = [[] for _ in range(N)]

# for a, b in path:
# 	graph[a - 1].append(b - 1)
# 	graph[b - 1].append(a - 1)

# print(graph)

# for i in range(len(graph[0])):
# 	if graph[graph[0][i]][len(graph[graph[0][i]]) - 1] == N - 1:
# 		print("POSSIBLE")
# 		exit()

# print("IMPOSSIBLE")

graph = [[0]*N for _ in range(N)]

for i in range(M):
	graph[path[i][0] - 1][path[i][1] - 1] = 1
	graph[path[i][1] - 1][path[i][0] - 1] = 1

for i in range(N):
	if graph[0][i] == 1:
		if graph[i][N - 1] == 1:
			print("POSSIBLE")
			exit()

print("IMPOSSIBLE")

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
path = [LIST() for _ in range(M)]

graph = [[] for _ in range(N)]

for a, b in path:
	graph[a - 1].append(b - 1)
	graph[b - 1].append(a - 1)

for i in range(len(graph[0])):
	a = sorted(graph[graph[0][i]])
	if a[len(a) - 1] == N - 1:
		print("POSSIBLE")
		exit()

print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n = int(input())
X = list(map(int, input().split()))
x_min = min(X)
x_max = max(X)

min_val = 10**6 + 1

for i in range(x_min, x_max + 1):
    min_val = min(min_val, sum(map(lambda x: (x-i)**2, X)))

print(min_val)

Fixed submission:
N, R = list(map(int, input().split()))
print(R if N >= 10 else R + 100*(10-N))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3]
import sys
sys.setrecursionlimit(2000)

N = int(input())
syogen = []
for i in range(N):
    N_a = int(input())
    syogen_a = []
    for _ in range(N_a):
        x, y = input().split()
        syogen_a.append([int(x) - 1, int(y)])
    syogen.append(syogen_a)


def syojiki(i):
    for x, y in syogen[i]:
        if y == 1:
            syojiki_list.append(x)
            if len(syojiki_list) >= N:
                return
            syojiki(x)


def check_syojiki(syojikitati):
    d = {}
    for s in range(N):
        if not (s in syojikitati):
            d[s] = 0

    for s in syojikitati:
        d[s] = 1
        for x, y in syogen[s]:
            if d[x] != y:
                return False
            else:
                d[x] = y
    return True


max_syojiki = 0

for i in range(2 ** N):
    d = {}
    syojiki_list = []
    for j in range(N):
        if (i >> j) & 1:
            syojiki_list.append(j)
            syojiki(j)
    syojiki_list = list(set(syojiki_list))
    if check_syojiki(syojiki_list):
        max_syojiki = max(max_syojiki, len(syojiki_list))

print(max_syojiki)


Fixed submission:
#!/usr/bin/env python3]
import sys
sys.setrecursionlimit(2000)

N = int(input())
syogen = []
for i in range(N):
    N_a = int(input())
    syogen_a = []
    for _ in range(N_a):
        x, y = input().split()
        syogen_a.append([int(x) - 1, int(y)])
    syogen.append(syogen_a)


def syojiki(i):
    for x, y in syogen[i]:
        if y == 1:
            syojiki_list.append(x)
            if len(syojiki_list) >= N:
                return
            syojiki(x)


def check_syojiki(syojikitati):
    d = {}
    for s in range(N):
        if s in syojikitati:
            d[s] = 1
        else:
            d[s] = 0

    for s in syojikitati:
        d[s] = 1
        for x, y in syogen[s]:
            if d[x] != y:
                return False
    return True


max_syojiki = 0

for i in range(2 ** N):
    d = {}
    syojiki_list = []
    for j in range(N):
        if (i >> j) & 1:
            syojiki_list.append(j)
            syojiki(j)
    syojiki_list = list(set(syojiki_list))
    if check_syojiki(syojiki_list):
        max_syojiki = max(max_syojiki, len(syojiki_list))

print(max_syojiki)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math

A, B, X = [int(s) for s in input().split()]
right = 10 ** 9
left = 1

if A + B > X:
    print(0)
    exit()

if A * right + B * 10 <= X:
    print(right)
    exit()

while (left < right):
    middle = (left + right) // 2 + 1
    if A * middle + B * int((math.log(middle * 10, 10))) < X:
        left = middle 
    else:
        right = middle - 1

print(right)

Fixed submission:
week = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
S = input()

print(6 - week.index(S)) if week.index(S) != 6 else print(7)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
N = int(input())
L = sorted([int(s) for s in input().split()])

MAX_SEARCH = max(L) + 1


def check_search(middle, idx_short2, l_lng, l_lows):
    return l_lows[middle] + l_lows[idx_short2] > l_lng


l_lows = L[:2]
triangles = 0


for l_lng in L[2:]:
    for idx, l_low in enumerate(l_lows):
        left = 0
        right = len(l_lows) - 1 - idx
        end = right
        while (left < right):
            middle = (left + right) // 2
            if check_search(middle, len(l_lows) - 1 - idx, l_lng, l_lows):
                right = middle
            else:
                left = middle + 1
        triangles += (end - right)
    l_lows.append(l_lng)

print(triangles)


Fixed submission:
#!/usr/bin/env python3
N = int(input())
L = sorted([int(s) for s in input().split()])


def check_search(middle, idx_short2, l_lng, l_lows):
    return l_lows[middle] + l_lows[idx_short2] > l_lng


l_lows = L[:2]
triangles = 0


for l_lng in L[2:]:
    for idx, l_low in enumerate(l_lows):
        left = 0
        right = len(l_lows) - 1 - idx
        end = right
        while (left < right):
            middle = (left + right) // 2
            if check_search(middle, len(l_lows) - 1 - idx, l_lng, l_lows):
                right = middle
            else:
                left = middle + 1
        triangles += (end - right)
    l_lows.append(l_lng)

print(triangles)
Buggy python submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Fixed submission:
S = input()
if S[0] == 'S':
    print('Cloudy')
elif S[0] == 'C':
    print('Rainy')
else:
    print('Sunny')

Buggy python submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Fixed submission:
S = input()
if S[0] == 'S':
    print('Cloudy')
elif S[0] == 'C':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Fixed submission:
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(Q):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Buggy python submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + A) > 0 else 'No')

Fixed submission:
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(Q):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list(map(lambda x: -1 * x, A))
for i in range(M):
    heapq.heapify(hpq)
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print(sum(map(lambda x: int(-1 * x), hpq)))

Fixed submission:
import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list(map(lambda x: -1 * x, A))
heapq.heapify(hpq)
for i in range(M):
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print(sum(map(lambda x: int(-1 * x), hpq)))

Buggy python submission (verdict: Runtime Error):
import heapq

N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]

hpq = list(map(lambda x: -1 * x, A))
for i in range(M):
    heapq.heapify(hpq)
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

sum(map(lambda x: int(-1 * x), hpq)


Fixed submission:
import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list(map(lambda x: -1 * x, A))
heapq.heapify(hpq)
for i in range(M):
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print(sum(map(lambda x: int(-1 * x), hpq)))

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

N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]

hpq = list(map(lambda x: -1 * x, A))
for i in range(M):
    heapq.heapify(hpq)
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print(sum(map(lambda x: int(-1 * x), hpq)))

Fixed submission:
import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list(map(lambda x: -1 * x, A))
heapq.heapify(hpq)
for i in range(M):
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print(sum(map(lambda x: int(-1 * x), hpq)))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
N = int(input())
print(sum([i for i in range(N)]))


Fixed submission:
#!/usr/bin/env python3
N = int(input())
print(int(N*(N-1))//2)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
N = int(s)
odd_num = 0
for i in range(1,N+1):
    cnt = 1
    while i // 10 >= 0:
        cnt += 1
        i //= 10
    if cnt % 2:
        odd_num += 1
print(odd_num)

Fixed submission:
s = input()
N = int(s)
odd_num = 0
for i in range(1,N+1):
    cnt = 1
    num = i
    while (num // 10) > 0:
        cnt += 1
        num = num//10
    if cnt % 2:
        odd_num += 1
print(odd_num)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p_list = [int(s) for s in input.split()]
 
cnt = 0
 
for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]:
  	cnt += 1
 
  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]:
  	cnt += 1
    
print(cnt)

Fixed submission:
N = int(input())

p_list = [int(s) for s in input().split()]

cnt = 0

for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]:
  	cnt += 1

  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]:
  	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
p_list = [int(s) for s in input.split()]

cnt = 0

for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]
  	cnt += 1

  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]
  	cnt += 1
    
print(cnt)

Fixed submission:
N = int(input())

p_list = [int(s) for s in input().split()]

cnt = 0

for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]:
  	cnt += 1

  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]:
  	cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
MOD = 10**9 + 7
 
N,K = [int(s) for s in input().split()]
 
comb = [[1]]
for i in range(N + 1):
    comb.append([1])
    for j in range(i):
        comb[-1].append((comb[-2][j] + comb[-2][j + 1]))
    comb[-1].append(1)
 
 
for i in range(1,K+1):
  print(comb[N-i+1][i] * comb[K-1][i]) if i != K else print(comb[N-i+1][i])

Fixed submission:
MOD = 10**9 + 7
 
N,K = [int(s) for s in input().split()]
 
comb = [[1]]
for i in range(N + 1):
    comb.append([1])
    for j in range(i):
        comb[-1].append((comb[-2][j] + comb[-2][j + 1]) % MOD)
    comb[-1].append(1)
    
def combi(n,k):
  return comb[n][k] if n >= k else 1

for i in range(1,K+1):
  if i <= N-K+1:
    print((combi(N-K+1,i) * combi(K-1,i-1)) % MOD)
  else:
    print(0)

Buggy python submission (verdict: Runtime Error):
MOD = 10**9 + 7

N,K = [int(s) for s in input().split()]

comb = [[1]]
for i in range(N + 1):
    comb.append([1])
    for j in range(i):
        comb[-1].append((comb[-2][j] + comb[-2][j + 1]))
    comb[-1].append(1)


for i in range(1,K+1):
	print(comb[N-i+1][k] * comb[K-1][i])



Fixed submission:
MOD = 10**9 + 7
 
N,K = [int(s) for s in input().split()]
 
comb = [[1]]
for i in range(N + 1):
    comb.append([1])
    for j in range(i):
        comb[-1].append((comb[-2][j] + comb[-2][j + 1]) % MOD)
    comb[-1].append(1)
    
def combi(n,k):
  return comb[n][k] if n >= k else 1

for i in range(1,K+1):
  if i <= N-K+1:
    print((combi(N-K+1,i) * combi(K-1,i-1)) % MOD)
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
A,B,C = [int(s) for s in input().split()]

print(C) if B B//A >= C else print(B//A)

Fixed submission:
A,B,C = [int(s) for s in input().split()]
 
print(C) if B//A >= C else print(B//A)
Buggy python submission (verdict: Runtime Error):
import math
import collections

def gcd(x,y)
	if y==0: return x
  return gcd(y,x%y)

gc_value = gcd(A,B)
N = gc_value

# N : 素因数分解
prime_factor = []
for i in range(2,int(math.sqrt(N))+1):
  while N%i == 0:
    prime_factor.append(i)
    N/=i
    
if N > 1:
  prime_factor.append(N)
  
for i in range(K-1):
  gc_value/=prime_factor[i]

print(int(gc_value))  
  


Fixed submission:
import sys

A,B,K = [int(s) for s in input().split()]

cnt = 0

N = min(A,B) 

for i in range(N,0,-1):
  if A % i == 0 and B % i == 0:
    cnt += 1
  if cnt == K:
    print(i)
    sys.exit()
Buggy python submission (verdict: Runtime Error):
def LI():
	return [ int(s) for s in input().split() ]

A = LI()

A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[3]-A[1])

print(min(A12+A23,A23+A31,A31+A12))



Fixed submission:
def LI():
	return [ int(s) for s in input().split() ]
 
A = LI()
 
A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[2]-A[0])
 
print(min(A12+A23,A23+A31,A31+A12))
Buggy python submission (verdict: Runtime Error):
print(sum([a-1 int(s) for s in input().split()])

Fixed submission:
N = input()

print(sum([int(s)-1 for s in input().split()]))
Buggy python submission (verdict: Runtime Error):
D,N = [int(s) for s in input().split()]
print (100 ** D) * N

Fixed submission:
def LI():
	return [ int(s) for s in input().split() ]
  
D,N = LI()
 
print((100**D) * N) if N != 100 else print((100**D)*(N+1))
Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

M = int(input())
T = [input() for _ in range(M)]

s_counter = Counter(S)
t_counter = Counter(T)

result = 0

for k, v in s_counter:
    result = max(result, v - (t_counter[k] if t_counter[k] else 0))

print(result)


Fixed submission:
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

M = int(input())
T = [input() for _ in range(M)]

s_counter = Counter(S)
t_counter = Counter(T)

result = 0

for k, v in s_counter.items():
    result = max(result, v - (t_counter[k] if t_counter[k] else 0))

print(result if result > 0 else 0)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100)

n = input()
k = int(input())
m = {}


def doit(n, k):
    if len(n) == 0:
        return k == 0
    d = int(n[0])
    if (n, k) not in m:
        ret = 0
        for i in range(d + 1):
            if i == d:
                ret += doit(n[1:], k - 1 if i > 0 else k)
            else:
                ret += doit('9' * (len(n) - 1), k - 1 if i > 0 else k)
        m[(n, k)] = ret
    return m[(n, k)]


print(doit(n, k))


Fixed submission:
import sys
sys.setrecursionlimit(10000)

n = input()
k = int(input())
m = {}


def doit(n, k):
    if len(n) == 0:
        return k == 0
    d = int(n[0])
    if (n, k) not in m:
        ret = 0
        for i in range(d + 1):
            if i == d:
                ret += doit(n[1:], k - 1 if i > 0 else k)
            else:
                ret += doit('9' * (len(n) - 1), k - 1 if i > 0 else k)
        m[(n, k)] = ret
    return m[(n, k)]


print(doit(n, k))