Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02688 (python)

Fixed submission:
a,b = map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]

c = set()
e = set()
for i in range(1,len(aaa),2):
  for k in aaa[i]:
     c.add(k)
    
print(a - len(c))

Buggy submission (verdict: Runtime Error):
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i+1 for i in range(a)}

for i in range(1,a+1,2):
    for k in aaa[i]:
        for j in k:
            s.discard(j)
print(len(s))

Buggy submission (verdict: Runtime Error):
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i+1 for i in range(a)}


if(a == 0):
    print(0)
elif(b == 0):
    print(len(aaa))
else:
    for i in range(1,a+1,2):
        for k in aaa[i]:
            s.discard(k)
    print(len(s))

Buggy submission (verdict: Runtime Error):
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i + 1 for i in range(0,a)}

for i in range(1,a+1,2):
    for k in aaa[i]:
        s.discard(k)

print(len(s))

Buggy submission (verdict: Runtime Error):
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i for i in range(1,a+1)}

if a == 0:
    print(0)
    exit

if b == 0:
    print(len(aaa))
    exit
    

for i in range(1,a+1,2):
    for k in aaa[i]:
        s.discard(k)
 
print(len(s))

Buggy submission (verdict: Runtime Error):
import sys
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i for i in range(1,a+1)}

if a == 0:
    print(0)
    sys.exit

if b == 0:
    print(len(aaa))
    sys.exit
    

for i in range(1,a+1,2):
    for k in aaa[i]:
        s.discard(k)
 
print(len(s))

Buggy submission (verdict: Runtime Error):
import sys
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]
 
s = {i for i in range(1,a+1)}

if a == 0:
    print(0)
    sys.exit

if b == 0:
    [print(i) for i in aaa]
    sys.exit
    

for i in range(1,a+1,2):
    for k in aaa[i]:
        s.discard(k)
 
print(len(s))

Buggy submission (verdict: Runtime Error):
a ,b= map(int,input().split())
aaa = [list(map(int,input().split())) for i in range(b*2)]

s = {i for i in range(1,a+1)}

for i in range(1,a+1,2):
    for k in aaa[i]:
        s.discard(k)

print(len(s))
Problem p02693 (python)

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

ans = "NG"

for i in range(b,c+1):
    if i % a == 0:
        ans = "OK"

print(ans)

Buggy submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
 
ans = list()
for x in range(n+1):
    c = math.floor(a*x / b) - a * math.floor(x/b)
    ans.append(c)
 
print(max(ans))
Problem p02723 (python)

Fixed submission:
a = list(input())
 
if a[2] == a[3] and a[4] == a[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
count_list = [0]*n

cnt = 0
for i in range(1,n):
  for k in range(i+1,n+1):
    a0 = k-i
    a1 = abs(a-i)+ abs(b-k) + 1
    count_list[cnt] = min(a0,a1)
    #print(i,"@",k,"@",a0,"@",a1,"@",count_list,cnt)
    cnt += 1
    
    

for result in range(1,n+1):
  print(count_list.count(result))
Problem p03075 (python)

Fixed submission:
aaa = [int(input()) for i in range(6)]
 
ans = "Yay!"

j = aaa[4] - aaa[0]

if j > aaa[5]:
  ans = ":(" 

print(ans)

Buggy submission (verdict: Runtime Error):
aaa = [int(input(i)) for i in range(6)]

ans = "Yay!"

a = aaa[0]
for i in range(1,5):
	if aaa[5] >= a - aaa[i]:
    	ans = ":("
      	break
   
 print(ans)
Problem p02699 (python)

Fixed submission:
list = input().split()
s = list[0]
w = list[1]
ins = int(s)
inw = int(w)
if inw >= ins:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
list = input().split()
a = int(list[0])#体力
b = int(list[1]) #攻撃力
c = int(list[2])#体力
d = int(list[3])#攻撃力

#最初
while c>0 and a>0:
    c = c - b
    if c <= 0:
        print("Yes")
        break
    else:
        pass

    a = a -d
    if a<= 0:
        print("No")
        break
    else:
        pass
Problem p02771 (python)

Fixed submission:
aa=list(map(int,input().split()))
a=aa[0]
b=aa[1]
c=aa[2]
if a==b and a==c:
    print("No")
elif a==b:
    print("Yes")
elif a==c:
    print("Yes")
elif b==c:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
aa=list(map(int,input().split()))
a=a[0]
b=a[1]
c=a[2]
if a=b and a=c:
    print("No")
elif a=b:
    print("Yes")
elif a=c:
    print("Yes")
elif b=c:
    print("Yes")
else:
    print("No")
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
abc=[1,2,3]
abc.remove(a)
abc.remove(b)
print(abc[0])

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
abc=[1,2,3]
abc.pop(a)
abc.pop(b)
print(abc[0])
Problem p02771 (python)

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

if A==B!=C or A==C!=B or B==C!=A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

for i in a:
    if i % 2 ==0:
      if i %3 ==0 or i %5 ==0:
        continue
      else:
        print("DENIED")
        break
else:
  print("APPROVED")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

for i in a:
    if i % 2 ==0:
      if i %3 ==0 or i %5 ==0:
        continue
      else:
        print("DENIED")
        break
else:
  print("APPROVED")
Problem p02707 (python)

Fixed submission:
N = int(input())
A_i = list(map(int, input().split()))
C = [0] * N
for i in A_i:
    C[i - 1] += 1
print(*C)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_i = list(map(int, input().split()))
uq_A_i = list(set(A_i))
C = ["0\n"] * N
for i in uq_A_i:
    C[i - 1] = "{}".format(A_i.count(i) + "\n")
print("".join(C))
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split())
div=N//(A+B)
mod=N%(A+B)
print(div*A+min(mod,A))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
ans = 'b' * A + 'r' * B
ans *= N // (A + B)
print(ans.count('b'))
Problem p02773 (python)

