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

Fixed submission:
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == A and S[i+1] == B and S[i+2] == C:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
count = 0
for i in range(N-2):
    if S[i] == A and S[i+1] == B ans S[i+2] == C:
        count += 1
print(count)
Problem p02830 (python)

Fixed submission:
N = int(input())
S,T = list(map(str,input().split()))
ans = []
for i in range(len(S)):
    ans.append(S[i])
    ans.append(T[i])
print(''.join(ans))

Buggy submission (verdict: Runtime Error):
S,T = list(map(str,input().split()))
ans = []
for i in range(len(S)):
    ans.append(S[i])
    ans.append(T[i])
print(''.join(ans))
Problem p02909 (python)

Fixed submission:
S = str(input())
if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy submission (verdict: Runtime Error):
S = str(input())
if S == Sunny:
    print('Cloudy')
elif S == Cloudy:
    print('Rainy')
else:
    print('Sunny')
Problem p02945 (python)

Fixed submission:
A,B = list(map(int,input().split()))
print(max(A+B,A-B, A*B))

Buggy submission (verdict: Runtime Error):
A = list(map(int,input().split()))
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A,B = list(map(int,input().split()))
print(max(A+B.A-B,A*B))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
Sum = A + B
Minus = A - B
Multi = A * B
if Sum > Minus and Sum > Multi:
    print(Sum)
elif Multi > Minus and Sum < Multi:
    print(Multi)
else:
    print(Minus)
Problem p02946 (python)

Fixed submission:
K,X=list(map(int,input().split()))
Min = max(X - (K -1),-1000000)
Max = min(X + (K-1),1000000)
ans = []
for i in range(Min,Max+1):
    ans.append(i)
ans = map(str,ans)
ans = ' '.join(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
K,X=list(map(int,input().split()))
min = max(X - (K -1),-1000000)
max = min (X + (K-1),1000000)
for i in range(min,max+1):
    ans.append(i)
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
K,X=list(map(int,input().split()))
min = max(X - (K -1),−1000000)
max = min (X + (K-1),1000000)
for i in range(min,max+1):
    ans.append(i)
print(' '.join(ans))
Problem p02957 (python)

Fixed submission:
A= list(map(int,input().split()))
if (A[0]+A[1])%2 == 0:
    print(int((A[0]+A[1])/2))
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A ,B = int(input())
if (A+B)%2==0:
    print((A+B)/2)
else:
    print('IMPOSSIBLE')
Problem p02988 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1,n-1):
    if p[i+1] < p[i] < p[i-1] or p[i+1] > p[i] > p[i-1]:
        ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
p = list(map(int, input().split()))
ans = 0
for i in p[2:]:
    if p[i] < p[i-1] < p[i-2] or p[i] > p[i-1] > p[i-2]:
        ans +=1
    else:
        continue
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
p = list(map(int, input().split()))
ans = 0
for i in p[3:]:
    if p[i] < p[i-1] < p[i-2] or p[i] > p[i-1] > p[i-2]:
        ans +=1
    else:
        continue
print(ans)
Problem p02999 (python)

Fixed submission:
X,A = (input().split())
if X < A:
    print('0')
else:
    print('10')

Buggy submission (verdict: Runtime Error):
X,A = int(input().split())
if X < A:
    print('0')
else:
    print('10')

Buggy submission (verdict: Runtime Error):
X,A = int(input().split())
if X < A:
    print('0')
else:
    print('10')
Problem p03000 (python)

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

ans = 1
pos = 0
for i in range(n):
	pos = pos + li[i]
	if pos <= x:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N)+1
position = 0
count = 0
while position < x:
    position += L[count]
    count += 1
    if n == count:
        break
if n > count:
    print(count)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N)+1
position = 0
count = 0
if n > count:
    while position < x:
        position += L[count]
        count += 1
    print(count)
else:
    print(n)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(500000)

N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N) + 1
position = 0
count = 0
while position <= x:
    position += L[count]
    count += 1
