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

Fixed submission:
n = int(input())
lst = [list(input().split())+[i+1] for i in range(n)]

# print(lst)

lst = sorted(lst, key=lambda x: (x[0], -int(x[1])))

for i in range(0, len(lst)):
    print(lst[i][2])

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [list(input().split())+[i+1] for i in range(n)]

print(lst)

lst = sorted(lst, key=lambda x: (x[0], -int(x[1])))

for i in range(0, len(lst)):
    print(i[2])
Problem p03086 (python)

Fixed submission:
s = input()
slt = list(s)

mojiretu = ["A", "C", "G", "T"]

cntlt = list()
cnt = 0
for i in range(0, len(slt)):
    if slt[i] in mojiretu:
        cnt += 1
    else:
        cntlt.append(cnt)
        cnt = 0
else:
    cntlt.append(cnt)

print(max(cntlt))

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

mojiretu = ["A", "C", "G", "T"]

cntlt = list()
cnt = 0
for i in range(0, len(slt)):
    if slt[i] in mojiretu:
        cnt += 1
    else:
        cntlt.append(cnt)
        cnt = 0

print(max(cntlt))
Problem p02741 (python)

Fixed submission:
N=int(input())

list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[N-1])

Buggy submission (verdict: Runtime Error):
import math
from decimal import *

a,b,c=map(Decimal,input().split())

A=math.sqrt(a)
B=math.sqrt(b)
C=math.sqrt(c)


if   A+B<C:
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
import math
from decimal import *

a,b,c=map(Decimal,input().split())

A=math.sqrt(a)
B=math.sqrt(b)
C=math.sqrt(c)


if   A+B<C:
    print("Yes")
else :
    print("No")
Problem p02784 (python)

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

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

if sum(A)>=H:
    print("Yes")
else:
    print('No')

Buggy submission (verdict: Runtime Error):

        
  H,N=map(int,input().split())

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

  if sum(A)>=H:
    print("Yes")
    else:
      print('No')
Problem p03076 (python)

Fixed submission:
l=list(int(input()) for _ in range(5))
s=list(10-i%10 for i in l)
for i in range(s.count(10)):
  s.remove(10)
if len(s)>0:
  s.remove(max(s))
print(sum(l)+sum(s))

Buggy submission (verdict: Runtime Error):
l=list(int(input()) for _ in range(5))
s=list(10-i%10 for i in l)
for i in range(s.count(10)):
  s.remove(10)
s.remove(max(s))
print(sum(l)+sum(s))
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
l=[]
for i in range(min([a,b])+1,0,-1):
  if a%i==0 and b%i==0:
    l.append(i)
