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

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

print(S[: K-1] + S[K - 1].lower() + S[K :])

Buggy submission (verdict: Runtime Error):
s = input()
YYMM, MMYY, ova = False, False, False

if(1 <= int(s[:2]) <= 12):
    MMYY = True
if(1 <= int(s[3:]) <= 12):
    YYMM = True

if(MMYY and YYMM):
    ova = True

if(ova):
    print('AMBIGUOUS')
elif(MMYY):
    print("MMYY")
elif(YYMM):
    print('YYMM')
else:
    print('NA')
Problem p03272 (python)

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

print(N-i +1)

Buggy submission (verdict: Runtime Error):
プ
 問題
 質問
 提出
 提出一覧
 順位表
 コードテスト
 解説
提出 #5696340

ソースコード 

Copy
Copy
# 入力
H,W=map(int,input().split())
 
l=[]
for i in range(H):
  x=input()
  # 白いマスのみからなる場合は追加しない
  if x!='.'*W:
    l.append(x)
 
rm=[]
for i in range(W):
  # フラグ
  f=True
  for j in range(len(l)):
    if l[j][i]=='#':
      f=False
 
  # 取り除く列の添字を保存しておく
  if f:
    rm.append(i)
 
a=[]
for x in l:
  for i in rm[::-1]:
    x=x[:i]+x[i+1:]
  a.append(''.join(x))
 
# 出力
for i in range(len(a)):
  print(''.join(a[i]))
Problem p02682 (python)

Fixed submission:
li = list(map(int, input().split()))
a, b, c, k = li[0], li[1], li[2], li[3]

if a >= k:
  print(1*k)
elif (a+b) >= k:
  print(1*a)
else:
  ans = (1*a) - (k-(a+b))
  print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, k = input().split()

if a >= k:
  print(1*k)
elif (a+b) > k:
  print(1*a)
else:
  ans = (1*a) - (k-(a-b))
  print(ans)
Problem p03208 (python)

Fixed submission:
import collections

n,k = input().split()
n = int(n)
k = int(k)
h =[]
for i in range(n):
    h.append(int(input()))

h.sort(reverse=True)
# c = collections.Counter(h)
# flg = False
# for i in c:
#     if c[i] >= k:
#         print(0)
#         flg = True
#         break

diff=[]
for i in range(0,n-k+1):
    diff.append(abs(h[i] - h[i+k-1]))
print(min(diff))

Buggy submission (verdict: Runtime Error):
import collections

n,k = input().split()
n = int(n)
k = int(k)
h =[]
for i in range(n):
    h.append(int(input()))

h = h.sort(reverse=True)
c = collections.Counter(h)
flg = False
for i in c:
    if c[i] >= 3:
        print(0)
        flg = True
        break

diff=[]
for i in range(0,n-k+1,k):
    diff.append(abs(h[i] - h[i+k-1]))
print(min(diff))

Buggy submission (verdict: Runtime Error):
import collections

n,k = input().split()
n = int(n)
k = int(k)
h =[]
for i in range(n):
    h.append(int(input()))

h = sorted(h)
c = collections.Counter(h)
flg = False
for i in c:
    if c[i] >= 3:
        print(0)
        flg = True
        break

if flg == False:
    print(abs(h[n] - h[n-k]))
Problem p02699 (python)

Fixed submission:
X,Y = map(int,input().split())

if X > Y:
  print('safe')
else:
  print('unsafe')

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())

X = A // D
Y = C // B

if A % D > 0:
  X += 1

if C % B > 0:
  Y += 1

if Y > X:
  print('No')
else :
  print('Yes')
Problem p02711 (python)

Fixed submission:
import sys
input = sys.stdin.readline

A = int(input())
      
B = A // 10
C = B // 10
 
if A % 10 == 7:
  print ("Yes")
elif B % 10 == 7:
  print ("Yes")
elif C % 10 == 7:
  print ("Yes")
