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

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]
#input_list = [list(map(int, input().split())) for i in range(N)]

ans = ""
if N%10 == 0:
    ans = "pon"
elif N%10 == 1:
    ans = "pon"
elif N%10 == 2:
    ans = "hon"
elif N%10 == 3:
    ans = "bon"
elif N%10 == 4:
    ans = "hon"
elif N%10 == 5:
    ans = "hon"
elif N%10 == 6:
    ans = "pon"
elif N%10 == 7:
    ans = "hon"
elif N%10 == 8:
    ans = "pon"
elif N%10 == 9:
    ans = "hon"

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
N = int(input())
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]
#input_list = [list(map(int, input().split())) for i in range(N)]

ans = ""
if N%10 == 0:
    ans = "pon"
elif N%10 = 1:
    ans = "pon"
elif N%10 = 2:
    ans = "hon"
elif N%10 = 3:
    ans = "bon"
elif N%10 = 4:
    ans = "hon"
elif N%10 = 5:
    ans = "hon"
elif N%10 = 6:
    ans = "pon"
elif N%10 = 7:
    ans = "hon"
elif N%10 = 8:
    ans = "pon"
elif N%10 = 9:
    ans = "hon"

print(ans)
Problem p02687 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
s = input()
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]


if s=="ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
s = input()
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]


if s==ABC:
    print("ARC")
else:
    print("ABC")
Problem p02700 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C, D = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

while(1):
    C = C-B
    if C <= 0:
        print("Yes")
        break
    A = A-D
    if A <= 0:
        print("No")
        break

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
S, W = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

if S <= W:
    print("unsafe")
else:
    print("safe")
Problem p02708 (python)

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

import itertools

# スペース区切りの整数の入力
N, K = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

#list = []
#for i in range(N+1):
#    list.append(i)

#print(list)

#print(range(N+1))

ans=0

i=K
while(i<=N+1):
    #print("i:"+str(i))
    #comb=combinationListRecursive(list, i)
    #comb = list(itertools.combinations(range(N+1), i))
    #print(comb)
    #tmp=[]
    #min=0
    #max=0
    #j=0
    #while(j<=i-1):
        #min = min+j
        #max = max+(N-j)
        #j=j+1
    max=((N-i+1+N)*i)/2
    min=((0+i-1)*i)/2
    #print("max:"+str(max))
    #print("min:"+str(min))
    #print("diff:"+str(max-min+1))
    ans=ans+(max-min)+1

    i=i+1


print(int(ans)%1000000007)

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

def combinationListRecursive(data, r):
  if r == 0 or r > len(data):
    return []

  result = []
  _combinationListRecursive(data, r, 0, [], result)
  return result


def _combinationListRecursive(data, r, start, progress, result):
  if r == 0:
    result.append(progress)
    return

  for i in range(start, len(data)):
    #別解 _combinationListRecursive(listExcludedIndices(data, [i]), r - 1, i, progress + [data[i]], result)
    _combinationListRecursive(data, r - 1, i + 1, progress + [data[i]], result)

# スペース区切りの整数の入力
N, K = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

list = []
for i in range(N+1):
    list.append(i)

#print(list)

ans=0

i=K
while(i<=N+1):
    comb=combinationListRecursive(list, i)
    #print(comb)
    tmp=[]
    for com in comb:
        sum=0
        for co in com:
            sum = sum+co
        if sum in tmp:
            continue
        else:
            tmp.append(sum)
            ans = ans+1
    i=i+1


print(ans)
Problem p02641 (python)

Fixed submission:
#C
import numpy as np
x, n = map(int, input().split())

