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

Fixed submission:
import sys

S = list(input())
i = 0
cnt = 0

if len(S) == 1:
    print(0)
    sys.exit()

while True:
    if i == len(S) - 2:
        if S[i] != S[i+1]:
            cnt += 2
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
i = 0
cnt = 0

while True:
    if len(S) < 2:
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
i = 0
cnt = 0

while True:
    if i == len(S) - 2:
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)
Problem p03127 (python)

Fixed submission:
# PROXY

import functools
import fractions
N = int(input())
Nlist = [int(i) for i in input().split()]
gcd = functools.reduce(fractions.gcd, Nlist)
print(gcd)

Buggy submission (verdict: Runtime Error):
# PROXY

import functools
import math
N = int(input())
Nlist = [int(i) for i in input().split()]
gcd = functools.reduce(math.gcd, Nlist)
print(gcd)
Problem p03137 (python)

Fixed submission:
# print('input >>')
N, M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
Xdiff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
Xdiff.sort(reverse=True)
ans = (X[-1]-X[0]) - sum(Xdiff[:N-1])

# print('----------output----------')
print(ans)

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

X_dif = []

excep = 0

if M == 1:
    excep = 'M1'
    
if not excep == 'M1':
    for i in range(M-1):
        X_dif.append(X[i+1]-X[i])
    
    X_dif.sort()
    X_dif.reverse()

    if len(X_dif) == 1:
        excep = 'X_dif1'
    
    if not excep == 'X_dif1':
        for N in range(N-1):
            X_dif.pop(0)

if excep == 'M1':
    print(1)
elif excep == 'X_dif1':
    print(2)
else:
    print(sum(X_dif))

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

X_dif = []

excep = 0

if M == 1:
    excep = M1
    
if not excep = M1:
    for i in range(M-1):
        X_dif.append(X[i+1]-X[i])
    
    X_dif.sort()
    X_dif.reverse()

    if len(X_dif) == 1:
        excep == X_dif1
    
    if not X_dif1:
        for N in range(N-1):
            X_dif.pop(0)

if excep == M1:
    print(1)
elif excep == X_dif1:
    print(2)
else:
    print(sum(X_dif))

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

X_dif = []

for i in range(M-1):
    X_dif.append(X[i+1]-X[i])
    
X_dif.sort()
X_dif.reverse()

for N in range(N-1):
    X_dif.pop(0)
    
print(sum(X_dif))

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

X_dif = []

for i in range(M-1):
    X_dif.append(X[i+1]-X[i])
    
X_dif.sort()
X_dif.reverse()

for N in range(N-1):
    X_dif.pop(0)
    
print(sum(X_dif))
Problem p02570 (python)

Fixed submission:
line = input().split(' ')
D = float(line[0])
T = float(line[1])
S = float(line[2])

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input().split(' ')
a = 0
sum = 0
for i in range(1, N):
    sum += int(A[i])
for i in range(N):
    a += int(A[i]) *  sum
    if i < N - 1:
        sum -= int(A[i + 1])
    
print(int(a % (1e9 + 7)))
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "...")

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

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "...")
Problem p02682 (python)

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

ans = 0
if K <= A:
    ans = K
elif K <= A + B:
    ans = A
else:
    ans = A  - (K - A - B) 
    
#rest = K - A - B    
print(ans)

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

ans = 0
for i in range(K):
    if A > 0:
        ans += 1
        A -= 1
    elif B > 0:
        B -= 1
    elif C > 0:
        ans -= 1
        C -= 1
        
        
print(ans)
Problem p03315 (python)

Fixed submission:
S = list(input())

plus = S.count('+')
minas = S.count('-')

ans = plus - minas
print(ans)

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

A = list(map(int,input().split()))


flag = N - 1
count = 0
if N == k:
    flag = -1
    count = 1
while flag >= 0:
    flag -= k-1
    count += 1
    
print(count)
Problem p02580 (python)

Fixed submission:

import sys
from collections import Counter

H, W, M = map(int, sys.stdin.readline().rstrip().split())#行数H、列数W、爆弾数M
hcnt = [0] * H#何行目に何個あるか
wcnt = [0] * W#何列目に何個あるか
bomb = []

for i in range(M):
    bh,bw=map(int,sys.stdin.readline().rstrip().split())
    hcnt[bh - 1] += 1#行方向
    wcnt[bw - 1] += 1#列方向
    bomb.append((bh - 1,bw - 1))