else:
  print ("No")

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

  if A % 10 == 7:
   print ("Yes")

elif B % 10 == 7:
     print ("Yes")
  
elif C % 10 == 7:
  print ("Yes")
else:
  print ("No")
Problem p02785 (python)

Fixed submission:
kazu1 = list(map(int, input().split()))
kazu2 = list(map(int, input().split()))
n = 0
kazu2.sort(reverse=True)

kazu2[:kazu1[1]] = [0]

n += sum(kazu2)

print(n)

Buggy submission (verdict: Runtime Error):
kazu1 = list(map(int, input().split()))
kazu2 = list(map(int, input().split()))
n = 0
kazu2.sort(reverse=True)

kazu2[0:kazu1[1]-1] = 0

n += sum(kazu2)

print(n)
Problem p02860 (python)

Fixed submission:
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:int(total/2)] == s[int(total/2):]):
    print("Yes")
  else:
      print("No")

Buggy submission (verdict: Runtime Error):
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:total/2] is s[total/2:]):
    print("Yes")
  else:
      print("No")

Buggy submission (verdict: Runtime Error):
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:total/2]==s[total/2:]):
    print("Yes")
  else:
      print("No")

Buggy submission (verdict: Runtime Error):
total = int(input())
s = input()

if total%2 == 1:
  print("No")
else:
	if(s[:total/2]==s[total/2:]):
		print("Yes")
	else:
		print("No")
Problem p02689 (python)

Fixed submission:
N, M = map(int, input().split()) 
H = list(map(int, input().split())) 

G = [[] for j in range(N)]
for i in range(M):
    a, b = map(int, input().split()) 
    G[a - 1].append(H[b - 1])
    G[b - 1].append(H[a - 1])

ans = 0
for i, g in enumerate(G):
    if not g:
        ans += 1
        continue
    if H[i] > max(g):
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split()) 
H = list(map(int, input().split())) 

A=[0 for i in range(N)]
B=[0 for i in range(N)]
for i in range(M):
    A[i],B[i]=map(int,input().split())
    A[i] -= 1
    B[i] -= 1

ans = 0
idx = 0
while idx < N:
    i = 0
    cnt = 0
    while i < M:
        if A[i] == idx:
            if H[idx] <= H[B[i]]:
                cnt += 1
                break
        if B[i] == idx:
            if H[idx] <= H[A[i]]:
                cnt += 1
                break
        i += 1
    
    if i == M:
        ans += 1
    elif i == M and cnt == 0:
        ans += 1
    
    idx += 1

print(ans)
Problem p02729 (python)

Fixed submission:
e,o = map(int,input().split())
cte = (e*(e-1))//2
cto = (o*(o-1))//2
print(cte+cto)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
e,o = map(int,input().split())

base1 = comb(e, 2, exact=True)
base2 = comb(o, 2, exact=True)

print(base1+base2)
Problem p02711 (python)

Fixed submission:
n = input()
if '7' in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = input()
if 7 in n:
    print('Yes')
else:
    print('No')
Problem p02712 (python)

Fixed submission:
x = 0
n = int(input())
for i in range(1,n+1):
    if i % 3 != 0 and i % 5 != 0:
        x += i
print(x)

Buggy submission (verdict: Runtime Error):
x = 0
n = input(input())
for i in range(1,n+1):
    if i % 3 != 0 and i % 5 != 0:
        x += i
print(x)
Problem p02771 (python)

Fixed submission:
s = list(map(int,input().split()))
n = list(set(s))
if len(n) == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    sc = s.count(i)
    if sc > x:
        ans = [i]
        x = sc
    elif sc == x:
        ans.append(i)
for i in sorted(ans):
    print(i)
Problem p02754 (python)

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

    ao_count = 0

    count_num = N // (A + B)
    amari_num = N % (A + B)



    ao_count = count_num * A

    if A <= amari_num:
        ao_count += A
    else:
        ao_count += amari_num

    print(ao_count)