if n!=0:
    p_list = list(map(int, input().split()))
    kouho = list(range((x-n//2-1),(x+n//2+1)))    
    kouho2 = list(set(kouho) - set(p_list))
    ans = [j for i, j in enumerate(kouho2) if abs(j-x) == min(abs(np.array(kouho2) - x))]
    ans = min(ans)

else:
    ans = x

print(ans)

Buggy submission (verdict: Runtime Error):
#C
import numpy as np
x, n = map(int, input().split())

if n!=0:
    p_list = list(map(int, input().split()))
    
    if n%2==0:
        kouho = list(range((x-n//2-1),(x+n//2)))
    else:
        kouho = list(range((x-n//2-1),(x+n//2+1)))
        kouho2 = set(kouho) - set(p_list)
        ans = [j for i, j in enumerate(list(kouho2)) if abs(j-x) == min(abs(np.array(list(kouho2)) - x))]
        ans = min(ans)

else:
    ans = [x]

print(ans)
Problem p02705 (python)

Fixed submission:
r = int(input())

import math

print(math.pi*2*r)

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

# r_list = []
# for i in range(n+1):
#     r_list.append(a_list.count(i))

# n = 5
# a_list = [1,1,2,2]

r_list = map(a_list.count, range(n+1))
r_list = list(r_list)
r_list2 = map(str, r_list[1:])
r_list2 = list(r_list2)

ans = "\n".join(r_list2)

print(ans)

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

print(math.pi* 2 * r)

Buggy submission (verdict: Runtime Error):
r = int(input())
import numpy

print(math.pi*2*r)
Problem p02717 (python)

Fixed submission:
X, Y, Z = map(int, input().split(' '))
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
N, M = input().split(' ')
lis1 = input().split(' ')
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[M - 1] < thresh:
  print 'No'
else:
  print 'Yes'

Buggy submission (verdict: Runtime Error):
X, Y, Z = input()
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X Y Z = input()
print Z, X, Y

Buggy submission (verdict: Runtime Error):
X Y Z = input()
she = 0
she = X
X = Y
Y = she
she = Z
Z = X
X = she
print X, Y, Z
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split(' '))
lis1 = list(map(int, input().split(' ')))
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[-M] < thresh:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split(' '))
lis1 = map(int, input().split(' '))
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[-M] < thresh:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N, M = input().split(' ')
lis1 = map(int, input().split(' '))
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[M - 1] < thresh:
  print 'No'
else:
  print 'Yes'

Buggy submission (verdict: Runtime Error):
N, M = input()
lis1 = input().split(' ')
S = sum(lis1)
thresh = S / (4 * M)
lis2 = sorted(lis1)
if lis2[M - 1] < thresh:
  print 'No'
else:
  print 'Yes'
Problem p02719 (python)

Fixed submission:
N, K = map(int, input().split(' '))
if 2 * N < K:
    print(N)
else:
    a = N // K
    mm = min(abs(N - a * K), abs(N - (a + 1) * K))
    print(mm)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split(' '))
if 2 * N < K:
    return N
else:
    a = N // K
    mm = min(abs(N - a * K), abs(N - (a + 1) * K))
    return mm

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split(' '))
if 2N < K:
    print(N)
else:
    a = N // K
    print(min(abs(N - a * K), abs(N - a * (K + 1))))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split(' '))
if 2N < K:
    return N
else:
    a = N // K
    return min(abs(N - a * K), abs(N - a * (K + 1)))
Problem p02573 (python)

Fixed submission:
from collections import defaultdict, deque
n, m = map(int, input().split())
g = defaultdict(set)

if m == 0:
    print(1)

else:
    for _ in range(m):
        a, b = map(int, input().split())
        g[a - 1].add(b - 1)
        g[b - 1].add(a - 1)


    visited = [False]*n
    ans = 0
    for i in range(n):
        if not visited[i]:
            # cc = []
            count = 1
            q = deque([i])
            visited[i] = 1
            while q:
                node = q.pop()
                for nbr in g[node]:
                    if not visited[nbr]:
                        q.append(nbr)
                        visited[nbr] = True
                        count += 1
                
            # ans = max(ans, len(cc))
            ans = max(ans, count)

    print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



from collections import defaultdict
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i] and i in g:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



from collections import defaultdict
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



import sys
from collections import defaultdict
input = sys.stdin.readline
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)
Problem p02628 (python)

Fixed submission:
from sys import stdin
from collections import defaultdict as dd
from collections import deque as dq
import itertools as it
from math import sqrt, log, log2
from fractions import Fraction

n, k = map(int, input().split())
nums = list(map(int, stdin.readline().split()))
nums.sort()
print(sum(nums[:k]))

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

print(sum(sorted(nums))[:k])
Problem p02657 (python)

Fixed submission:
from sys import stdin, stdout
n, m = map(int, stdin.readline().strip().split())
print(n*m)

Buggy submission (verdict: Runtime Error):
n, m = map(int, stdin.readline().strip().split())
print(n*m)
Problem p02663 (python)

Fixed submission:
from sys import stdin, stdout
# t = int(input())
# for _ in range(t):
    # n = int(stdin.readline())
h1, m1, h2, m2, k = map(int, stdin.readline().strip().split())
    # nums = list(map(int, stdin.readline().strip().split()))

t = (h2*60 + m2 - (h1*60 + m1) -  k)
print(t if t>0 else 0)

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
n = int(stdin.readline())
nmleaves = list(map(int, stdin.readline().strip().split()))

# pref[i]: sum of all elements in nmleaves after i, i.e. sum(nmleaves[i+1:])
full = sum(nmleaves)
tot = 0
pref = [0]*(n+1)
for i, l in enumerate(nmleaves):
    tot += l
    pref[i] = full - tot

if n==0:
    print(0)

else:
    if nmleaves[0]!=0:
        print(-1)
        exit()
    
    ## it exists
    ans = 0
    for level, leaves in enumerate(nmleaves):
        if leaves > 2**(level):
            print(-1)
            exit()

        if level == 0:
            ans += 1
            validnom = 1
        else:
            maxup = 2*validnom
            maxnom = maxup - leaves

            if level+1<len(nmleaves):
                validnom = min(maxnom, pref[level])
                ans += (leaves + validnom)
            else:
                ans += leaves
    print(ans)
Problem p02665 (python)

Fixed submission:
from sys import stdin, stdout
n = int(stdin.readline())
nmleaves = list(map(int, stdin.readline().strip().split()))

if nmleaves[0]:
   if n == 0 and nmleaves[0] == 1:
      print(1)
   else:
      print(-1)
   exit()

# pref[i]: sum(nmleaves[i:]), i.e., the number of leaves at or below level i.
pref = [0]*(n+1)
totsum = sum(nmleaves)
pref[0] = totsum
t = 0
for i in range(1, n+1):
    t += nmleaves[i-1]
    pref[i]  = totsum - t

prev_nl = 1
ans = 1
for lev in range(1, n+1):
    nodes = min(prev_nl*2, pref[lev])
    ans += nodes
    prev_nl = nodes - nmleaves[lev]
    if prev_nl < 0:
        print(-1)
        exit()
    elif prev_nl == 0 and lev+1<n+1 and pref[lev + 1]>0:
        print(-1)
        exit()
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
n = int(stdin.readline())
nmleaves = list(map(int, stdin.readline().strip().split()))

if n == 0:
    print(0)
else:
    if nmleaves[0]!= 0:
        print(-1)
        exit()
    
    # pref[i]: sum(nmleaves[i:]), i.e., the number of leaves at or below level i.
    pref = [0]*(n+1)
    totsum = sum(nmleaves)
    pref[0] = totsum
    t = 0
    for i in range(1, n+1):
        t += nmleaves[i-1]
        pref[i]  = totsum - t

    prev_nl = 1
    ans = 1
    for lev in range(1, n+1):
        nodes = min(prev_nl*2, pref[lev])
        ans += nodes
        prev_nl = nodes - nmleaves[lev]
        if prev_nl < 0:
            print(-1)
            exit()
        elif prev_nl == 0 and pref[lev + 1]>0:
            print(-1)
            exit()
    print(ans)
Problem p02687 (python)

Fixed submission:
s = input()
if s =='ABC':
  print('ARC')
if s == 'ARC':
  print('ABC')

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

root = int(x**(0.2))

flag = 0
for i in range(root - 400, root + 400):
    for j in range(-100, root + 400):
        if i!=j:
            if x%(i-j) == 0:
                if i**5-j**5 == x:
                    print(i, j)
                    flag = 1
                    break
    if flag:
        break

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

root = int(x**(0.2))

flag = 0
for i in range(root - 100, root + 100):
    for j in range(-40, root):
        if i!=j:
            if x%(i-j) == 0:
                if i**5-j**5 == x:
                    print(i, j)
                    flag = 1
                    break
    if flag:
        break
Problem p03161 (python)

Fixed submission:
n, k = map(int, input().split())
heights = list(map(int, input().split()))
heights = [0] + heights
dp = [10**10]*(n+1)
dp[1] = 0

for i in range(1, n+1):
    for step in range(1, k+1):
        if (i + step) <= n:
            dp[i+step] = min(dp[i+step], abs(heights[i+step] - heights[i]) + dp[i])
print(dp[n])

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

import math
# dp[i] stores the minimum cost to reach step i (starting from step 1) i: 1->N
dp = [math.inf]*(n+1)
dp[1] = 0

for i in range(2, n+1):
    for ss in range(1, k+1): # ss: step size
        if i-ss >= 1:
            dp[i] = min(dp[i], dp[i-ss] + abs(hlist[i-1] - hlist[i - ss - 1]))

print(dp[n])
Problem p02645 (python)

Fixed submission:
s = input()
print(s[:3])

Buggy submission (verdict: Runtime Error):
import math
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
 
if w >= v:
    print('No')
else:
    for i in range(1,t+1):
        if abs(a-b) <= (w-v)*i:
            print('Yes')
            break

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

 
if w >= v:
    print('No')
else:
    for i in range(1,t+1):
        a_place = a + v*i
        b_place = b + w*i
        if a_place - b_place = 0:
            print('Yes')
            break
Problem p02646 (python)

Fixed submission:
a, v = map(int,input().split())
b, w = map(int,input().split())
t = int(input())
 
 
if (abs(a-b) <= (v- w)*t):
    print('YES')
else:
    print('NO')

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

if w >= v:
    print('NO')
else:
    kyori = abs(a-b)
    time = kyori - (v-w)
    if t >= kyori/time:
        print('YES')
    else:
        print('NO')

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

if w >= v:
    print('No')
else:
    kyori = abs(a-b)
    time = kyori - (v-w)
    if t >= kyori/time:
        print('YES')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
 
 
if w >= v:
    print('No')
else:
    for i in range(1,t+1):
        a_place = a + v*i
        b_place = b + w*i
        if a_place - b_place = 0:
            print('Yes')
            break
Problem p02657 (python)

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

print(a *b)

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


for i in range(n):
    if 0 in a:
        f = 0
        break
    else:
        f *= a[i]
    
if f <= 10**18:
    print(f)
else:
    print(-1)
Problem p02664 (python)

Fixed submission:
t = input()
print(t.replace("?", "D"))

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

times = len(T)

list = []

for i in range(times):
    if i == len(T):
        if T[i] == 'P' or T[i] == 'D':
            list.append(T[i])
        else:
            list.append('D')
    
    else:
        if T[i] == '?':
            list.append('D')
        else:
            if T[i+1] == '?' or T[i+1] == 'D':
                list.append('P')
            else:
                list.append('D')

print(''.join(list))
Problem p02630 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ma=10**5
a2=[0]*ma
for ii in a:
  a2[ii-1]+=1

def func(a2):
  r=0
  for jj in range(len(a2)):
     r+= a2[jj]*(jj+1)
  return r

r=func(a2)
q=int(input())
for ii in range(q):
  b,c=map(int,input().split())
  r+=(c-b)*a2[b-1]
  a2[c-1]+=a2[b-1]
  a2[b-1]=0
  print(r)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
sa=set(a)
ma=max(a)
a2=[0]*ma
for ii in a:
  a2[ii-1]+=1

def func(a2):
  r=0
  for jj in range(len(a2)):
     r+= a2[jj]*(jj+1)
  return r

r=func(a2)
q=int(input())
for ii in range(q):
  b,c=map(int,input().split())
  r+=(c-b)*a2[b-1]
  a2[c-1]+=a2[b-1]
  a2[b-1]=0
  print(r)
Problem p02983 (python)

Fixed submission:
m=2019
l,r=map(int,input().split())

if l==0 or l//m<r//m or l%m==0:
  print(0)
  exit()

import numpy as np
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=((ii%m)*(jj%m))%m
    if t==0:
        print(0)
        exit()
    if t<lr:
      lr=t
print(lr)

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

if l==0 or l//m>r//m or r%m==0:
  print(0)
  exit()

import numpy as np
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=((ii%m)*(jj%m))%m
    if t==0:
        print(0)
        exit()
    if t<lr:
      lr=t
print(lr)

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

if l==0 or l%m>r%m or m*(r%m)==r:
  print(0)
  exit()

import numpy as np
si=set()
for ii in np.arange(l,r):
  si.add(ii%m)
sj=set()
for jj in np.arange(l+1,r+1):
  sj.add(jj%m)

lr=m
for ii in si:
  for jj in sj:
    t=(ii*jj)%m
    if t==0:
        print(0)
        exit()
    if t<lr:
      lr=t
      
print(lr)

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

if l==0 or l%m>r%m or m*(r%m)==r:
  print(0)
  exit()

import numpy as np
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=((ii%m)*(jj%m))%m
    if t==0:
        print(0)
        exit()
    if t<lr:
      lr=t
print(lr)

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

if l==0 or l%m>r%m or m*(r%m)==r:
  print(0)
  exit()

import numpy as np
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=(ii*jj)%m
    if t==0:
        print(0)
        exit()
    if t<lr:
      lr=t
print(lr)

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

if l%m>r%m or m*(r%m)==r:
  print(0)
  exit()

import numpy as np
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=(ii*jj)%m
    if t==0:
        print(0)
        exit()
    if t<lr:
      lr=t
print(lr)

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

if l%m>r%m or m*(r%m)==r:
  print(0)
  exit()

import numpy as np
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=(ii*jj)%m
    if t<lr:
      lr=t
print(lr)

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

import numpy as np
s=set()
lr=m
for ii in np.arange(l,r):
  for jj in np.arange(ii+1,r+1):
    t=(ii*jj)%m
    if t==0:
      print(t)
      exit()
    if t<lr:
      lr=t
print(lr)
Problem p03030 (python)

Fixed submission:
n=int(input())
a=[[""]*3 for ii in range(n)]
for ii in range(n):
  s=input().split()
  #print(s)
  a[ii][0]=s[0]
  a[ii][1]=100-int(s[1])
  a[ii][2]=ii
a.sort()
for ii in range(n):
  print(a[ii][2]+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[[]*3 for ii in range(n)]
for ii in range(n):
  s=input().split()
  a[ii][0]=s[0]
  a[ii][1]=-int(s[1])
  a[ii][2]=ii
a.sort()
for ii in range(n):
  print(a[ii][2]+1)
Problem p02612 (python)

Fixed submission:
N = int(input())
sub = (N%1000)
print(0 if sub == 0 else (1000-sub))

Buggy submission (verdict: Runtime Error):
def get_binaly_arr(num,digit):
    return list(bin(num)[2:].zfill(digit))

def get_droped_mat(mat,binaly_arr,direction):
    if direction == "H":# 行をdrop!
        return [mat[i] for i in range(len(mat)) if binaly_arr[i] != "0" ]
    elif direction == "W": # 列をdrop!
        return [[arr[i] for i in range(len(arr)) if binaly_arr[i] != "0" ] for arr in mat]
    else :
        print("INVALID DIRECTION!")

def count_black(mat):
    return sum([sum([1 for item in arr if item == "#"]) for arr in mat])

    
if __name__ == "__main__":
    H,W,K = list(map(int,input().split()))
    c = []
    for i in range(0,H):
        c.append(list(input()))
    H_pattern_num = 2 ** H
    W_pattern_num = 2 ** W
    count = 0
    ite_num = 0
    for i in range(0,H_pattern_num):
        for j in range(0,W_pattern_num):
            # バイナリ配列を生成
            H_binaly_arr = get_binaly_arr(i,H)
            W_binaly_arr = get_binaly_arr(j,W)
            mat_temp = c.copy()
            mat_temp = get_droped_mat(c,H_binaly_arr,direction="H")
            mat_temp = get_droped_mat(mat_temp,W_binaly_arr,direction="W")
            if K == count_black(mat_temp):
                count += 1
    print(count)
Problem p02614 (python)

Fixed submission:
H,W,K = list(map(int,input().split()))
c = []
for i in range(H):
    c.append(list(input()))
ans = 0
H_pattern,W_pattern = 2**H,2**W
for i in range(0,H_pattern):
    for j in range(0,W_pattern):
        H_active_arr,W_active_arr=list(bin((H_pattern-1)&i)[2:].zfill(H)),list(bin((W_pattern-1)&j)[2:].zfill(W))
        count = 0
        for k,arr in enumerate(c):
            for l,item in enumerate(arr):
                if H_active_arr[k] == "1" and W_active_arr[l] == "1" and item == "#":
                    count += 1
        if count == K:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
H,W,K = list(map(int,input().split()))
c = []
for i in range(H):
    c.append(list(input()))
ans = 0
H_pattern,W_pattern = 2**H,2**W
for i in range(0,H_pattern):
    for j in range(0,W_pattern):
        H_active,W_active=list(bin(H_pattern,i)[2:].zfill(H)),list(bin(W_pattern,j).zfill(H))
        count = 0
        for k,arr in enumerate(c):
            for l,item in enumerate(arr):
                if H_active[k] == "1" and W_active[l] == "1" and item == "#":
                    count += 1
        if count == K:
            ans += 1
print(ans)