#hcnt [2,1]
#wcnt[1,1,1]
#bomb[[1,1],[0,0],[0,2]]
hmax = max(hcnt)#2
wmax = max(wcnt)#1

crs = 0#hmax and wmax crosspoint
for (i, j) in bomb:
    if hcnt[i] == hmax and wcnt[j] == wmax:
        crs += 1
#all crosspoint has bomb
if crs == Counter(hcnt)[hmax] * Counter(wcnt)[wmax]:
    print(hmax + wmax - 1)
#more than one crosspoint has no bomb
else:
    print(hmax + wmax)

Buggy submission (verdict: Runtime Error):
#爆弾を置く行；対象が最多の行
#爆弾を置く列；最多の行を除いたグリッドで、対象が最多の列
#答え；まず行方向に爆破し、残ったグリッドで列方向に爆破して合算する

#import statistics
H, W, M = map(int, input().split())#行数H、列数W、爆弾数M
lh = []#対象物の行座標リスト
lw = []#対象物の列座標リスト＿
lw2 = []#列座標リストから爆破済みの対象物の列座標を除いたリスト
ans = 0#爆破数
#対象物の座標を行と列で分けてリスト化
for i in range(M):
    bh, bw = map(int, input().split())
    lh.append(bh - 1)#行方向
    lw.append(bw - 1)#列方向

#最頻値が複数の場合、以下の式だとエラーになる
#hmode = statistics.mode(lh)#対象物が最多の行
hmode = max(lh, key = lh.count)#対象物が最多の行
ans += lh.count(hmode)#行方向の爆破最大数

#爆破済みの対象物を除いた新しい列座標リストを作る
for i in range(M):
    if lh[i] != hmode:
        lw2.append(lw[i])
wmode = max(lw2, key = lw2.count)
ans += lw2.count(wmode)#列方向の爆破最大数

print(ans)
Problem p02779 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys

N = int(input())
A = [int(i) for i in input().split()]

dp = {}

for a in A:
    if a-2 in dp:
        print('NO')
        break
    dp[a-2] = 1
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys

N = int(input())
A = [int(i) for i in input().split()]

dp = [0] * max(A)

for a in A:
    if dp[a-1] != 0:
        print('NO')
        break
    dp[a-1] = 1
else:
    print('YES')
Problem p02831 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

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

print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

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

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

print(lcm(A, B))
Problem p02570 (python)

Fixed submission:
a,b,c=[int(a) for a in input().split()]
if b*c>=a:
  print ("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
if b*c>=a:
  print ("Yes")
else:
  print("No")
Problem p02820 (python)

Fixed submission:
n,k=[int(i) for i in input().split()]
r,s,p=[int(i) for i in input().split()]
hand=input()
ans=0
for i in range(k):
  free=True
  j=i
  while j<n:
    if free==True or hand[j-k]!=hand[j]:
      if hand[j]=='r':
        ans+=p
      elif hand[j]=='s':
        ans+=r
      else:
        ans+=s
      free=False
    else:
      free=True
    j+=k
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=[int(i) for i in input().split()]
r,s,p=[int(i) for i in input().split()]
hand=input()
ans=0
for i in range(k):
  free=True
  j=i
  while j<n:
    if free=True or hand[j-k]!=hand[j]:
      if hand[j]=='r':
        ans+=p
      elif hand[j]=='s':
        ans+=r
      else:
        ans+=s
      free=False
    else:
      free=True
    j+=k
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=[int(i) for i in input().split()]
r,s,p=[int(i) for i in input().split()]
hand=input()
ans=0
for i in range(k):
  free=True
  j=i
  while j<n:
    if free=True or hand[j-k]!=hand[j]:
      if hand[j]='r':
        ans+=p
      elif hand[j]='s':
        ans+=r
      else:
        ans+=s
      free=False
    else:
      free=True
    j+=k
print(ans)
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())
x=d/s
if x<=t:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d,t,s=input().split()
x=d/s
if x<=t:
  print("Yes")