if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
6 2 4
Problem p02777 (python)

Fixed submission:
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(str(A) + " " + str(B))
 
if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input().split()
 
    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(A + " " + B)
 
if __name__ == "__main__":
    resolve()
Problem p02831 (python)

Fixed submission:
import math

def resolve():
    A, B = map(int, input().split())

    answer = least_common_multiple(A, B)    
    print(answer)

def least_common_multiple(a, b):
    if b > a:
        a, b = b, a
    
    ab = a*b

    while (a%b) != 0:
        a, b = b, a%b

    return int(ab/b)

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
import math

def resolve():
    A, B = map(int, input().split())

    answer = least_common_multiple(A, B)    
    print(answer)

def least_common_multiple(a, b):
    if b > a:
        a, b = b, a
    
    ab = a*b

    while (a%b) != 0
        a, b = b, a%b

    return int(ab/b)

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
import math

def resolve():
    A, B = [int(i) for i in input().split()]

    answer = least_common_multiple(A, B)
    #answer = greatest_common_divisor(A, B)

    print(answer)
    

def trial_division(n):
    prime_factors = []
    if n <= 2:
        prime_factors.append(1)
        if n != 1:
            prime_factors.append(n)
        return prime_factors
    for i in range(1, math.ceil(int(n/2))):
        if (n%i) == 0:
            prime_factors.append(i)
    prime_factors.append(n)
    return prime_factors

def greatest_common_divisor(a, b):
    a_list = trial_division(a)
    b_list = trial_division(b)
        a_b_and_list = set(a_list) & set(b_list)
    gcd = 1
    if a_b_and_list:
        for i in a_b_and_list:
            gcd = gcd * i
    return gcd

# using Euclidean algorithm
def least_common_multiple(a, b):
    gcd = greatest_common_divisor(a, b)
    lcm = int((a*b) / gcd)
    return lcm

if __name__ == "__main__":
    resolve()
Problem p02881 (python)

Fixed submission:
import sys
import math

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))

    solve(N)

def solve(N: int):
    # Symmetry, a<=b, a<=math.sqrt(N)
    N_max = min(N, 1000000000000)
    a_max = int(math.sqrt(N_max))
    tmp_list = []
    for a in range(1, a_max+1):
        if N%a == 0:
            b = int(N/a)
            tmp_list.append((a, b))

    if tmp_list:
        answer = tmp_list[0][0] + tmp_list[0][1]

    for i_tp in tmp_list:
        tmp = i_tp[0] + i_tp[1]

        if tmp < answer:
            answer = tmp

    print(answer - 2)
    return

 
if __name__ == "__main__":
    propare()

Buggy submission (verdict: Runtime Error):
import sys
import math

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))

    solve(N)

def solve(N: int):
    # Symmetry, a<=b, a<=math.sqrt(N)
    N_max = min(N, 1000000000000)
    a_max = int(math.sqrt(N_max))
    tmp_list = []
    for a in range(1, a_max):
        if N%a == 0:
            b = int(N/a)
            tmp_list.append((a, b))

    if tmp_list:
        answer = tmp_list[0][0] + tmp_list[0][1]

    for i_tp in tmp_list:
        tmp = i_tp[0] + i_tp[1]

        if tmp < answer:
            answer = tmp

    print(answer - 2)
    return

 
if __name__ == "__main__":
    propare()

Buggy submission (verdict: Runtime Error):
import sys

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))

    solve(N)

def solve(N: int):
    N_max = min(N, 1000000000000)
    tmp_list = []
    for i in range(1, N_max):
        for j in range(1, N_max):
            if i*j == N:
                tmp_list.append((i, j))

    if tmp_list:
        answer = tmp_list[0][0] + tmp_list[0][1]

    for i_tp in tmp_list:
        tmp = i_tp[0] + i_tp[1]

        if tmp < answer:
            answer = tmp

    print(answer - 2)
    return

 