if n > count:
    print(count)
else:
    print(n)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N) + 1
position = 0
count = 0
while position < x:
    position += L[count]
    count += 1
if n > count:
    print(count)
else:
    print(n)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N) + 1
position = 0
count = 0
while position <= x:
    position += L[count]
    count += 1
if n > count:
    print(count)
else:
    print(n)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N)
position = 0
count = 0
while position <= x:
    position += L[count]
    count += 1
if n+1 > count:
    print(count)
else:
    print(n+1)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
n = int(N)
position = 0
count = 0
while position <= x:
    position += L[count]
    count += 1
if n+1 < count:
    print(count)
else:
    print(n+1)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
position = 0
count = 0
while position <= x:
    position += L[count]
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N,X = (input().split())
L = list(map(int, input().split()))
x = int(X)
position = 0
count = 0
while position < x:
    position += L[count]
    count += 1
print(count)
Problem p03086 (python)

Fixed submission:
S = str(input())
ans = []
for i in range(len(S)):
    preans = []
    if S[i] == "A" or S[i] == "C" or S[i]  == "G" or S[i] =="T":
        preans.append(S[i])
        for j in range(1,len(S)-i):
            if S[i+j] == "A" or S[i+j] == "C" or S[i+j]  == "G" or S[i+j] =="T":
                preans.append(S[i+j])
            else:
                break
    if len(preans) > len(ans):
        ans = preans
if len(ans) == 2 and ans[0] == "A" and ans[1] == "C":
    print(0)
else:
    print(len(ans))

Buggy submission (verdict: Runtime Error):
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1:
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
ans = 0
for i in range(len(s)):
count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1:
            else:
                break:
    if ans < count:
        ans = count
print(ans)
Problem p03102 (python)

Fixed submission:
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input().split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[i][j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input().split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = list(map(int,input().split()))
B = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(list(map(int,input(),split())))
S = []
count = 0
for i in range(N):
    for j in range(M):
        S.append(A[j]*B[j])
    if sum(S) > -1 * C:
        count += 1
    S = []
print(count)
Problem p03125 (python)

Fixed submission:
A,B = list(map(int,input().split()))
if B%A==0:
    print(A+B)
else:
    print(B-A)

Buggy submission (verdict: Runtime Error):
A,B = int(input())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Buggy submission (verdict: Runtime Error):
A,B = int(input())
if B%A=0:
    print(A+B)
else:
    print(B-A)
Problem p03210 (python)

Fixed submission:
N = int(input())
if N == 3 or N==5 or N==7:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N = int(input())
if N == 3 or N==5 or N==7:
    print('Yes')
else:
print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
if N == 3 or 5 or 7:
    print('Yes')
else:
print('No')
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    A =int(input())
    B =int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N == 1:
    print('Hello World)
if N == 2:
    A =int(input())
    B =int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N == 1:
    print('Hello World)
if N == 2:
    A == int(input())
    B == int(input())
    print(A+B)
Problem p03280 (python)

Fixed submission:
A,B=list(map(int,input().split()))
print((A-1)*(B-1))

Buggy submission (verdict: Runtime Error):
A,B=list(map(int,input.split()))
print((A-1)*(B-1) + 1)

Buggy submission (verdict: Runtime Error):
A,B=list(map(int,input.split()))
print((A-1)*(B-1) + )
Problem p03282 (python)

Fixed submission:
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(min(len(S),K)):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(K):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
for i in S:
    if S[i] != 1:
        ans = S[i]
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
for i in S:
    if S[i] != 1:
        print(S[i])
        break
Problem p03434 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
A.reverse()
Alice = []
Bob = []
for i in range(1,N+1):
    if i % 2 != 0:
        Alice.append(A[i-1])
    else:
        Bob.append(A[i-1])
print(sum(Alice)-sum(Bob))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split))
Alice = []
Bob = []
for i in range(N):
    if i % 2 != 0:
        Alice.append(A[i])
    else:
        Bob.append(A[i])
print(sum(Alice)-sum(Bob))
Problem p03296 (python)

Fixed submission:
if __name__ == "__main__":
    N = input().rstrip().split(' ')
    N = int(N[0])
    line = input().rstrip().split(' ')
    count = 0
    skip_flag = False
    for i in range(len(line)-1):
        if skip_flag:
            skip_flag = False
            continue
        if line[i] == line[i+1]:
            count += 1
            skip_flag = True
    print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
if __name__ == "__main__":
    T = input().rstrip().split(' ')
    T = int(T[0])
    for t in range(T):
        line = input().rstrip().split(' ')
        A = int(line[0])
        B = int(line[1])
        C = int(line[2])
        D = int(line[3])
        A_list = []
        flag = True

        if B > A:
            print('No')
            continue
        if B > D:
            print('No')
            continue
        if C > B:
            print('Yes')
            continue

        while True:
            if A in A_list:
                flag = True
                break
            A_list.extend([A])
            if A < B:
                flag = False
                break
            q, A = divmod(A, B)
            for i in range(q-1):
                if A + B > C:
                    break
                A += B
            A_list.extend([A + B])
            if A <= C:
                A += D
        if flag:
            print('Yes')
        else:
            print('No')
Problem p02993 (python)

Fixed submission:
s = input()

flag = True
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    print("Bad")
    flag = False
    break
if flag:
  print("Good")

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  string p;
  cin >> p;
  flag = !((p[0] == p[1])||(p[1]==p[2])||p[2]==p[3]);
  if(flag){
  cout << "No" << endl;
  }
  else{
  cout << "Yes" <<endl;
  } 
}

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

