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

Fixed submission:
S = str(input())
T = str(input())
lens = len(S)
lent = len(T)
ans = []

for i in range(lens-lent + 1):
      count = 0
      U = S[i: i+lent]
      for j in range(lent):
            if U[j] != T[j]:
                count += 1
      ans.append(count)
print(min(ans))

Buggy submission (verdict: Runtime Error):
S = str(input())
T = str(input())
lens = len(S)
lent = len(T)
ans = []

for i in range(s-t + 1):
      count = 0
      U = S[i: i+t]
      for i in range(t):
            if U[j] != T[j]:
                count += 1
      ans.append(count)
print(min(ans))
Problem p03013 (python)

Fixed submission:
def run():
  N, M = map(int, input().split())
  stairs = [1] * (N+1)
  for m in range(M):
    a = int(input())
    stairs[a] = 0
  #print(stairs)
  for n in range(2, N+1):
    stairs[n] = (stairs[n-1] + stairs[n-2])*stairs[n]
  print(stairs[N]%1000000007)
  
if __name__ == '__main__':
  run()

Buggy submission (verdict: Runtime Error):
import sys
from math import factorial
#nCi
def com(n, i):
    return int(factorial(n)/factorial(i)/factorial(n-i))
    
def cal1(num):
    total = 1
    if num < 1: return total
    if num == 1: return 2
    large_num = num
    for small_num in range(1, num):
        if small_num > large_num: break
        total += com(large_num, small_num)
        large_num -= 1
    return total

def main():
    N, M = map(int, input().split())
    len_list = []
    pre_a = -1
    for m in range(M):
        a = int(input())
        if (pre_a + 1) == a: sys.exit("0")
        len_list.append(a-(pre_a+3))
        pre_a = a
    len_list.append(N-(pre_a+2))
    ans = 1
    for num in len_list:
        ans *= cal1(num)
    print(ans%1000000007)
    
main()

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

def cal2(n, i):
    return int(factorial(n)/factorial(i)/factorial(n-i))
    
def cal1(num):
    total = 1
    if num < 1: return total
    if num == 1: return 2
    i = num
    for n in range(1, num):
        if n > i: return total
        total += cal2(i, n)
        i -= 1

def main():
    N, M = map(int, input().split())
    len_list = []
    pre_a = -1
    for m in range(M):
        a = int(input())
        if (pre_a + 1) == a: sys.exit("0")
        len_list.append(a-(pre_a+3))
        pre_a = a
    len_list.append(N-(pre_a+2))
    ans = 1
    for num in len_list:
        ans *= cal1(num)
    print(ans%1000000007)
    
main()
Problem p03250 (python)

Fixed submission:
num = map(int, input().split())
num = sorted(num, reverse = True)
print(num[0]*10 + num[1] + num[2])

Buggy submission (verdict: Runtime Error):
num = map(int, input().split())
num = sorted(num, reverce = True)
print(num[0]*10 + num[1] + num[2])
Problem p02570 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
m = len(s)
n = len(t)
did = m -n
li = []
for i in range(did+1):
  su = 0
  for j in range(n):
    if t[j] ==s[i+j]:
      su +=0
    else:
      su +=1
  li.append(su)
print(min(li))

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

Fixed submission:
num = input()
le = len(num)
sum=0
for i in range(le):
  sum += int(num[i])
if sum%9==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x = inoput()
le = len(x)
sum = 0
for i in range(le):
  sum+=int(x[i])
print(sum)
Problem p02623 (python)

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

sa = [0] * (n+1)
sb = [0] * (m+1)
r = m
ans = 0

for i in range(n):
    sa[i+1] = sa[i] + a[i]
for i in range(m):
    sb[i+1] = sb[i] + b[i]

for i in range(n+1):
    if sa[i] > k:
        break
    while sa[i] + sb[r] > k:
        r -= 1
    ans = max(ans, i+r)
print(ans)

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

i = 0
j = 0
ans = 0