if __name__ == "__main__":
    propare()
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split(' '))
blue = a * int(n / (a + b))
if a <= n % (a + b):
    print(blue + a)
else:
    print(blue + n % (a + b))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split(' '))
str = ('b' * a + 'r' * b) * -(-n // (a + b))
print(str[0:n].count('b'))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split(' '))
l = []
while len(l) < n:
    l += list(('b' * a) + ('r' * b))
print(l[0:n].count('b'))
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    x = max(a, b)
    y = min(a, b)

    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        return z


A, B = map(int, input().split())
print(int(A * B/gcd(A, B)))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())
print(int(A * B / math.gcd(A, B)))
Problem p02989 (python)

Fixed submission:

def count_ABC_num(D, thr):
    return len([_ for _ in D if _ < thr])

N = int(input())
D = list(map(int, input().split()))

D.sort()
cent_index = int(len(D)/2)

print(D[cent_index] - D[cent_index - 1])

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

def count_ABC_num(D, thr):
    return len([_ for _ in D if _ < thr])


N = int(input())
D = list(map(int, input().split()))

D = np.sort(np.array(D))
cent_index = int(len(D)/2)

print(len([threshold for threshold in range(D[cent_index - 1], D[cent_index + 1] + 1) if count_ABC_num(D, threshold) == cent_index]))
Problem p03631 (python)

Fixed submission:
a,b,c=input()
print("Yes" if a==c else "No")

Buggy submission (verdict: Runtime Error):
a,b,c = input()
print("Yes" if a == c else: "No")

Buggy submission (verdict: Runtime Error):
a,b,c = input()
print("Yes" if a == c else: "No")

Buggy submission (verdict: Runtime Error):
a,b,c = input()
print('Yes' if a == c else: 'No')

Buggy submission (verdict: Runtime Error):
a,b,c = input()
print('Yes' if a == c:else: 'No')
Problem p02925 (python)

Fixed submission:
from collections import deque
 
N = int(input())
Ass = tuple(deque(map(int, input().split())) for _ in range(N))
 
dp = [0 for _ in range(N)]
Q = set(range(N))
ans = -1
while Q:
    ans += 1
    Q2 = Q.copy()
    Q.clear()
    for i in Q2:
        if not Ass[i]:
            continue
        t = Ass[i][0] - 1
        if not Ass[t]:
            continue
        if Ass[t][0] == i + 1:
            Q.add(i)
            Q.add(t)
    for i in Q:
        Ass[i].popleft()

if any(Ass):
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

N = int(input())
Ass = deque(deque(map(int, input().split())) for _ in range(N))

dp = [0 for _ in range(N)]
index = [0 for _ in range(N)]
flag = True
while flag:
    flag = False
    for i, As in enumerate(Ass):
        if not As:
            continue
        t = As[index[i]] - 1
        if Ass[t][index[t]] == i + 1:
            index[t] += 1
            index[i] += 1
            dp[t] = dp[i] = max(dp[t], dp[i]) + 1
            flag = True
if any(Ass):
    print(-1)
else:
    print(max(dp))
Problem p02990 (python)

Fixed submission:
from operator import mul
from functools import reduce
from functools import lru_cache

@lru_cache(maxsize=1000)
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

N, K = map(int, input().split())
R = N - K

print(R + 1)
for i in range(2, K + 1):
    if R + 1 < i:
        print(0)
        continue
    tmp = cmb(R + 1, i)
    tmp2 = cmb(K - 1, K - i)
    print((tmp % (10**9 + 7) * tmp2 % (10**9 + 7)) % (10**9 + 7))

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


N, K = map(int, input().split())
R = N - K

print(R + 1)
for i in range(2, K + 1):
    tmp = cmb(R + 1, i)
    tmp2 = cmb(K - 1, K - i)
    print((tmp % (10**9 + 7) * tmp2 % (10**9 + 7)) % (10**9 + 7))