apple = list(range(L,L+N))

s = sum(apple)

m = 1000000000000000000
for x in apple:
  if abs(m) > abs(x):
    m = x

print(s-m)

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

flag = True
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    print("Bad")
	flag = False

if flag:
  	print("Good")

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

flag = True
for i in range(N-1):
  if s[i] == s[i+1]:
    print("Bad")
	flag = False

if flag:
  	print("Good")
Problem p02995 (python)

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
#print(gcd(a,b))

#最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)
#print(lcm(a,b)

a,b,c,d = list(map(int,input().split(" ")))
e = lcm(c,d)
p=(a-1)//c
o=b//c
i=(a-1)//d
u=b//d
y=(a-1)//e
t=b//e
C = max([0,o-p])
D = max([0,u-i])
E = max([0,t-y])
print( (b-a+1)-(C+D-E) )

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
#print(gcd(a,b))

#最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)
#print(lcm(a,b)

a,b,c,d = list(map(int,input().split(" ")))
e = lcm(c,d)
p=a//c
o=b//c
i=a//d
u=b//d
y=a//e
t=b//e
C = max([0.o-p])
D = max([0,u-i])
E = max([0,t-y])
print( (b-a+1)-(C+D-E) )

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
#print(gcd(a,b))

#最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)
#print(lcm(a,b)

a,b,c,d = list(map(int,input().split(" ")))
e = lcm(c,d)

p=a//c
o=b//c
i=a//d
u=b//d
y=a//e
t=b//e

C = max(0.o-p)
D = max(0,u-i)
E = max(0,t-y)
print((b-a+1)-(C+D-E))
Problem p02996 (python)

Fixed submission:
n = int(input())

tasks = []
for _ in range(n):
  a,b = list(map(int,input().split(" ")))
  tasks.append((a,b))

tasks = sorted(tasks,key = lambda x:x[1])

now_time = 0
flag = True
for a,b in tasks:
  if now_time + a > b:
    flag = False
    break
  now_time += a
if flag:
  print("Yes")
else:
  print("No")

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

tasks = []
for _ in range(n):
  a,b = list(map(int,input().split(" ")))
  tasks.append(a,b)