Fixed submission:
N = int(input())
S_dic = {}
for i in range(N):
    S = input()
    if S in S_dic:
        S_dic[S] += 1
    else:
        S_dic[S] = 1
max_v = max(S_dic.values())
ans_list = [key for key, val in S_dic.items() if val == max_v]
ans_list.sort()
print("\n".join(ans_list))

Buggy submission (verdict: Runtime Error):
N = int(input())
S_list = []
for i in range(N):
    x = input()
    S_list.append(x)
another_list = [S_list[0]]
cnt_list = [1]
for i in range(1, N):
    for j in range(len(another_list)):
        if another_list[j] == S_list[i]:
            cnt_list[j] += 1
            break
    if j == len(another_list)-1:
        another_list.append(S_list[i])
        cnt_list.append(1)
max_v = max(cnt_list)
cnt = []
for i in range(len(cnt_list)):
    if max_v == cnt_list[i]:
        cnt.append(i)
cnt1 = []
for i in range(len(cnt)):
    cnt1.append(another_list[cnt[i]])
if len(cnt1) > 2:
    for _ in range(len(cnt1)-1):
        for i in range(len(cnt1)-1):
            tmp = "s"
            if ord(cnt1[i][0]) > ord(cnt1[i+1][0]):
                tmp = cnt1[i+1][0] 
                cnt1[i+1][0] = cnt1[i][0]
                cnt1[i][0] = tmp
print(cnt1)
Problem p02831 (python)

Fixed submission:
from fractions import gcd
def cal_lcm(a, b):
     return a * b / gcd(a, b)
A, B = map(int, input().split())
C = cal_lcm(A, B)
print(int(C))

Buggy submission (verdict: Runtime Error):
import math
def cal_lcm(a, b):
     return a * b / math.gcd(a, b)
A, B = map(int, input().split())
C = cal_lcm(A, B)
print(int(C))
Problem p02847 (python)

Fixed submission:
A = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
S = input()
cnt = 0
for i in range(7):
    if A[i] == S:
        break;
    cnt += 1
print(7 - cnt)

Buggy submission (verdict: Runtime Error):
def binary_search(A, B, X):
    intial_N = 0
    end_N = 10**20
    while (end_N - intial_N > 1):
        mid_N = round((intial_N + end_N) / 2)
        digits = len(str(mid_N))
        temp_value = A*mid_N + B*digits
        if (temp_value > X):
            end_N = mid_N
        elif (temp == X):
            return mid_N
        else:
            intial_N = mid_N 
    return intial_N
            