Problem p03038 (python)

Fixed submission:
from operator import itemgetter

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = []
for _ in range(M):
    BC.append(tuple(map(int, input().split())))

A.sort(reverse=True)
BC.sort(key=itemgetter(1), reverse=True)

n = 0
ans = 0
while True:
    if not BC:
        ans += sum(A[: N - n])
        break
    tgt = BC[0][1]
    a = A[0]
    if a >= tgt:
        ans += A.pop(0)
        n += 1
        if n == N:
            break
    else:
        tgt_n = BC[0][0]
        if n + tgt_n < N:
            ans += tgt * tgt_n
            n += tgt_n
            _ = BC.pop(0)
        else:
            ans += tgt * (N - n)
            break

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
for _ in range(M):
    b, c = map(int, input().split())
    A += [c] * b

A.sort()
print(sum(A[-N]))
Problem p02773 (python)

Fixed submission:
import collections

N = int(input())
SSS = []

for i in range(N):
  SSS.append(input())
#print(N, SSS)

#print(collections.Counter(SSS).most_common())
hindo_ck = collections.Counter(SSS).most_common()

i = 1
hindo_max = list(hindo_ck[0])

if len(hindo_ck) > 1:
  del hindo_max[-1]
  while i < N and hindo_ck[i-1][1] == hindo_ck[i][1]:
    hindo_max.append(hindo_ck[i][0])
    i += 1
  hindo_max.sort()
  
  for h in hindo_max:
    print(h)
  
else:
  hindo_max = hindo_ck[0][0]
  print(hindo_max)
#print(result)

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
SSS = []

for i in range(N):
  SSS.append(input())
#print(N, SSS)

#print(collections.Counter(SSS).most_common())
hindo_ck = collections.Counter(SSS).most_common()

i = 1
hindo_max = list(hindo_ck[0])

if len(hindo_ck) > 1:
  del hindo_max[-1]
  while hindo_ck[i-1][1] == hindo_ck[i][1] and i < N:
    hindo_max.append(hindo_ck[i][0])
    i += 1
  hindo_max.sort()
  
  for h in hindo_max:
    print(h)
  
else:
  hindo_max = hindo_ck[0][0]
  print(hindo_max)
#print(result)
Problem p02682 (python)

Fixed submission:
import sys

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

sums = 0

if (k <= a):
    print(k)
    sys.exit()
else:
    sums += a
    k -= a

if (k <= b):
    print(sums)
    sys.exit()
else:
    k -= b

sums += -1 * k
print(sums)

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())

sums = 0

alist = [1] * a
blist = [0] * b
clist = [-1] * c

ll = alist + blist + clist

print(sum(ll[0:k]))
Problem p02695 (python)

Fixed submission:
import itertools
N, M, Q = map(int,input().split())
P = [list(map(int,input().split())) for i in range(Q)]

A = list(itertools.combinations_with_replacement(range(1,M+1), N))
number = len(A)

amount = 0
max_amount = 0
for i in range(number): #A
    
    for j in range(Q): # P
        bi = P[j][1]
        ai = P[j][0]
        if(A[i][bi-1] - A[i][ai-1] == P[j][2]):
            amount += P[j][3]
        
   # print(amount)
    
   # print(amount)
    if(amount >= max_amount):
        max_amount = amount
    
    amount = 0
    
print(max_amount)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
N, M, Q = map(int,input().split())
P = [list(map(int,input().split())) for i in range(Q)]

A = list(itertools.combinations_with_replacement(range(1,M+1), N))
number = len(A)

amount = 0
max_amount = 0
for i in range(number): #A
    
    for j in range(Q): # P
        bi = P[j][1]
        ai = P[j][0]
        if(A[i][bi-1] - A[i][ai-1] == P[j][2]):
            amount += P[j][3]
        
   # print(amount)
    
   # print(amount)
    if(amount >= max_amount):
        max_amount = amount
    
    amount = 0
    