while k >= 0:
    if i <= n-1 and j <= m-1:
        k -= min(a_lsit[i], b_list[j])
        if a_lsit[i] < b_list[j]:
            i += 1
        else:
            j += 1
    elif i > n-1:
        k -= b_list[j]
        j += 1
    elif j > m-1:
        k -= a_lsit[i]
        i += 1

    if k < 0:
        break

    ans += 1
    
print(ans)
Problem p02831 (python)

Fixed submission:
A, B = map(int, input().split())
import fractions

print(int(A*B/fractions.gcd(A,B)))

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

def lcm(a, b):
    return int((a*b) // gcd(a, b))

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(a, b):
    return int((a*b) // math.gcd(a, b))

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

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

print((a*b) // math.gcd(a, b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(a, b):
    return (a*b) // math.gcd(a, b)

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

#最小公倍数を求める
def lcm(a, b):
    return (a*b) // math.gcd(a, b)

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

#最小公倍数を求める
def lcm(a, b):
    return (a*b) // math.gcd(a, b)

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

print(lcm(a, b))
Problem p02880 (python)

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

if n >= 82:
    print("No")
else:
    for i in range(1 , 10):
        ans = n // i
        if n == ans*i and ans <= 9:
            print("Yes")
            break
        elif i == 9:
            print("No")

Buggy submission (verdict: Runtime Error):
import sys

n = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i*j == n:
            print("Yes")
            sys.exit(1)
print("No")
Problem p02659 (python)

Fixed submission:
a,b = map(str,input().split())
a2 = int(a)
b2 = 100*int(b[0:1])+10*int(b[2:3])+int(b[3:4])
if a2 == 0 or b2 == 0:
    ans = 0
else:
    tmp = str(a2*b2)
    l = len(tmp)
    if l <= 2:
        ans = 0
    else:
        ans = int(tmp[0:l-2])
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
a2 = int(a)
b2 = 100*int(b[0:1])+10*int(b[2:3])+int(b[3:4])
if a2 == 0 or b2 == 0:
    ans = 0
else:
    tmp = str(a2*b2)
    l = len(tmp)
    ans = int(tmp[0:l-2])
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
a2 = int(a)
b2 = 100*int(b[0:1])+10*int(b[2:3])+int(b[3:4])
if b2 == 0:
    ans = 0
else:
    tmp = str(a2*b2)
    l = len(tmp)
    ans = int(tmp[0:l-2])
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
a2 = int(a)
b2 = 100*int(b[0:1])+10*int(b[2:3])+int(b[3:4])
tmp = str(a2*b2)
l = len(tmp)
ans = int(tmp[0:l-2])
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
a2 = int(a)
b2 = 100*int(b[0:1])+10*int(b[2:3])+int(b[3:4])
tmp = str(a2*b2)
l = len(tmp)
ans = int(tmp[0:l-2])
print(ans)
Problem p02699 (python)

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

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

Fixed submission:
n = input()
output = 'No'
if n[0] == '7' or n[1] == '7' or n[2] == '7':
    output = 'Yes'
print(output)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = s.count('R')*s.count('G')*s.count('B')
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] != s[j]:
            if 2*j-i <= n-1:
                if s[2*j-i] not in(s[i],s[j]):
                    cnt -= 1
print(cnt)
Problem p02753 (python)

Fixed submission:
a = input()
if a in ('AAA','BBB'):
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a = input()
if a = 'AAA' or 'BBB':
  print('No')
else:
  print('Yes')
Problem p02847 (python)

Fixed submission:
str = [input() for i in range(1)]

if str[0] == "SUN":
    print(7)
if str[0] == "MON":
    print(6)
if str[0] == "TUE":
    print(5)
if str[0] == "WED":
    print(4)
if str[0] == "THU":
    print(3)
if str[0] == "FRI":
    print(2)
if str[0] == "SAT":
    print(1)

Buggy submission (verdict: Runtime Error):
N = [input() for i in range(1)]
str = [input() for i in range(1)]
STRING=str[0]
enc = ""

for i in list(STRING):
    ASCII = ord(i)
    num = ASCII - 65
    num = (num + int(N[0])) % 26
    ASCII = num + 65
    enc += chr(ASCII)
print(enc)
Problem p02897 (python)

Fixed submission:
X = int(input())
a = 0
i =1
for i in range(X):
    if i%2==0:
        a = a+1
print(a/X)

Buggy submission (verdict: Runtime Error):
j = 1
a = 0
i = 0
N = 0

N = int(input())

#N=int(input())
mylist = [0]*N

h = [int(x) for x in input().split()]

for i in range(N):
    mylist[h[i]-1]=i+1
print(*mylist)
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())

if d <= t*s:
    print("Yes")
else:
    print("No")

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

sum=0
for i in range(N-1):
    for j in range(i+1,N):
        sum+=(A[i]*A[j])%(10**9+7)

print(sum%(10**9+7))
Problem p02571 (python)

Fixed submission:
s=input()
t=input()
if len(s)==len(t):
    cm=0
    for i in range(len(s)):
        if s[i]!=t[i]:
            cm+=1
else:
    cm=1000
    for i in range(len(s)-len(t)):
        cn=0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                cn+=1
        cm=min(cm,cn)

print(cm)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
if len(s)==len(t):
    mc=0
    for i in range(len(s)):
        if s[i]!=t[i]:
            mc=c+1
else:
    c=[0 for i in range(len(s)-len(t))]
    for i in range(len(s)-len(t)):
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                c[i]=c[i]+1

    mc=min(c)

print(mc)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
if len(s)==len(t):
    c=0
    for i in range(len(s)):
        if s[i]!=t[i]:
            c=c+1
else:
    c=[0 for i in range(len(s)-len(t))]
    for i in range(len(s)-len(t)):
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                c[i]=c[i]+1

print(min(c))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
c=[0 for i in range(len(s)-len(t))]
for i in range(len(s)-len(t)):
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            c[i]=c[i]+1

print(min(c))
Problem p02688 (python)

Fixed submission:
N,K = map(int,input().split())
data = []
nolist = list(range(1,N+1))
for i in range(K):
  number = int(input())
  data = input().split()
  for j in range(number):
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
number = 0
data = []
nolist = list(range(1,K+1))
for i in range(N):
  number = int(input())
  for j in range(number):
    data = input().split()
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
number = 0
data = []
nolist = list(range(1,K+1))
print(nolist)
for i in range(N):
  number = int(input())
  for j in range(number):
    data = input().split()
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))
Problem p02577 (python)