A, B, X = map(int, input().split())
int_N = binary_search(A, B, X)
print(int_N)
Problem p02916 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
cnt = 0
for i in range(N):
    cnt += B[A[i]-1]
    if i < N-1:
        if A[i]+1==A[i+1]:
            cnt += C[A[i]-1]
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
cnt = 0
for i in range(3):
    cnt += B[A[i]-1]
    if i < N-1:
        if A[i]+1==A[i+1]:
            cnt += C[A[i]-1]
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
cnt = 0
for i in range(3):
    cnt += B[A[i]-1]
    if i < 2:
        if A[i]+1==A[i+1]:
            cnt += C[A[i]-1]
print(cnt)
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())
h_list = []
min1 = 10**10
for i in range(N):
    h = int(input())
    h_list.append(h)
h_list = sorted(h_list, reverse = True)
for i in range(N-K+1):
    cnt = h_list[i]-h_list[i+K-1]
    min1 = min(min1, cnt)
print(min1)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h_list = []
for i in range(N):
    h = int(input())
    h_list.append(h)
h_list = sorted(h_list, reverse = True)
for i in range(N-K+1):
    cnt = h_list[i]-h_list[i+K-1]
    min1 = min(min1, cnt)
print(min1)
Problem p02862 (python)

Fixed submission:
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0

def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
fact = [1, 1]
for i in range(2,n+1):
    fact.append(fact[i-1] * i % MOD)
factX = fact[x]
factY = fact[y]
factN = fact[n]
# print(x,y,n)
# print(factX,factY,factN)

c = factN * modinv(factX, MOD) * modinv(factY, MOD)
c %= MOD
print(c)

Buggy submission (verdict: Runtime Error):
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0

def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
fact = [0, 1]
for i in range(2,n+1):
    fact.append(fact[i-1] * i % MOD)
factX = fact[x]
factY = fact[y]
factN = fact[n]

c = factN * modinv(factX, MOD) * modinv(factY, MOD)
c %= MOD
print(c)

Buggy submission (verdict: Runtime Error):
MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
fact = [0, 1]
for i in range(2,n+1):
    fact.append(fact[i-1] * i)
factX = fact[x]
factY = fact[y]
factN = fact[n]

inv_t = [0, 1]
for i in range(2,n+1):
    inv_t.append(inv_t[MOD % i] * (MOD - int(MOD / i)) % MOD)

c = factN * inv_t[factX] * inv_t[factY]
c %= MOD
print(c)

Buggy submission (verdict: Runtime Error):
import math
MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
factN = 1
for i in range(1,n+1):
    factN *= i
    if i == x: factX = factN
    if i == y: factY = factN
c = factN // factX // factY
print(c%MOD)

Buggy submission (verdict: Runtime Error):
import math
MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
c = math.factorial(x) // (math.factorial(x - y) * math.factorial(y))
print(c%MOD)