print(max_amount)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
N, M, Q = map(int,input().split())
P = [list(map(int,input().split())) for i in range(Q)]

A = list(itertools.combinations(range(1,M+1), N))
number = len(A)

amount = 0
max_amount = 0
for i in range(number): # 0,1,2,3 A
    
    for j in range(Q): # 0,1,2
        bi = P[j][1]
        ai = P[j][0]
        
        
        if(A[i][bi-1] - A[i][ai-1] == P[j][2]):
            amount += P[j][3]
    
   # print(amount)
    if(amount >= max_amount):
        max_amount = amount
    
    amount = 0
    
print(max_amount)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
N, M, Q = map(int,input().split())
P = [list(map(int,input().split())) for i in range(Q)]

A = list(itertools.combinations(range(1,M+1), 3))
number = len(A)

amount = 0
max_amount = 0
for i in range(number): # 0,1,2,3 A
    for j in range(Q): # 0,1,2
        bi = P[j][1]
        ai = P[j][0]
        
        if(A[i][bi-1] - A[i][ai-1] == P[j][2]):
            amount += P[j][3]
    
   # print(amount)
    if(amount >= max_amount):
        max_amount = amount
    
    amount = 0
    
print(max_amount)
Problem p02707 (python)

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

result = [0] * N
for i in numbers:
    result[i- 1] += 1
    
for i in range(N-1):
    print(result[i])
print(0)

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

l = []
amount = 0
for i in range(N - i):
    for j in range(N-1):
        if numbers[j] == i+1:
            amount = amount + 1
    print(amount)
    amount = 0

Buggy submission (verdict: Runtime Error):
#からの配列
l = []
amount = 0
for i in range(N):
    for j in range(N-1):
        if numbers[j] == i+1:
            #print('numbers = {}'.format(numbers[j]))
            amount = amount + 1
    #print('amount = {}'.format(amount))
    l.append(amount)
    #print('l[{}] = {}'.format(i,l[i]))
    #print('--------------------')
    amount = 0

for i in range(N):
    print(l[i])
Problem p02847 (python)

Fixed submission:
S = input()

if S == 'SUN':
  ans = 7
elif S == 'MON':
  ans = 6
elif S == 'TUE':
  ans = 5
elif S == 'WED':
  ans = 4
elif S == 'THU':
  ans = 3
elif S == 'FRI':
  ans = 2
elif S == 'SAT':
  ans = 1

print(ans)

Buggy submission (verdict: Runtime Error):
S = input()

if S == 'SUN':
  ans = 7
elif S == 'MON':
  ans = 6
elif S == 'TUE':
  ans == 5
elif S == 'WED':
  ans = 4
elif S == 'THU':
  ans = 3
elif S == 'FRI':
  ans = 2
elif S == 'SAT':
  ans = 1

print(ans)
Problem p02948 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 21 23:12:22 2019

@author: Yamazaki Kenichi
"""
import heapq

N, M = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]

AB.sort()

q = [0 for _ in range(max(M,N))]
j = 0
ans = 0
for i in range(1,M+1):
    while j < N and AB[j][0] == i:
        heapq.heappush(q,-AB[j][1])
        j += 1
    ans += (-heapq.heappop(q))
#    print(i,j,ans,q)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 21 23:12:22 2019

@author: Yamazaki Kenichi
"""
import heapq

N, M = map(int,input().split())
AB = [list(map(int,input().split())) for i in range(N)]

AB.sort()

q = [0 for _ in range(N)]
j = 0
ans = 0
for i in range(1,M+1):
    while j < N and AB[j][0] == i:
        heapq.heappush(q,-AB[j][1])
        j += 1
    ans += (-heapq.heappop(q))
#    print(i,j,ans,q)
print(ans)