Fixed submission:
a = int(input())
print("Yes" if a % 9 == 0 else "No")

Buggy submission (verdict: Runtime Error):
a = input()
for i in range(len(a)):
  total = total + int(a[i])
print("Yes" if total % 9 == 0 else "No")
Problem p02711 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
print("Yes" if "7" in n else "No")

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

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

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

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

Fixed submission:
N, K = map(int, input().split())
b=0
while N>0:
  N=N//K
  b+=1
print(b)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
while N>K:
  a=N/K
  b+=1
print(b)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
while N<K:
  a=N/K
  b+=1
print(b)
Problem p02771 (python)

Fixed submission:
s = list(input().split())
print("Yes" if len(set(s)) == 2 else "No")

Buggy submission (verdict: Runtime Error):
s = [input().split()]
print("Yes" if len(set(s)) == 2 else "No")
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1 if S==U else A)
print(B if S==U else B-1)

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1 B if S==U else A B-1)
Problem p03135 (python)

Fixed submission:
T, X = map(int, input().split())
print(T / X)

Buggy submission (verdict: Runtime Error):
T, X = int(input().split())
print(T / X)

Buggy submission (verdict: Runtime Error):
T, X = int(input())
print(T / X)
Problem p02754 (python)

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

balls= 0
blue = 0

time = n // (a+b)
tmp = n % (a+b)
if tmp < a:
  blue = time*a + tmp
else:
  blue = (time+1)*a

print(blue)

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

balls= ""
count = 0
blue = 0

for i in range(10**18):
  count= count+1
  if count % 2 == 1:
    balls = balls +'b'*a
  else:
    balls = balls +'r'*b
  if i > n:
    break

