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

Fixed submission:
import numpy as np
max_change = 1000
s = input()
t = input()
list_t = np.array([ _ for _ in t])
if len(s) == len(t):
    list_s = np.array([ _ for _ in s])
    list_tf = list_t == list_s
    n_change = len(list_t) - sum(list_tf)
    if n_change < max_change:
        max_change = n_change
    else:
        pass
else:
    for i in range(1,len(s) - len(t) + 1):
        s_sample = s[i-1:len(t)+i-1]
        list_ss = np.array([ _ for _ in s_sample])
        list_tf = list_t == list_ss
        n_change = len(list_t) - sum(list_tf)
        if n_change < max_change:
            max_change = n_change
        else:
            pass
print(max_change)

Buggy submission (verdict: Runtime Error):
import numpy as np
max_change = 1000
s = input()
t = input()
list_t = np.array([ _ for _ in t])
for i in range(1,len(s) - len(t) + 1):
    s_sample = s[i-1:len(t)+i-1]
    list_ss = np.array([ _ for _ in list_ss])
    list_tf = list_t == list_ss
    n_change = len(list_t) - sum(list_tf)
    if n_change < max_change:
        max_change = n_change
    else:
        pass
print(max_change)

Buggy submission (verdict: Runtime Error):
import pandas as pd

def diffab(x):
    if x.a == x.b:
        return 1
    else:
        return 0

max_change = 1000

s = input()
t = input()
list_t = pd.Series([ _ for _ in t],name="a")

for i in range(1,len(s) - len(t) + 1):
    s_sample = s[i-1:len(t)+i-1]
    list_ss = pd.Series([ _ for _ in s_sample],name="b")
    df = pd.concat([list_t,list_ss],axis=1)
    df['flg'] = df.apply(lambda x:diffab(x),axis=1)
    n_change = len(list_t) - sum(df.flg)
    if n_change < max_change:
        max_change = n_change
    else:
        pass
print(max_change)
Problem p02578 (python)

Fixed submission:
n = input()
list_height = list(map(int, input().split()))
pre = 0
max_chair = 0
list_chair = list()
for i in list_height:
    if i < pre:
        max_chair = pre - i
        pre = i + max_chair
        list_chair.append(max_chair)
    else:
        pre = i
print(sum(list_chair))

Buggy submission (verdict: Runtime Error):
pre = 0
max_chair = 0
list_chair = []
for i in list_height:
    if i < pre:
        max_chair = pre - i
        pre = i + max_chair
        list_chair.append(max_chair)
    else:
        pre = i        
print(sum(list_chair))
Problem p02572 (python)

Fixed submission:
def main():
    n=int(input())
    mod = 10**9 + 7
    arr = sorted(map(int, input().split()))
    arr.reverse()

    sm = arr[0] + arr[1]
    ans = arr[0] * arr[1] % mod

    for x in range(2, len(arr)):
        ans += sm * arr[x]
        sm += arr[x]

    print(ans % mod)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    input()
    mod = 10**9 + 7
    arr = sorted(map(int, input().split()))
    arr.reverse()
	xxx=False
    sm = arr[0] + arr[1]
    ans = arr[0] * arr[1] % mod

    for x in range(2, len(arr)):
        ans += sm * arr[x]
        sm += arr[x]

    print(ans % mod)


if __name__ == '__main__':
    main()
Problem p02676 (python)

Fixed submission:
k=int(input())
s=input()

if len(s)<=k:
  print(s)
else:
  print(s[:k]+'...')

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

if len(s)<=k:
  print(s)
else:
  print(s[:k]+'...')
Problem p02835 (python)

Fixed submission:
a ,b ,c= map(int,input().split())
if a+b+c<=21:
  	print('win')
else:
	print('bust')

Buggy submission (verdict: Runtime Error):
a ,b ,c= map(int(),input().split())
if a+b+c<=21:
  	print(win)
else:
	print(bust)

Buggy submission (verdict: Runtime Error):
a ,b ,c= map(int,input().split())
if a+b+c<=21:
  	print(win)
else:
	print(bust)

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

if a+b+c<=21:
  print(win)
else:
  print(bust)
Problem p02595 (python)

Fixed submission:
import math
n = list(map(int, input().split()))
distance = n[1]
points = [list(map(int, input().split())) for i in range(n[0])]
ans = 0
for i in points:
    x = i[0]
    y = i[1]
    d = math.sqrt(x**2 + y**2)
    if d <= distance:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