else:
  print("No)

Buggy submission (verdict: Runtime Error):
d,t,s=map(int,input().split())
x=d/s
if x<=t:
  print("Yes")
else:
  print("No)
Problem p02552 (python)

Fixed submission:
x = int(input())

if x == 0:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
x = int(input())

if x == 0:
    print(1)
else
    print(0)
Problem p02570 (python)

Fixed submission:
D, T, S = map(int, input().split())
if (T*S >=D):
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
N= int(input())
list1 =[]
list1 = list(map(int, input().split()))
sum = 0

print(list1)  
for i in range(N-1):
    for j in range(i+1,N):
        
        sum = sum + list1[i]*list1[j]
answer = divmod(sum, 10**9+7)
print(answer[1])
Problem p03835 (python)

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

ans = 0

for i in range(0,K+1):
    for j in range (0,K+1):
        if (S-K) <= (i + j) <= S:
            ans = ans + 1
            continue
            

print(ans)

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

ans = 0

for i in range(0,K+1):
    for j in range (0,K+1):
        for k in range (0,K+1):
            if (i + j + k) == S:
                ans = ans + 1
            

print(ans)
Problem p02572 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
S=sum(A)
##print(S)
tmp=0
T=0
for i in range(N-1):
  T=T+A[i]
  ##print(T)
  ##print(A[i])
  tmp=(A[i]*(S-T)+tmp)
tmp=tmp%(10**9+7)
print(tmp)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
S=sum(A)
##print(S)
tmp=0
T=0
for i in range(N):
  T=T+[i+1]
  ##print(T)
  ##print(A[i])
  tmp=(A[i]*(S-T)+tmp)
tmp=tmp%(10**9+7)
print(tmp)
Problem p02623 (python)

Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int,input().split()))

#片方の机から何も選ばれない場合での配列を作成
a, b = [0], [0]
for i in range(len(A)):
    a.append(a[i]+A[i])
for i in range(len(B)):
    b.append(b[i]+B[i])
#すべてJの場合から減らしていく
ans,j=0,M
for i in range(N+1):
    if a[i] > K:
        break
    #すべてBの総和がK-a[i]より小さくなるjを測定
    while b[j] > K - a[i]:
        j -= 1
    #i+jとansのうち大きい方を答えにする。
    ans= max(ans,i+j)

print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
data2=list(map(int,input().split()))
data3=list(map(int,input().split()))

data2cnt=0
data3cnt=0
total=0
count=0
maxint=n+m

for i in range(maxint):
  if len(data2)>=data2cnt+1 and int(data2[data2cnt]) < int(data3[data3cnt]):
      if k>=total+data2[data2cnt]:
        total=total+int(data2[data2cnt])
        data2cnt=data2cnt+1
  elif len(data3)>=data3cnt+1:
      if k>=total+data3[data3cnt]:
        total=total+int(data3[data3cnt])
        data3cnt=data3cnt+1
  else:
    break

print(str(data2cnt+data3cnt))

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
data2=list(map(int,input().split()))
data3=list(map(int,input().split()))

data2cnt=0
data3cnt=0
total=0
count=0
maxint=n+m

for i in range(maxint):
  if len(data2)>=data2cnt+1 and int(data2[data2cnt]) < int(data3[data3cnt]):
      if k>=total+data2[data2cnt]:
        total=total+int(data2[data2cnt])
        data2cnt=data2cnt+1
  elif len(data3)>=data3cnt+1:
      if k>=total+data3[data3cnt]:
        total=total+int(data3[data3cnt])
        data3cnt=data3cnt+1
print(str(data2cnt+data3cnt))

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
data2=list(map(int,input().split()))
data3=list(map(int,input().split()))

data2cnt=0
data3cnt=0
total=0
count=0
maxint=n+m

for i in range(maxint):

  if len(data2)>=data2cnt+1 and int(data2[data2cnt]) < int(data3[data3cnt]):
      if k>=total+data2[data2cnt]:
        total=total+int(data2[data2cnt])
        data2cnt=data2cnt+1
  elif len(data3)>=data3cnt+1:
      if k>=total+data3[data3cnt]:
        total=total+int(data3[data3cnt])
        data3cnt=data3cnt+1
print(str(data2cnt+data3cnt))
Problem p02552 (python)