for i in range(n):
  if balls[i] == 'b':
  	blue = blue+1

print(blue)

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

balls= ""
count = 0
blue = 0

while len(balls)<=n:
  count= count+1
  if count % 2 == 1:
    balls = balls +'b'*a
  else:
    balls = balls +'r'*b

for i in range(n):
  if balls[i] == 'b':
  	blue = blue+1

print(blue)
Problem p02570 (python)

Fixed submission:
inputs = input().split()
D = int(inputs[0])
T = int(inputs[1])
S = int(inputs[2])

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

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

min_count = len(T)
for s in range(len(S) - len(T) + 1):  # T cannot exceed the length of S
    matched = 0
    for i in range(len(T)):
        # print(f'S[{s + i}] == T[{i}]')
        if S[s + i] == T[i]:
            matched += 1
    count = len(T) - matched
    if count < min_count:
        min_count = count
print(min_count)
Problem p02577 (python)

Fixed submission:
n = int(input())

SUM = sum(list(map(int, str(n))))

if SUM % 9 == 0:
  print("Yes")
else:
  print("No")

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

a=0
result=0

for i in range(n-1):
  if A[i] > A[i+1]:
    a = A[i] - A[i+1]
    result += a
    
print(result)
Problem p02712 (python)

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

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

Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())
C = readline().decode().rstrip()

l, r = 0, N - 1
cnt = 0

while l < r:
    if C[l] == 'R':
        l += 1
    elif C[r] == 'W':
        r -= 1
    else:
        l += 1
        r -= 1
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())
C = readline().decode().rstrip()

w_idx = []
r_idx = []
for i, c in enumerate(C):
    if c == 'W':
        w_idx.append(i)
    else:
        r_idx.append(i)