print(l[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=[]
for i in range(min([a,b])+1,1,-1):
  if a%i==0 and b%i==0:
    l.append(i)
print(l[k-1])
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
print(gcd_list([abs(i-x) for i in l]))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
print(reduce(gcd,[abs(i-x) for i in l]))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
n,x=map(int,input().split())
l=[int(i) for i in input().split()]
print(reduce(math.gcd,[abs(i-x) for i in l]))
Problem p03085 (python)

Fixed submission:
b = input()
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
else:
  print("G")

Buggy submission (verdict: Runtime Error):
if b == "A":
  print("G")
elif b == "G":
  print("A")
elif b == "C":
  print("T")
else:
  print("C")

Buggy submission (verdict: Runtime Error):
if b = A:
  print("G")
elif b = G:
  print("A")
elif b = C:
  print("T")
else:
  print("C")
Problem p02791 (python)

Fixed submission:
# abc152

n = int(input())
lists = list(map(int,input().split()))

std = lists[0]
ans = 1

for i in range(1,n):
    if lists[i] < std:
        ans += 1
        std = lists[i]
        
print(ans)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;

int main(){
  
  int n;
  cin >> n;
  
  vector<int> lists(n);
  for(int i=0; i<n;i++){
    cin >> lists.at(i);
  }
  
  int ans = 1;
  int std = lists.at(0);
  
  for(int i=1;i<n;i++){
    if(lists.at(i) < std){
      ans += 1;
      std = lists.at(i);
    }
  }
  
  cout << ans << endl;
  
  return 0;
}
Problem p02705 (python)

Fixed submission:
import numpy as np
r = int(input())
 
print(r*2*np.pi)

Buggy submission (verdict: Runtime Error):
pi = 3.141592
x = input()

print(x*2*pi)
Problem p03061 (python)

Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)


gcdL = []
gcdR = []

N = int(input())
A = [int(x) for x in input().split()]
gcdL.append(0)
length_A = len(A)
for i in range(1,length_A):
    gcdL.append(gcd(A[i-1],gcdL[i-1]))


gcdR.append(0)
for i in range(1,length_A):
    gcdR.append(gcd(A[length_A-i],gcdR[i-1]))



list_gcd = []
for i in range(length_A):
        list_gcd.append(gcd(gcdL[i],gcdR[length_A-i-1]))

print(max(list_gcd))

Buggy submission (verdict: Runtime Error):
import numpy

def gcd(a,b,mem):
    str12 = "{}.{}".format(a, b)
    if b==0:
        return a
    elif str12 in mem.keys():
        return mem[str12]
    else:
        mem[str12] = gcd(b,a%b,mem)
        return  mem[str12]




N = int(input())
A = numpy.array([int(x) for x in input().split()])
a2 = list(A)
max = 0
mem = {}
for i,_ in enumerate(A):
    A.pop(i)
    res = A[0]
    for i in A[1:]:
        res = gcd(i,res,mem)
    max = res if res >= max else max
    A = list(a2)


print(max)

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




N = int(input())
A = [int(x) for x in input().split()]
a2 = A.copy()
max = 0
mem = {}
for i,_ in enumerate(A):
    A.pop(i)
    res = A[0]
    for i in A[1:]:
        str12 = "{}.{}".format(i,res)
        if str12 in mem.keys():
            res = mem[str12]
        else:
            res = gcd(res,i)
            mem[str12] = res
    max = res if res >= max else max
    A = list(a2)


print(max)

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




N = int(input())
A = [int(x) for x in input().split()]
a2 = A.copy()
max = 0
for i,_ in enumerate(A):
    A.pop(i)
    res = A[0]
    for i in A[1:]:
        res = gcd(res,i)
    max = res if res >= max else max
    A = list(a2)


print(max)

Buggy submission (verdict: Runtime Error):
import fractions
import  functools

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




N = int(input())
A = [int(x) for x in input().split()]
a2 = A.copy()
max = 0
for i,_ in enumerate(A):
    A.pop(i)
    res = A[0]
    for i in A[1:]:
        res = gcd(res,i)
    max = res if res >= max else max
    A = a2.copy()


print(max)

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

def gcd(numbers):
    return functools.reduce(math.gcd,numbers)

N = int(input())
A = [int(x) for x in input().split()]
a2 = A.copy()
max = 0
for i,_ in enumerate(A):
    A.pop(i)
    temp = gcd(A)
    max = temp if temp >= max else max
    A = a2.copy()


print(max)
Problem p03161 (python)

Fixed submission:
n, l = input().split()
n = int(n)
l = int(l)
h = [int(s) for s in input().split()]


dp = [0]
for i, height in enumerate(h):
    hight_temp = height
    step = 10000000000
    start = i - l if i - l > 0 else 0
    for k in range(start, i):
        temp_step = abs(height - h[k]) + dp[k]
        step = step if step < temp_step else temp_step
        temp = temp_step

    if i != 0:
        dp.append(step)

print(dp.pop())

Buggy submission (verdict: Runtime Error):

n = int(input())
temp = input()
h = temp.split()
for i,item in enumerate(h):
    h[i] = int(item)
dp = [0]

def rec_flog(i):
    if len(dp) > i:
        return dp[i]
    elif i >= 2:
        step1 = abs(h[i] - h[i - 1]) + rec_flog(i-1)
        step2 = abs(h[i] - h[i -2]) + rec_flog(i-2)
        dp.append(step1 if step1 <= step2 else step2)
        return dp[i]
    else :
        dp.append(h[1] - h[0])
        return dp[1]


print(rec_flog(n-1))
Problem p02853 (python)

Fixed submission:
codePlace, implePlace = map(int, input().split(" "))

priceDict = {
    1:300000,
    2:200000,
    3:100000
}

totalPrice = priceDict[codePlace] if codePlace in priceDict.keys() else 0
totalPrice += priceDict[implePlace] if implePlace in priceDict.keys() else 0
totalPrice += 400000 if codePlace == 1 and implePlace == 1 else 0

print(totalPrice)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

priceDict = {
    "1":300000,
    "2":200000,
    "3":100000
}

totalPrice = priceDict[args[1]] if args[1] in priceDict.keys() else 0
totalPrice += priceDict[args[2]] if args[2] in priceDict.keys() else 0
totalPrice += 400000 if args[1] is "1" and args[2] is "1" else 0

print(totalPrice)
Problem p02743 (python)

Fixed submission:
a,b,c=map(int,raw_input().split())
if a+b >= c:
    print "No"
else:
    q = 4 * a * b;
    h = (c - a - b) * (c - a - b)
    if q < h:
        print "Yes"
    else:
        print "No"

Buggy submission (verdict: Runtime Error):
import math
a=int(input())
b=int(input())
c=int(input())

Buggy submission (verdict: Runtime Error):
import math
a=int(input())
b=int(input())
c=int(input())
if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
    print "Yes"
else:
    print "No"
Problem p03160 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
 
dp = []
for i in range(n):
	dp.append(int(0))
dp[0] = 0
dp[1] = abs(h[0]-h[1])
 
for j in range(2,n):
	dp[j] = min(dp[j-1] + abs(h[j-1] - h[j]),dp[j-2] + abs(h[j-2] - h[j]))
  
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
Nlist = list(map(int, input().split()))
h = list(map(int, input().split()))
n = Nlist[0]
k = Nlist[1]
 
dp = []
for i in range(n):
	dp.append(int(0))
 
for s in range(1,n):
	if s - k < 0:
		l = 0
	else:
		l = s - k
	temp = dp[l] + abs(h[s] - h[l])
	for t in range(l, s):
		temp = min(temp, dp[t] + abs(h[t] - h[s]))
	dp[s] = temp

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
sys.setrecursionlimit(200000)

n = int(input())
h = list(map(int, input().split()))

dp = []
for i in range(n):
    dp.append(-1)
 
def flog(m):
    if dp[m] != -1:
        return dp[m]
    if m == 0:
        dp[m] = 0
        return 0
    if m == 1:
        dp[m] = abs(h[0]-h[1])
        return dp[m]
    else:
        dp[m] = min(flog(m-1) + abs(h[m-1] - h[m]),flog(m-2) + abs(h[m-2] - h[m]))
        return dp[m]
  
print(flog(n-1))

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

n = int(input())
h = list(map(int, input().split()))
 
dp = []
for i in range(n):
    dp.append(-1)
 
 
def flog(m):
    if dp[m] != -1:
        return dp[m]
    if m == 0:
        dp[m] = 0
        return 0
    if m == 1:

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

dp = []
for i in range(n):
	dp.append(int(0))
dp[0] = 0
dp[1] = abs(h[0]-h[1])
 
for j in range(2,n):
	dp[j] = min(flog(j-1) + abs(h[j-1] - h[j]),flog(j-2) + abs(h[j-2] - h[j]))
  
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
 
dp = []
for i in range(n):
	dp.append(0)
dp[0] = 0
dp[1] = abs(h[0]-h[1])
 
for j in range(2,n):
	dp[j] = min(flog(j-1) + abs(h[j-1] - h[j]),flog(j-2) + abs(h[j-2] - h[j]))
  
print(dp[n-1])

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

dp = []
for i in range(n):
    dp.append(-1)


def flog(m):
    if dp[m] >= 0:
        return dp[m]
    if m == 0:
        dp[m] = 0
        return 0
    if m == 1:
        dp[m] = abs(h[0]-h[1])
        return dp[m]
    else:
        dp[m] = min(flog(m-1) + abs(h[m-1] - h[m]),flog(m-2) + abs(h[m-2] - h[m]))
        return dp[m]
  
print(flog(n-1))

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

dp = []
for i in range(n):
    dp.append(-1)


def flog(m):
    if dp[m] != -1:
        return dp[m]
    if m == 0:
        dp[m] = 0
        return 0
    if m == 1:
        dp[m] = abs(h[0]-h[1])
        return dp[m]
    else:
        dp[m] = min(flog(m-1) + abs(h[m-1] - h[m]),flog(m-2) + abs(h[m-2] - h[m]))
        return dp[m]
  
print(flog(n-1))
Problem p02783 (python)

Fixed submission:
HA=input()
HA=HA.split()
n=int(HA[0])/int(HA[1])
if int(HA[0])%int(HA[1])==0:
  print(int(n))
else:
  print(int(n+1))

Buggy submission (verdict: Runtime Error):
HA=input()
HA=HA.split()
n=HA[0]/HA[1]
if int(HA[0])%int(HA[1])==0:
  print(n)
else:
  print(n+1)
Problem p02786 (python)

Fixed submission:
H=int(input())
import math
H=int(math.log2(H))
print(2**(H+1)-1)

Buggy submission (verdict: Runtime Error):
H=int(input())
import math
H=int(math.log2())
print(2**(H+1))

Buggy submission (verdict: Runtime Error):
H=int(input())
import math
H=int(math.log1())
print(2**(H+1))
Problem p02789 (python)

Fixed submission:
a=input()
b=a.split()
if int(b[0])==int(b[1]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=input()
p=input()
p=p.split()
q=[]
for i in range(int(n)):
    if min(p[:i+1])==p[i]:
        q.append(p[i])
print(len(q))

Buggy submission (verdict: Runtime Error):
n=input()
p=input()
p=p.split()
q=[]
for i in range(int(n)):
    j=min(p[:i+1])
    if j==p[i]:
        q.append(p[i])
print(len(q))

Buggy submission (verdict: Runtime Error):
n=input()
p=input()
p=p.split()
q=[p[0]]
for i in range(int(n)):
    j=max(p[:i+1])
    if j>p[i]:
        q.append(p[i])
if p[int(n)-1]!=min(p):
    q.pop(-1)
print(len(q))

Buggy submission (verdict: Runtime Error):
n=input()
p=input()
p=p.split()
q=[p[0]]
for i in range(int(n)):
    j=max(p[:i+1])
    if j>p[i]:
        q.append(p[i])
if p[int(n)-1]!=min(p):
    q.pop(-1)
print(len(q))

Buggy submission (verdict: Runtime Error):
n=input()
m=input()
if int(n)==int(m):
  print('yes')
else:
  print('no')

Buggy submission (verdict: Runtime Error):
N=input('N')
M=input('M')
if int(N)==int(M):
  print('yes')
else:
  print('no')

Buggy submission (verdict: Runtime Error):
int(input())=n
int(input())=m
if n==m:
  print('yes')
else:
  print('no')

Buggy submission (verdict: Runtime Error):
int(input())=n
int(input())=m
if n=m:
  print('yes')
else:
  print('no')
Problem p02743 (python)

Fixed submission:
from decimal import *
a,b,c=map(int,input().split())
if Decimal(a).sqrt()+Decimal(b).sqrt()<Decimal(c).sqrt():
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from decimal import *
a,b,c=map(int,input().split())
if Decimal(a).sqrt()+Decimal(a).sqrt(b)<Decimal(a).sqrt(c):
  print("Yes")
else:
  print("No")
Problem p02744 (python)

Fixed submission:


def dfs(string,n):
    if len(string)==n:
        print(string)
    else:
        s=string
        for i in range(97,max([ord(j)for j in string])+2):
            dfs(string+chr(i),n)
        

dfs("a",int(input()))

Buggy submission (verdict: Runtime Error):
n=int(input())
def d(s):
    if len(s)==n:print(s)
    else:for i in range(97,ord(max(s))+2):d(s+chr(i))
d("a")
Problem p02803 (python)

Fixed submission:
from collections import*
from copy import*
n,m=map(int,input().split())

grid=[list("#"*(m+2))]+[list("#"+input()+"#")for i in range(n)]+[list("#"*(m+2))]
#print(grid)

start=[]
for i in range(1,n+1):
    for j in range(1,m+1):
        start.append((i,j))

ans=0
for s in start:
    G=deepcopy(grid)
    if G[s[0]][s[1]]!="#":
        G[s[0]][s[1]]=0
    else:
        continue
    Q=deque([s])
    while Q:
        y,x=Q.pop()
        for my,mx in (-1,0),(1,0),(0,-1),(0,1):
            if G[y+my][x+mx]==".":
                G[y+my][x+mx]=G[y][x]+1
                Q.appendleft((y+my,x+mx))
    
    x=max( max([0]+[j for j in i  if type(j)==int]) for i in G)
    if x>ans:
        ans=x
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import*
from itertools import*
from copy import*
n,m=map(int,input().split())

grid=[tuple("#"*(m+2))]+[tuple("#"+input()+"#")for i in range(n)]+[tuple("#"*(m+2))]

#print(grid)

start=[]
for i in range(1,n+1):
    for j in range(1,m+1):
        start.append((i,j))

ans=0
for s,g in combinations(start,2):
    G=deepcopy(grid)
    if G[s[0]][s[1]]!="#":
        G[s[0]][s[1]]=0
    else:
        continue
    if G[g[0]][g[1]]=="#":
        continue
    Q=deque([s])
    while Q:
        y,x=Q.pop()
        for my,mx in (-1,0),(1,0),(0,-1),(0,1):
            if G[y+my][x+mx]==".":
                G[y+my][x+mx]=G[y][x]+1
                Q.appendleft((y+my,x+mx))
    
    if type(G[g[0]][g[1]])!=str:
        if ans<G[g[0]][g[1]]:
            ans=G[g[0]][g[1]]
print(ans)
Problem p02865 (python)

Fixed submission:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline

def main():
    n=int(input())
    ans=0
    for i in range(1,n):
        if (i!=n-i and i<n-i):
            ans+=1
        elif i>n-1:
            break
    print(ans)
    
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
from time import* 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline
input=sys.stdin.readline
t=time()

def main():
    n,m=map(int,input().split())
    x=[tuple(map(int,input().split()))for i in range(m)]
    y=sorted(x)
    start=set()
    for s,t,r in y:
        if s==1:
            start.add((1,t,r))
    ans=set([-1])
    substart=set()
    while 1:
        while start:
            qp,p,q=start.pop()
            for s,t,r in y:
                if t==n:
                    ans.add(q)
                elif s<=p and p<=t and s!=qp:
                    substart.add((p,t,q+r))
                    
        start=substart
        if time()-t>6:
            if len(ans)!=1:
                print(min(i for i in ans if i!=-1))
            else:
                print(-1)
            exit()
if __name__ == '__main__':
    main()
Problem p02918 (python)

Fixed submission:
from itertools import*

a,b=map(int,input().split())
s=input()
n=[len(list(v)) for k,v in groupby(s)]
print(min(sum(n)-len(n)+min(len(n)-1,b)*2,a-1))

Buggy submission (verdict: Runtime Error):
from itertools import*
from numpy import*
def section_sum(numbers,separate):
    sep1=array(numbers[separate:],dtype=int)
    sep2=array(numbers[:-separate],dtype=int)
    sep3=sum(numbers[:separate])
    return insert(sep3+cumsum(sep1-sep2),0,sep3)
    
    
n,k,a=open(0).read().split()
n,k=int(n),int(k)
ar=[len(list(v))for k,v in groupby(a)]

#print(ar)
if n<=k:
    print(sum(ar)-1)
else:
    ar2=[i-1 for i in ar]
    s=cumsum(ar2[::2])
    t=cumsum(ar2[1::2])
    mae=[0]+[t[i//2] if i%2 else s[i//2] for i in range(len(ar))]+[0,0,0]
    p=cumsum(ar2[::2][::-1])[::-1]
    q=cumsum(ar2[1::2][::-1])[::-1]
    usiro=[0]+[q[i//2] if i%2 else p[i//2] for i in range(len(ar))]+[0,0,0]
#    print(mae,usiro)
#    print([[[kk,kk+2*k+2],mae[kk],usiro[kk+2*k+2],vv] for kk,vv in enumerate(section_sum(ar,k*2+1))])
    print(max(mae[kk]+usiro[kk+2*k+2]+vv for kk,vv in enumerate(section_sum(ar,k*2+1)))-1)
Problem p02921 (python)

Fixed submission:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！
 
def main():
    s=input()
    t=input()
    ans=0
    for i in range(3):
        if s[i]==t[i]:
            ans+=1
    print(ans)
    
    
    
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
N=int(input());print(~-N*N//2)
Problem p02922 (python)

Fixed submission:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！
 
def main():
    a,b=map(int,input().split())
    if b>1:
        if b<=a:
            print(1)
        else:
            b-=a
            print((b-1)//(a-1)+2)
    else:
        print(0)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！
 
def main():
    s=input()
    t=input()
    ans=0
    for i in range(3):
        if s[i]==t[i]:
            ans+=1
    print(ans)
    
    
    
    
if __name__ == '__main__':
    main()