distance = n[1]
points = [list(map(int, input().split())) for i in range(n[0])]
ans = 0
for i in points:
    x = i[0]
    y = i[1]
    d = (x**2 + y**2)**-2
    if d <= distance:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
distance = n[1]
points = [list(map(int, input().split())) for i in range(n[0])]
ans = 0
for i in points:
    x = i[0]
    y = i[1]
    d = math.sqrt(x**2 + y**2)
    if d <= distance:
        ans += 1
print(ans)
Problem p02836 (python)

Fixed submission:
s=input()
score=0

for i in range(0,int(len(s)/2)):
    if s[i]!=s[len(s)-1-i]:
        score+=1

print(score)

Buggy submission (verdict: Runtime Error):
s=input()
score=0
for i in range(0,len(s)/2+1):
  if s[i]!=s[len(s)-i]:
    score+=1
    
print(score)
Problem p02659 (python)

Fixed submission:
a, b = input().split()
A = int(a)
B = float(b)
B100 = round(100*B)
 
C=A*B100
print(str(C//100))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = float(input())
print(int(A*B))
Problem p02699 (python)

Fixed submission:
S,W = map(int, input().split())
print("unsafe" if W >= S else "safe")

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
print("unsafe" if W >= S else "safe")

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
s= int(input())
w = int(input())
if w >= s:
    print("unsafe")
else:
    print("safe")
Problem p02701 (python)

Fixed submission:
N = int(input())
li = []
while len(li) <N:
  li.append(input())
print(len(set(li)))

Buggy submission (verdict: Runtime Error):
N = int(input())
li = []
while len(li) <N:
  li.append(input())
print(len(set(lottery)))

Buggy submission (verdict: Runtime Error):
N = int(input())
li = []
while len(li) <N:
  li.append(input())
print(len(set(lottery))
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
l = input("Enter: ")
if len(l)<= 6 and l==[a-z]:
	print("Yes" if (l[2]==l[3] and l[4]==l[5]) else "No")

Buggy submission (verdict: Runtime Error):
l = input("Enter: ")
print("Yes" if (l[2]==l[3] and l[4]==l[5] else "No"))

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
	print(["Yes" if i[2]==i[3] and i[4]==i[5] else "No"])

Buggy submission (verdict: Runtime Error):
l = eval(input("Enter: "))
for i in len(l):
  if len(l)<=6:
    if i[2]==i[3] and i[4]==i[5]:
      print("Yes")
    elif l=="coffee-like":
      print("Yes")
    else:
      print("No")
  print("No")

Buggy submission (verdict: Runtime Error):
i = eval(input("Enter your words: "))
if (i[2]==i[3]) and (i[4]==i[5]:
      print("Yes")
elif i=="coffee-like":
    print("Yes")
else:
      print("No")

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
  print("Yes" if (i[2]==i[3] and i[4]==i[5]) "Yes" if letters=="coffee-like" else "No")

Buggy submission (verdict: Runtime Error):
i = eval(input("Enter: "))
print(["Yes" if (i[2]==i[3] and i[4]==i[5]) "Yes" if letters=="coffee-like" else "No"])

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
if letters.index(2)==letters.index(3) and letters.index(4)==letters.index(5):
  print("Yes)
elif letters=="coffee-like":
  print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
  print(["Yes" if (i[2]==i[3] and i[4]==i[5]) "Yes" if letters=="coffee-like" else "No"])

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
  if i[2]==i[3] and i[4]==i[5]:
    print("Yes")
  elif letters=="coffee-like":
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
	print("Yes" if i[2]==i[3] and i[4]==i[5] else "No")

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
	print(["Yes" if i[2]==i[3] and i[4]==i[5] else "No"])

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter: "))
for i in letters:
	print(["Yes" if i[2]==i[3] and i[4]==i[5] else "No"])

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter your words: "))
for i in letters:
  print(["Yes" if (i[2]==i[3] and i[4]==i[5]) else "NO" )

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter your words: "))
for i in letters:
  print(["Yes" if (i[2]==i[3] and i[4]==i[5]) else "NO" )

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter your words: "))
for i in letters:
  if i[2]==i[3] and i[4]==i[5]:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
letters = eval(input("Enter your words: "))
for i in letters:
  if (i[2]==i[3]) and (i[4]==i[5]:
      print("Yes")
  else:
      print("No")
Problem p02577 (python)

Fixed submission:
n = list(map(int, input()))
if sum(n)%9==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = list(map(int, input()))
if stm(n)%9==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = list(map(int, input()))
if stm(n)%9==0:
  print('Yes')
else:
  print('No')
Problem p02623 (python)

Fixed submission:
from itertools import zip_longest, count, accumulate
from bisect import bisect, bisect_left
 
def LIST(): return list(map(int, input().split()))
 
n, m, k = map(int, input().split())
a = [0] + list(accumulate(LIST()))
b = list(accumulate(LIST()))
 
num = 0
 
for i, a in enumerate(a):
    time_rest = k - a
    
    if time_rest < 0:
        continue
    
    num = max(num, i + bisect(b, time_rest))
 
print(num)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt=0

if k - min([a[0], b[0]]) < 0:
  print(0)
  exit()

while k>0:
  if a[0] < b[0]:
    k -= a.pop(0)
  elif a[0] > b[0]:
    k -= b.pop(0)
  else:
    if a[1] < b[1]:
      k -= a.pop(0)
    else:
      k -= b.pop(0)
  cnt += 1

print(cnt)
Problem p02682 (python)

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

if k-a>0:
    num += a
    k-=a
    if k-b>0:
        k -= b
        print(num-k)
    else:
        print(num)
else:
    print(k)

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

n = [1]*a + [0]*b + [-1]*c

print(sum(n[:k]))
Problem p02880 (python)

Fixed submission:
n = int(input())
frag = 0

for i in range(1, 10):
  if n / i <= 9 and n % i == 0:
    frag = 1

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

Buggy submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = int(input())

tmp = prime_factorize(n)

if n = 1 or len(tmp) != 0:
  print("Yes")
else:
  print("No")
Problem p02572 (python)

Fixed submission:
n = int(input())

An = [int(i) for i in input().split()]
S = sum(An)
Sn = S**2
Sn2 = 0
for a in An:
    Sn2 += a**2

ans = ((Sn - Sn2)//2)%(10**9+7)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = (int(x) for x in input().split())
friendlist = [0]*n
classes = 1
for i in range(m):
    a,b = (int(x)-1 for x in input().split())
    if friendlist[a]!=0 and friendlist[b]!=0:
        continue
    elif friendlist[a]!=0:
        friendlist[b] = friendlist[a]
    elif friendlist[b]!=0:
        friendlist[a] = friendlist[b]
    else:
        friendlist[a] = classes
        friendlist[b] = classes
        classes += 1

count = [0]*classes
maxa = 0
for i in range(n):
    count[friendlist[i]] += 1
    maxa = max([count[friendlist[i]],maxa])

print(maxa)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal

a,b = (Decimal(str(x)) for x in input().split())

c = a*b

print(int(c))

Buggy submission (verdict: Runtime Error):
import math

a,b = (int(x) for x in input().split())
print(math.floor(a*b))
Problem p02879 (python)

Fixed submission:
import sys
 
input = sys.stdin.readline
 
a,b = (int(x) for x in input().split())
 
if a>9 or b>9:
    print(-1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
import fractions

input = sys.stdin.readline

a,b = (int(x) for x in input().split())

if a>9 or b>9:
    print(-1)
else:
    print(a*b)
Problem p02880 (python)

Fixed submission:
import sys
import math
import os

input = sys.stdin.readline

n = int(input())

for i in range(1,10):
    if n%i==0:
        if n//i<=9:
            print("Yes")
            exit()
print("No")

Buggy submission (verdict: Runtime Error):
import fractions
import math
import os

input = sys.stdin.readline

n = int(input())

for i in range(1,9):
    if n%i==0:
        if n//i<=9:
            print("Yes")
            exit()
print("No")
Problem p03072 (python)

Fixed submission:
n = int(input())
high = [int(i) for i in input().split()]
ans = 0
max = 0
for i in range(n):
    if max<=high[i]:
        ans += 1
        max = high[i]

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
high = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    if max>=high[i]:
        ans += 1
        max = high[i]

print(ans)
Problem p03073 (python)

Fixed submission:
color = [int(i) for i in input()]
n = len(color)
ans = 0

if n%2==1:
    arfa = [1,0]*(n//2) + [1]
    beta = [0,1]*(n//2) + [0]
else:
    arfa = [1,0]*(n//2)
    beta = [0,1]*(n//2)

ansa=0;ansb=0
for i in range(n):
    if color[i]!=arfa[i]:
        ansa += 1
    if color[i]!=beta[i]:
        ansb += 1
print(min([ansa,ansb]))

Buggy submission (verdict: Runtime Error):
color = [int(i) for i in input()]
n = len(color)
ans = 0

if n%2==1:
    arfa = [10]*n//2 + [1]
    beta = [01]*n//2 + [0]
else:
    arfa = [10]*n//2
    beta = [01]*n//2

ansa=0;ansb=0
for i in range(n):
    if color[i]!=arfa[i]:
        ansa += 1
    if color[i]!=beta[i]:
        ansb += 1
print(min([ansa,ansb]))
Problem p02699 (python)

Fixed submission:
s,w =map(int,input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
s,w =map(int(input().split()))
if s<=w:
  print('unsafe')
else:
  print('safe')
Problem p02990 (python)

Fixed submission:
mod = 10**9+7
from math import factorial

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

def comb(n,k):
    if (k<0 or k>n):
        return 0
    k = min(k,n-k)
    return g1[n]*g2[k]*g2[n-k] % mod

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

if N==K:
    print(1)
    for i in range(K-1):
        print(0)

else:
    for i in range(1,K+1):
        blue=0
        red=0

        if K>=i:
            blue=comb(K-1,i-1)
        for j in [i-1,i,i+1]:
            if N-K>=j and j>0:
                if i!=j:
                    red += comb(N-K-1,j-1)
                else:
                    red += 2*comb(N-K-1,j-1) % mod
        print(blue*red % mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
from math import factorial
def comb(n,k):
    return int(factorial(n)/(factorial(n-k)*factorial(k))) % mod

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

if N==K:
    print(1)
    for i in range(K-1):
        print(0)

else:
    for i in range(1,K+1):
        blue=0
        red=0

        if K>=i:
            blue=comb(K-1,i-1)
        for j in [i-1,i,i+1]:
            if N-K>=j and j>0:
                if i!=j:
                    red += comb(N-K-1,j-1)
                else:
                    red += 2*comb(N-K-1,j-1) % mod
        print(blue*red % mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
from math import factorial
def comb(n,k):
    return int(factorial(n)/(factorial(n-k)*factorial(k))) % mod

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

if N==K:
    print(1)
    for i in range(K-1):
        print(0)
else:
    for i in range(1,K+1):
        blue=0
        red=0

        if K>=i:
            blue=comb(K-1,i-1)
        for j in [i-1,i,i+1]:
            if N-K>=j and j>0:
                if i!=j:
                    red += comb(N-K-1,j-1)
                else:
                    red += 2*comb(N-K-1,j-1) % mod
        print(blue*red % mod)
Problem p03038 (python)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
BC = []

for i in range(M):
    b,c = map(int,input().split())
    BC.append([b,c])

BC.sort(key=lambda x:x[1],reverse=True)

ind = 0
ans = 0
for b,c in BC:
    if c > A[min(ind+b,N-1)]:
        ans += c * min(b,N-ind)
        ind += b
    else:
        while c > A[ind]:
            ans += c
            ind += 1
    if ind >= N:
        print(ans)
        exit()
print(ans + sum(A[ind:]))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
BC = []

for i in range(M):
    b,c = map(int,input().split())
    BC.append((b,c))

BC.sort(key=lambda x:x[1],reverse=True)

ind = 0
for b,c in BC:
    for i in range(b):
        if A[ind]>=c or ind==N:
            print(sum(A))
            exit()
        elif ind<N:
            A[ind]=c
            ind+=1

print(sum(A))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
BC = []

for i in range(M):
    b,c = map(int,input().split())
    BC.append((b,c))

BC.sort(key=lambda x:x[1],reverse=True)

ind = 0
for b,c in BC:
    for i in range(b):
        if A[ind]>=c or ind==N:
            print(sum(A))
            exit()
        else:
            A[ind]=c
            ind+=1

print(sum(A))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
BC = []

for i in range(M):
    b,c = map(int,input().split())
    BC.append((b,c))

BC.sort(key=lambda x:x[1],reverse=True)

ind = 0
for b,c in BC:
    for i in range(b):
        if A[ind]>c or ind==N:
            print(sum(A))
            exit()
        else:
            A[ind]=c
            ind+=1

print(sum(A))
Problem p03108 (python)

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

from collections import defaultdict
import sys
sys.setrecursionlimit(10**5)

par=[i for i in range(N+1)]

def root(x):
    if par[x]==x:
        return x
    else:
        par[x]=root(par[x])
        return par[x]
def same(x,y):
    return root(x)==root(y)
def unite(x,y):
    x=root(x)
    y=root(y)
    if(x!=y):
        par[x]=y

A=[]
B=[]
for i in range(M):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)

d=defaultdict(lambda:1)
ans=[-1 for i in range(M)]

ic=(N*(N-1))//2

for i in range(M):
    j=M-i-1
    ans[j]=ic
    a=A[j]
    b=B[j]
    if not same(a,b):
        anum=d[par[a]]
        bnum=d[par[b]]
        ic-=anum*bnum
        unite(a,b)
        d[par[b]]=anum+bnum
for i in range(M):
    print(ans[i])

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

par=[i for i in range(N+1)]

def root(x):
    if par[x]==x:
        return x
    else:
        par[x]=root(par[x])
        return par[x]

def same(x,y):
    return root(x)==root(y)

def unite(x,y):
    x=root(x)
    y=root(y)
    if(x!=y):
        par[x]=y

A=[]
B=[]
for i in range(M):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)

from collections import defaultdict
d=defaultdict(lambda:1)
ans=[-1 for i in range(M)]

ic=(N*(N-1))//2

for i in range(M):
    j=M-i-1
    ans[j]=ic
    a=A[j]
    b=B[j]
    if not same(a,b):
        anum=d[par[a]]
        bnum=d[par[b]]
        ic-=anum*bnum
        unite(a,b)
        d[par[a]]=anum+bnum
for i in range(M):
    print(ans[i])
Problem p03127 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=min(A)
S={n%a for n in A if n%a!=0}

while len(S)>0:
    tmp=a
    a=min(S)
    S={n%a for n in S if n%a!=0}
    if tmp%a!=0:
        S.add(tmp%a)
print(a)

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
  if a<=b:
    return gcd(b,a)
  elif a%b==0:
    return b
  else:
    return gcd(b,a%b)
N=int(input())
A=list(map(int,input().split()))
ans=A[0]
for a in A:
  ans=gcd(ans,a)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(int,input().split())
ans=A[0]
for i in range(1,N):
  s=ans
  t=A[i]
  if t%ans!=0:
    s=t%ans
  t=A[i]
  if ans%t!=0:
    t=t%ans
  ans=min(s,t)
print(ans)
Problem p03221 (python)

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

l1 = [[] for i in range(n)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p-1].append(y)
    l2.append((p,y))

dic = {}

for p in range(n):
    l1[p].sort()
    for i in range(len(l1[p])):
        dic[l1[p][i]] = i+1
        

for i in range(m):
    p = l2[i][0]
    k = dic[l2[i][1]]
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)

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

l1 = [[] for i in range(n)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p].append(y)
    l2.append((p,y))

for p in range(n):
    l1[p].sort()

for i in range(m):
    p = l2[i][0]
    k = l1[p].index(l2[i][1])+1
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)

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

l1 = [[] for i in range(m)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p].append(y)
    l2.append((p,y))

for p in range(n):
    l1[p].sort()

for i in range(m):
    p = l2[i][0]
    k = l1[p].index(l2[i][1])+1
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)
Problem p03295 (python)

Fixed submission:
N,M=map(int,input().split())
d = [list(map(int,input().split())) for _ in range(M)]

d.sort(key=lambda x:x[1])
ans=0
c=0
for i in range(M):
    a,b=d[i]
    if a>=c:
        ans+=1
        c=b
print(ans)

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

demands= []

for i in range(m):
    demands.append(list(map(int,input().split())))

demans.sort()

cut = []

for d in demands:
    flag = True
    for c in cut:
        if c[0] < d[1] and c[1] > d[0]:
            flag = False
            c[0] = max(c[0],d[0])
            c[1] = min(c[1],d[1])
            break
    if flag:
        cut.append(d)

print(len(cut))
Problem p02711 (python)

Fixed submission:
a=input()

if "7" in a:
  print("Yes")
else:
  print("No")

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

b=input()
c=a-1
d=0

for i in range(c):
  for j1 in range(c-i):
    j=j1+i+1

    if b[i]!=b[j]:
      for k1 in range(c-j):
        k=k1+j+1
        #print(i,j,k)

        if b[k]!=b[i] and b[k]!=b[j]:
          if j-i != k-j:
            d=d+1
print(d)
Problem p02552 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if b * d >= 0:
  print(b * d)
else:
  z = []

  for x in range(a, b + 1):
    for y in range(c, d + 1):
      z.append(x * y)
print(max(z))
Problem p02699 (python)

Fixed submission:
a, b = map(int, input().split())
if a > b:
  print('safe')
else:
  print('unsafe')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if a / d > c / d:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
c / b 
a / d
if a / d > c / d:
  print('Yes')
else:
  print('No')
Problem p02711 (python)

Fixed submission:
a = input()
if a.count('7') == 0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a = input()
if a.count(7) == 0:
  print('Yes')
else:
  print('No')