m = r_idx[len(r_idx) // 2 - 1]

if (len(w_idx) == 0) | (len(r_idx) == 0):
    print(0)
    sys.exit()

cnt = 0
for w in w_idx:
    if w < m:
        cnt += 1

print(cnt)
Problem p02699 (python)

Fixed submission:
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S, W = map(int, read().split())

if W >= S:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S, W = map(int, read())

if W >= S:
    print("unsafe")
else:
    print("safe")
Problem p02777 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = readline().decode('utf-8').split()
a, b = map(int, readline().split())
u = read().decode('utf-8').rstrip()

if u == s:
    a -= 1
else:
    b -= 1

print(a, b)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = read().decode().split()
a, b = map(int, read().split())
u = read().decode()

if u == s:
    a -= 1
else:
    b -= 1

print(a, b)
Problem p02815 (python)

Fixed submission:
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

MOD = 1000000000 + 7
N = int(readline())
C = np.array(read().split(), np.int64)

C.sort()

ans = (C * np.arange(N+1, 1, -1) % MOD).sum() % MOD
ans *= pow(2, N+N-2, MOD)

print(ans % MOD)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

MOD = 1_000_000_000 + 7
N = int(readline())
C = np.array(read().split(), np.int64)

C.sort()

ans = (C * np.arange(N+1, 1, -1) % MOD).sum() % MOD
ans *= pow(2, N+N-2, MOD)

print(ans % MOD)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

MOD = 1_000_000_000 + 7
N = int(readline())
C = np.array(read().split(), np.int64)

C.sort()

ans = (C * np.arange(N+1, 1, -1) % MOD).sum() % MOD
ans *= pow(2, N+N-2, MOD)

print(ans % MOD)
Problem p02891 (python)

Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
from itertools import groupby
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = list(readline().decode().rstrip())
K = int(readline())

g = [len(list(g)) for _, g in groupby(S)]

if len(g) == 1:
    print(len(S) * K // 2)
else:
    acc = sum(l // 2 for l in g) * K
    if S[0] == S[-1] and g[0] % 2 == 1 and g[-1] % 2 == 1:
        acc += K - 1
    print(acc)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = readline().decode("utf-8").rstrip()
K = int(readline())

last = ""
cnt = 0
for s in S:
    if last == s:
         += 1
        last = ""
    else:
        last = s
        
print(cnt * K)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = int(readline().decode("utf-8").rstip())
K = int(readline())

last = ""
cnt = 0
for s in S:
    if last == s:
        cnt += 1
        last = ""
    else:
        last = s
        
print(cnt * K)
Problem p03221 (python)

Fixed submission:
import numpy as np

n, m = list(map(int, input().split()))
mat = np.zeros((m, 3))
for i in range(m):
	mat[i, 0], mat[i, 1] = list(map(int, input().split()))
	mat[i, 2] = i
mat = mat[mat[:, 1].argsort()]
cnt = np.zeros(n+1)
res = []
for i in mat[:, 0]:
	i = int(i)
	cnt[i-1] += 1
	res.append('{0:06d}{1:06d}'.format(i, int(cnt[i-1])))

for idx in np.argsort(mat[:, 2]):
	print(res[int(idx)])

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

n, m = list(map(int, input().split()))
mat = np.zeros((m, 2))
for i in range(m):
	mat[i, 0], mat[i, 1] = list(map(int, input().split()))
mat = np.c_[mat, np.array(range(m))]
mat = mat[mat[:, 1].argsort()]
cnt = np.zeros(m)
res = []
for i in mat[:, 0]:
	i = int(i)
	cnt[i] += 1
	res.append('{0:06d}{1:06d}'.format(i, int(cnt[i])))

for i in np.argsort(mat[:, 2]):
	print(res[int(i)])

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

n, m = list(map(int, input().split()))
mat = np.zeros((m, 2))
for i in range(m):
	mat[i, 0], mat[i, 1] = list(map(int, input().split()))
mat = np.c_[mat, np.array(range(m))]
mat = mat[mat[:, 1].argsort()]
cnt = np.zeros(m)
res = []
for i, in mat[:, 0]:
	i = int(i)
	cnt[i] += 1
	res.append('{0:06d}{1:06d}'.format(i, int(cnt[i])))

for i in np.argsort(mat[:, 2]):
	print(res[int(i)])

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

n, m = list(map(int, input().split()))
mat = np.zeros((m, 2))
for i in range(m):
	mat[i, 0], mat[i, 1] = list(map(int, input().split()))
mat = np.c_[mat, np.array(range(m))]
mat = mat[mat[:, 1].argsort()]
cnt = np.zeros(m)
res = []
for i, j in mat[:, :2]:
	i = int(i)
	cnt[i] += 1
	res.append('{0:06d}{1:06d}'.format(i, int(cnt[i])))

for i in np.argsort(mat[:, 2]):
	print(res[int(i)])

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

n, m = list(map(int, input().split()))
mat = np.zeros((m, 2))
for i in range(m):
	mat[i, 0], mat[i, 1] = list(map(int, input().split()))
mat = np.c_[mat, np.array(range(m))]
mat = mat[mat[:, 1].argsort()]
cnt = np.zeros(m)
res = []
print(cnt[2])
for i, j in mat[:, :2]:
	i = int(i)
	cnt[i] += 1
	res.append('{0:06d}{1:06d}'.format(i, int(cnt[i])))
#print(res)
#print(list(mat_[:, 2]))
for i in np.argsort(mat[:, 2]):
	print(res[int(i)])
#res_ = res[np.argsort(mat_[:, 2])]
#for r in res_:
#	print(r)
Problem p03252 (python)

Fixed submission:
import numpy as np
from string import ascii_lowercase
s = list(input())
t = list(input())

s_c = []
t_c = []

for a in ascii_lowercase:
  if s.count(a) != 0:
    s_c.append(s.count(a))
  if t.count(a) != 0:
    t_c.append(t.count(a))

if np.array_equal(sorted(s_c), sorted(t_c)):
	print('Yes')
else:
	print('No')

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

s = list(str(input()))
t = list(str(input()))

_, s_c = np.unique(s, return_counts=True)
_, t_c = np.unique(t, return_counts=True)
if np.array_equal(s_c, t_c):
	print('Yes')
else:
	print('No')