Buggy submission (verdict: Runtime Error):
import math
MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
c = math.factorial(x) // (math.factorial(x - y) * math.factorial(y))
print(c//MOD)

Buggy submission (verdict: Runtime Error):
import math
MOD = 10**9+7
x, y = map(int, input().split())
if (x+y)%3 != 0 or 3*x < x+y or 3*y < x+y:
    print(0)
    exit()
n = (x+y)//3
x -= n
y -= n
c = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(c//MOD)
Problem p02990 (python)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

MOD = 1000000007
n, k = map(int, input().split())
r = n-k

kk = []
rr = []
for i in range(k):
	kk.append(cmb(k-1,i)%MOD)

for i in range(r):
	rr.append(cmb(r-1,i)%MOD)
rr.append(0);rr.append(0);rr.append(0)

if r == 0:
	print(1)
	for i in range(k-1):
		print(0)
else:
	for i in range(k):
		if i <= r + 1:
			print((kk[i] * (rr[i-1] + rr[i]*2 + rr[i+1]))%MOD)
		else:
			print(0)

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

MOD = 1000000007
n, k = map(int, input().split())
r = n-k

kk = []
rr = []
for i in range(k):
	kk.append(cmb(k-1,i)%MOD)

for i in range(r):
	rr.append(cmb(r-1,i)%MOD)
rr.append(0);rr.append(0)

for i in range(k):
	if i <= r + 1:
		print(kk[i] * (rr[i-1] + rr[i]*2 + rr[i+1]))
	else:
		print(0)
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
if m > 0:
    a = [int(input()) for i in range(m)]
    interval_max = 0
    for i in range(len(a)-1):
        if a[i+1] - a[i] == 1:
            print(0)
            exit()
        interval_max = max(interval_max, a[i+1] - a[i])
else:
    a = []
    interval_max = n
a.insert(0, 0)
a.append(n)
for i in range(len(a)-1):
    interval_max = max(interval_max, a[i+1] - a[i])

fibb = [0]*(max(interval_max+2, 3))
fibb[0] = fibb[1] = fibb[2] = 1
for i in range(3,interval_max+2):
    fibb[i] = (fibb[i-2] + fibb[i-1]) % 1000000007
sum_step = 1
# print(a)
if m == 0:
    sum_step = fibb[n+1]
else:
    for i in range(len(a)-1):
        if i == 0 or i == len(a)-2:
            sum_step *= fibb[a[i+1] - a[i]]
            # print(fibb[a[i+1] - a[i]])
        else:
            sum_step *= fibb[a[i+1] - a[i] - 1]
            # print(fibb[a[i+1] - a[i]] - 1)
        sum_step = sum_step % 1000000007
print(sum_step)
# print(step)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
interval_max = 0
for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit()
    interval_max = max(interval_max, a[i+1] - a[i])
a.insert(0, 0)
a.append(n)
for i in range(len(a)-1):
    interval_max = max(interval_max, a[i+1] - a[i])

step = [0]*(interval_max+1)
step[0] = step[1] = step[2] = 1
for i in range(3,interval_max+1):
    step[i] = (step[i-2] + step[i-1]) % 1000000007
sum_step = 1
# print(a)
for i in range(len(a)-1):
    if i == 0 or i == len(a)-2:
        sum_step *= step[a[i+1] - a[i]]
        # print(step[a[i+1] - a[i]])
    else:
        sum_step *= step[a[i+1] - a[i] - 1]
        # print(step[a[i+1] - a[i]] - 1)
    sum_step = sum_step % 1000000007
print(sum_step)
# print(step)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
interval_max = 0
for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit()
    interval_max = max(interval_max, a[i+1] - a[i])
a.insert(0, 0)
a.append(n)
for i in range(len(a)-1):
    interval_max = max(interval_max, a[i+1] - a[i])

step = [0]*interval_max
step[0] = step[1] = 1
for i in range(2,interval_max):
    step[i] = (step[i-2] + step[i-1])
sum_step = 1
for i in range(len(a)-1):
    sum_step *= step[a[i+1] - a[i] - 1]
sum_step = sum_step % 1000000007
print(sum_step)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
interval_max = 0
for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit()
    interval_max = max(interval_max, a[i+1] - a[i])
a.insert(0, 0)
a.append(n)
for i in range(len(a)-1):
    interval_max = max(interval_max, a[i+1] - a[i])

step = [0]*interval_max
step[0] = step[1] = 1
for i in range(2,interval_max):
    step[i] = (step[i-2] + step[i-1])
print(a, interval_max)
sum_step = 1
for i in range(len(a)-1):
    sum_step *= step[a[i+1] - a[i] - 1]
sum_step = sum_step % 1000000007
print(sum_step)
Problem p03038 (python)

Fixed submission:
import sys
from operator import itemgetter
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

a.sort()
bc.sort(reverse = True, key=itemgetter(1))

a_i = 0
endloop = False
for i, item in enumerate(bc):
    if a_i >= n: break
    for i in range(item[0]):
        if a_i < n and a[a_i] < item[1]:
            a[a_i] = item[1]
            a_i += 1
        else:
            endloop = True
            break
    if endloop: break
print(sum(a))

Buggy submission (verdict: Runtime Error):
import sys
from operator import itemgetter
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

a.sort()
bc.sort(reverse = True, key=itemgetter(1))

a_i = 0
endloop = False
for i, item in enumerate(bc):
    if a_i >= n: break
    for i in range(item[0]):
        if a[a_i] < item[1]:
            a[a_i] = item[1]
            a_i += 1
        else:
            endloop = True
            break
    if endloop: break
print(sum(a))
Problem p02711 (python)

Fixed submission:

has_seven = False
N = str(input())
for i in range(len(N)):
  if N[i] == '7':
      has_seven = True
      break

if has_seven:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
 N = input()
total = 0
for i in range(N):
	if i % 3 != 0 and i % 5 != 0:
		total += i

print(total)

Buggy submission (verdict: Runtime Error):
 N = input()
total = 0
for i in range(N):
	if i % 3 != 0 and i % 5 != 0:
	total += i

print(total)

Buggy submission (verdict: Runtime Error):

has_seven = False
N = str(input())
for i in range(len(N)):
  	if N[i] == '7':
    	has_seven = True
    	break

if has_seven:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):

has_seven = False
N = str(raw_input())
for i in range(len(N)):
  	if N[i] == '7':
    	has_seven = True
    	break

if has_seven:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):