Fixed submission:
a = int(input())
if a == 1:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
a = int(input()
if a = 1:
    print(0)
else:
    print(1)
Problem p02597 (python)

Fixed submission:
n = int(input())
saidan = input()

isiall = min(saidan.count('W'), saidan.count('R'))

tesuu = 0
for i in range(len(saidan)//2):
    r_iti = saidan.rfind('R')
    w_iti = saidan.find('W')
    
    if r_iti == -1 or w_iti == -1 or r_iti < w_iti:
        break
    
    saidan = saidan[w_iti+1 : r_iti]
    tesuu += 1
    
print(min(tesuu, isiall))

Buggy submission (verdict: Runtime Error):
n = int(input())
saidan = input()

isiall = min(saidan.count('W'), saidan.count('R'))

tesuu = 0
for i in range(len(saidan)//2):
    r_iti = saidan.rfind('R')
    w_iti = saidan.find('W')
    
    if r_iti == -1 or w_iti == -1:
        break
    
    saidan = saidan[w_iti+1 : r_iti]
    tesuu += 1
    
    print(tesuu, saidan)
    
print(min(tesuu, isiall))
Problem p02723 (python)

Fixed submission:
inp = input()
print('Yes' if inp[2] == inp[3] and inp[4] == inp[5] else 'No')

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


def max_distance_homes(homes):
    max_distance = 0
    for i in range(len(homes) - 1):
        distance = homes[i + 1] - homes[i]
        if max_distance < distance:
            max_distance = distance
    distance = k + homes[0] - homes[-1]
    if max_distance < distance:
        max_distance = distance
    return max_distance


print(k - max_distance_homes(home_positions))

Buggy submission (verdict: Runtime Error):
inp = input()
print('Yes' if inp[3] == inp[4] and inp[5] == inp[6] else 'No')
Problem p02831 (python)

Fixed submission:
input_nums = list(map(int, input().split()))
num1 = input_nums[0]
num2 = input_nums[1]

def gcd(num1, num2):
    a = max(num1, num2)
    b = min(num1, num2)
    r = a%b
    while(r != 0):
        a = b
        b = r
        r = a%b
    return b
    

print(num1 * num2 // gcd(num1, num2))

Buggy submission (verdict: Runtime Error):
import math

input_nums = list(map(int, input().split()))
num1 = input_nums[0]
num2 = input_nums[1]

print(num1 * num2 // math.gcd(num1, num2))
Problem p02753 (python)

Fixed submission:
S = input()

flag_a = 0
flag_b = 0
for i in range(3):
  if S[i] == "A":
    flag_a += 1
  else:
    flag_b += 1
if flag_a and flag_b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b = input().split() # a = result * 0.08, b = result * 0.1
a, b = int(a), int(b)
 
result_a = int(a / 0.08)
result_b = int(b / 0.1)
 
if result_a > result_b:
  if int(result_a * 0.08) == a:
    result_a += 1
  c = int(result_a * 0.1)
  if b == c:
    print(result_a)
  else:
    print(-1)
else:
  c = int(result_b * 0.08)
  if a == c:
    print(result_b)
  else:
    print(-1)
Problem p02578 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

cnt = 0
for i in range(1,n):
    if a[i] < a[i-1]:
        cnt = cnt + (a[i-1] - a[i])
        a[i] = a[i-1]

print(cnt)

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

cnt = 0
for i in range(1,5):
    #print(cnt)
    if a[i] < a[i-1]:
        cnt = cnt + (a[i-1] - a[i])
        a[i] = a[i-1]
        #print(cnt)
print(cnt)
Problem p02688 (python)

Fixed submission:
import itertools
N, K = list(map(int, input().split()))
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))
#print(A) 
s = list(set((list(itertools.chain.from_iterable(A)))))
print(N - len(s))

Buggy submission (verdict: Runtime Error):
import itertools
N, K = list(map(int, input().split()))
d = []
A = [[0]]*N
for i in range(K):
    d.append(int(input()))
    A[i] = list(map(int, input().split()))
 
s = list(set((list(itertools.chain.from_iterable(A)))))

for i in range(len(s)):
    if s[i] == 0:
        s.remove(0)
        break

print(N-len(s))

Buggy submission (verdict: Runtime Error):
import itertools
N, K = list(map(int, input().split()))
d = []
A = [[0]]*N
for i in range(K):
    d.append(int(input()))
    A[i] = list(map(int, input().split()))

s = list(set((list(itertools.chain.from_iterable(A)))))
#print(s)
#s.pop(0)
#print(s)

S = list(range(1,N+1))
#print(S)

for i in range(len(s)):
    if s[i] == 0:
        s.remove(0)
        break

diff = list(set(S) - set(s))
#print(diff)
print(len(diff))
Problem p02699 (python)

Fixed submission:
s, w = list(map(int, input().split()))

if s > w:
    print('safe')
else:
    print('unsafe')

Buggy submission (verdict: Runtime Error):
s, w = list(map(int, input(split()))

if s > w:
    print('safe')
else:
    print('unsafe')
Problem p02847 (python)

Fixed submission:
s = input()
d = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - d.index(s))

Buggy submission (verdict: Runtime Error):
s = input()
d = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRY', 'SAT']
print(7 - d.index(s))
Problem p03835 (python)

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

for x in range(K+1):
    for y in range(K+1):
        if K >= S - x - y >= 0:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())
ans = 0

for x in range(K+1):
    for y in range(K+1):
        if S - x - y < 0:
            break
        if K >= S - x - y >= 0:
            ans += 1
print(ans)


k,s = map(int, input().split())

ans = 0
for right in range(max(s-k, 0), min(s+1, 2*k+1)):
  lower = max(0, right-k)
  upper = min(k, right)
  if right % 2 != 0:
    ans += upper - lower + 1
  else:
    ans += upper - lower + 1
print(ans)
Problem p02707 (python)

Fixed submission:
n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0 for i in range(n)]
for a in a_list:
    nl[a-1] += 1
for i in nl:
    print("{}".format(i))

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = map(int input().split())
nl = {str(i):0 for i in range(n)}
for a in a_list:
    nl[str(a-1)] += 1
for v in nl.values():
    print("{}".format(v))
Problem p02577 (python)

Fixed submission:

n = int(input())

ans = 0

l = [int(x) for x in list(str(n))]
ans = sum(l)

if ans % 9 == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

n = int(input())

ans = 0

while n != 0:
    ans += n % 10
    n = int(n/10)

if ans % 9 == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

n = int(input())

ans = 0

while n != 0:
    ans += n % 10
    n = int(n/10)

if ans % 9 == 0:
    print('Yes')
else:
    print('No')
Problem p02624 (python)

Fixed submission:

n = int(input())

ans = 0

def calc(b,e):
    cnt = e // b
    return (b + e) * cnt // 2

for i in range(1, n+1):
    ans += calc(i, n//i * i)

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())

ans = 0

def calc(b,e):
    cnt = e // b
    return (b + e) * cnt // 2

for i in range(1, n+1):
    ans += calc(i, n//i * i)
    print(ans)

print(ans)

Buggy submission (verdict: Runtime Error):

import sympy

n = int(input())

num = 0

for i in range(n):
    i +=1
    f = sympy.divisor_count(i)
    num += f*i

print(num)
Problem p02578 (python)

Fixed submission:
x = int(input())
lst = list(map(int, input().split()))
i = 1
cnt = 0
a = lst[0]
if x == 1:
    print(0)
else:
    while True:
        b = lst[i]
        if b < a:
            cnt += abs(b - a)
            a = a
        else:
            a = b
        if i >= x - 1:
            break
        i += 1
    print(cnt)

Buggy submission (verdict: Runtime Error):
x = int(input())
lst = list(map(int, input().split()))
i = 1
cnt = 0
a = lst[0]
while True:
    b = lst[i]
    if b < a:
        cnt += abs(b - a)
        a = a
    else:
        a = b
    if i == x - 1:
        break
    i += 1
print(cnt)
Problem p03041 (python)

Fixed submission:
m,k = map(int, input().split())
s = input()
i = k-1
s = s[:i] + s[i].lower() + s[i+1:]
print(s)

Buggy submission (verdict: Runtime Error):
m,k = map(int, input().split())
s = input()
s = s[:k] + s[k].lower() + s[k+1:]
print(s)

Buggy submission (verdict: Runtime Error):
m,k = map(int, input().split())
s = input()
s[k] = s[k].lower()
print(s)
Problem p02771 (python)

Fixed submission:
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list(map(int, input().split()))
print (PoorOrNot(number_list))

Buggy submission (verdict: Runtime Error):
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list[map(int, input().split())]
print (PoorOrNot(number_list))

Buggy submission (verdict: Runtime Error):
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list[map(int, input().split())]
print (PooeOrNot(number_list))

Buggy submission (verdict: Runtime Error):
def PoorOrnot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list[map(int, input().split())]
print (PooeOrNot(number_list))