tasks = sorted(tasks,key = lambda x:x[1])

now_time = 0
flag = True
for a,b in tasks:
  if now_time + a > b:
    flag = False
    break
  now_time += a
if flag:
  print("Yes")
else:
  print("No")
Problem p03001 (python)

Fixed submission:
w,h,x,y = list(map(int,input().split(" ")))

sq = w*h/2
flag = 1 if w == x*2 and h == y*2 else 0

print(sq,flag)

Buggy submission (verdict: Runtime Error):
w,h,x,y = list(map(int,input().split(" ")))

sq = w*h/2
flag = 1 if w == x*2 and h = y*2 else 0

print(sq,flag)
Problem p03085 (python)

Fixed submission:
base = input()
if base == "A":
	print("T")
if base == "T":
	print("A")
if base == "C":
	print("G")
if base == "G":
	print("C")

Buggy submission (verdict: Runtime Error):
_, num_query = list(map(int,input().split()))
string = input()
dfor _ in range(num_query):
  left, right = list(map(int,input().split()))
  sub_string = string[left-1:right]
  print(sub_string.count("AC"))

Buggy submission (verdict: Runtime Error):
base = input()
if base == "A"
	print("T")
if base == "T"
	print("A")
if base == "C"
	print("G")
if base == "G"
	print("C")
Problem p03147 (python)

Fixed submission:
def all_water(h_list):
  if len(h_list) == 0:
    return 0
  min_h = min(h_list)
  new_list = [x - min_h for x in h_list]
  i = new_list.index(0)
  return min_h + all_water(new_list[:i]) + all_water(new_list[i+1:])

n = input()

height = list(map(int,input().split(" ")))

print(all_water(height))

Buggy submission (verdict: Runtime Error):
def all_water(h_list):
  if len(h_list) == 0:
    return 0
  min_h = min(h_list)
  new_list = [x - min_h for x in h_list]
  i = new_list.index(0)
  return min_h + all_water(new_list[:i]) + all_water(new_list[i+1:])

n = input()

height = list(map(int,input().split(" ")))

print(allwater(height))

Buggy submission (verdict: Runtime Error):
def all_water(h_list):
  if len(h_list) == 0:
    return 0
  min_h = min(h_list)
  new_list = list(map(lambda x:x-minh, h_list))
  i = new_list.index(0)
  return min_h + all_water(new_list[:i]) + all_water(new_list[i+1:])

n = input()

height = list(map(int,input().split(" ")))

print(allwater(height))

Buggy submission (verdict: Runtime Error):
def all_water(h_list):
  if len(h_list) == 0:
    return 0
  min_h = min(h_list)
  h_list = list(map(lambda x:x-minh, h_list))
  i = h_list.index(0)
  return min_h + all_water(h_list[:i]) + all_water(h_list[i+1:])

n = input()

height = list(map(int,input().split(" ")))

print(allwater(height))
Problem p02731 (python)

Fixed submission:
l = int(input())
 
print(pow(l/3,3))

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

print(pow(l/3),3)
Problem p02841 (python)

Fixed submission:
# coding:utf-8
m1,d1 = list(map(int, input().split()))
m2,d2 = list(map(int, input().split()))
if m1 != m2:
  print("1")
else:
  print("0")

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import math
X = int(input())
c = 0
x2 = X%100
for i in range(100000):
  x = 0
  if x2/5 >= 1 :
    x = math.floor(x2/5)
    x2 -= 5*x
  elif x2 / 4 >= 1 :
    x = math.floor(x2/4)
    x2 -= 4*x
  elif x2 / 3 >= 1 :
    x = math.floor(x2/3)
    x2 -= 3*x
  elif x2 / 2 >= 1 :
    x = math.floor(x2/2)
    x2 -= 2*x
  elif x2 / 1 == 1 :
    x = math.floor(x2/1)
    x2 -= 1*x
  c += x
  if x2 == 0:
    break
if X > c*100:
  print("1")