has_seven = False
N = str(raw_input())
for i in range(len(N)):
  	if N[i] == '7':
    	has_seven = True
    break

if has_seven:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):

has_seven = False
N = str(N)
for i in range(len(N)):
  	if N[i] == '7':
    	has_seven = True
    	break

if has_seven:
	print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
has_seven = False
for i in range(len(str(N))):
  if N[i] == '7':
    has_seven = True
    break
    
if has_seven:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
has_seven = False
for i in range(str(N)):
  if N[i] == '7':
    has_seven = True
    break
if has_seven:
  print("Yes")
else:
  print("No")
Problem p02707 (python)

Fixed submission:
n = int(input())
lst = list(map(int, input().split()))
dct = {i: 0 for i in range(n+1)}
for i in lst:
  dct[i] += 1

for i in range(1, n+1):
  print(dct[i])

Buggy submission (verdict: Runtime Error):
import 
n = int(input())
lst = list(map(int, input().split()))
dct = {i: 0 for i in range(n+1)}
for i in lst:
  dct[i] += 1

for i in range(2, n+1):
  print(dct[i])
Problem p02820 (python)

Fixed submission:
n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {"r":p, "s":r, "p":s}
t = list(input())
dp = [0]*n
for i in range(n):
  if i>=k and t[i]==t[i-k]:
    dp[i] = 0
    t[i] = "x"
  else:
    dp[i] = d[t[i]]
print(sum(dp))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, p, s = map(int, input().split())
d = {"r":s, "p":r, "s":p}
t = input()
dp = [0]*n
for i in range(n):
  if i<k and dp[i-k]==d[t[i]]:
    dp[i] = 0
  else:
    dp[i] = d[t[i]]
print(sum(lst))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, p, s = map(int, input().split())
d = {"r":s, "p":r, "s":p}
t = input()
dp = [0]*n
for i in range(n):
  if i>k and dp[i-k]==d[t[i]]:
    dp[i] = 0
  else:
    dp[i] = d[t[i]]
print(sum(lst))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
#r, s, p = map(int, input().split())
s, p, r = map(int, input().split())
t = input()
lst = []
arr = np.array(list(t.replace("r",f"{r} ".replace("p",f"{p} ").replace("s",f"{s} ").split())))
arr.reshape(k, n//k+bool(n%k)).T
print(arr)
for b in lst:
  tmp = ""
  for i in b:
    if i!=tmp:
      ans+=eval(i)
      tmp=i
print(ans)
Problem p02879 (python)

Fixed submission:
s = input()
if len(s) > 3:
  print(-1)
else:
  print(eval(s.replace(" ", "*")))

Buggy submission (verdict: Runtime Error):
f, s = input().split()
if f>9 and s>9:
  print(-1)
else:
  print(f*s)

Buggy submission (verdict: Runtime Error):
s = input()
if len(s)>3:
  print(-1)
else:
  print(eval(s.replce(" ", "*")))
Problem p02912 (python)

Fixed submission:
import heapq
n, m = map(int, input().split())
lst = list(map(lambda x:-1*int(x), input().split()))
heapq.heapify(lst)
for i in range(m):
  heapq.heappush(lst, -(-heapq.heappop(lst)//2))
print(-1*sum(lst))

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
 
int main(){
  ll n, m, sum=0;
  cin >> n >> m;
  vector<ll> lst(n);
  for(int i=0; i<n; i++) cin >> lst[i];
  for(int i=0; i<m; i++){
    for(int j=0; j<n; j++){
      if(lst[j]==*max_element(lst.begin(), lst.end()))
        lst[j] /= 2;
      	break;
    }
  }
  for(int i; i<n; i++)sum+=lst[i];
  cout << sum << endl;
}