else :
  print("0")

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import math
X = int(input())
if X < 100:
  print("0")
  exit()
c = 0
x2 = X%100
for i in range(100000):
  x = 0
  if x2/5 > 1 :
    x = math.floor(x2/5)
    x2 -= 5*x
    five = 5*x
  elif x2 / 4 >= 1 :
    x = math.floor(x2/4)
    x2 -= 4*x
    four = 4*x
  elif x2 / 3 >= 1 :
    x = math.floor(x2/3)
    x2 -= 3*x
    three = 3*x
  elif x2 / 2 >= 1 :
    x = math.floor(x2/2)
    x2 -= 2*x
    two = 2*x
  elif x2 / 1 == 1 :
    x = math.floor(x2/1)
    x2 -= 1*x
    one = 1*x
  c += x
  if x2 == 0:
    break
if c == 0 or X >= c*100:
  print("1")
else :
  print("0")
Problem p03206 (python)

Fixed submission:
D = int(input())
ans = "Christmas"
for i in range(25-D):
    ans += " Eve"
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))
h = [int(input()) for i in range(N)]
candidate = None
h.sort()
for i in range(N-K+1):
    tmp = h[i+K-1] - h[i]
    if candidate == None or tmp < candidate:
        candidate = tmp
print(candidate)

Buggy submission (verdict: Runtime Error):
ans = "Christmas"
for i in range(25-D):
    ans += " Eve"
print(ans)
Problem p03212 (python)

Fixed submission:
N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s+c)
    return ret
print(dfs('0'))

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
combi = []
l = []
count = 0

def dfs(s):
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s+c)
    return
print(dfs('0'))
Problem p03219 (python)

Fixed submission:
x, y = list(map(int, input().split()))
print("{} ".format(int(x+y/2)))

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
city_list = [[] for i in range(n)]

for i in range(m):
    pm, ym = list(map(int, input().split()))
    city_list[pm-1].append(ym)
city_list_copied = copy.deepcopy(city_list)

for i in range(n):
    city_list_copied[i].sort()
    for j in range(len(city_list[i])):
        cindex = sum(x <= city_list[i][j] for x in city_list[i])
        print("{:0=6}{:0=6}".format(i+1, cindex))

Buggy submission (verdict: Runtime Error):
import copy
n, m = list(map(int, input().split()))
city_list = [[] for i in range(n)]
numbers = []

for i in range(m):
    pm, ym = list(map(int, input().split()))
    city_list[pm-1].append(ym)
city_list_copied = copy.deepcopy(city_list)

for i in range(n):
    city_list_copied[i].sort()
    for j in range(len(city_list[i])):
        cindex = city_list_copied[i].index(city_list[i][j])
        print("{:0=6}{:0=6}".format(i+1, cindex+1))
Problem p02755 (python)

Fixed submission:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    result = 1
    while True:
        a = int(result * 0.08)
        b = int(result * 0.1)
        if a == A and b == B:
            print(result)
            break
        if A < a and B < b:
            print(-1)
            break
        result += 1


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin


def spam(x, AB, per):
    min_ = x
    max_ = x
    while True:
        min_ -= 1
        tmp = int(min_ * per)
        if AB != tmp:
            min_ += 1
            break
    while True:
        max_ += 1
        tmp = int(max_ * per)
        if AB != tmp:
            max_ -= 1
            break
    return min_, max_


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    x = spam(int(A / 0.08), A, 0.08)
    y = spam(int(B / 0.1), B, 0.1)
    if int(x[0] * 0.08) != A:
        a
    if int(x[1] * 0.08) != A:
        a
    if int(y[0] * 0.1) != B:
        a
    if int(y[1] * 0.1) != B:
        a

    if x[0] <= y[0] <= x[1]:
        print(y[0])
    elif y[0] <= x[0] <= y[1]:
        print(x[0])
    else:
        print(-1)


if __name__ == "__main__":
    main()