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

Fixed submission:
a = int(input())
s = input()
print('red' if a<3200 else s)

Buggy submission (verdict: Runtime Error):
from collections import deque
N,Q= map(int, input().split())
tree = [[] for _ in range(N)]
counter = [0]*N
visited = [False]*N
q = deque([0])

for i in range(N-1):
    a,b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

for i in range(Q):
    p,x = map(int, input().split())
    counter[p-1] += x

while q:
    parent = q.popleft()
    visited[parent] = True
    for child in tree[parent]:
        if visited[child]:
            continue
        counter[child] += counter[parent]
        q.append(child)
print(*counter)
Problem p02570 (python)

Fixed submission:
class Solution:
    def solve(self, D, T, S):
        time = D/S
        if time <= T:
            return 'Yes'
        else:
            return 'No'

if __name__ == '__main__':
    D, T, S = map(int, input().split())
    A = Solution()
    print(A.solve(D, T, S))

Buggy submission (verdict: Runtime Error):
class Solution:
  def solve(self, D, T, S):
    time = D/S
    if time <= T:
      return True
    else:
      return False

A = Solution()
D,T,S = map(int, input().split())
print(A.solve(D,T,S)
Problem p02766 (python)

Fixed submission:
N,K = map(int, input().split())
X = N
a = ""
while X > 0:
  a = str(X%K) + a
  X = X//K

  
print(len(a))

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
X = N
a = ""
while X > 0:
  a = str(X&K) + a
  X = X/K

  
print(a)
Problem p02785 (python)

Fixed submission:
N,K = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
if N > K:
  for i in range(K):
    A.pop()
  print(sum(A))
else:
  print("0")

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

A.sort
for i in range(K):
  A.pop()
print(sum(A))
Problem p02571 (python)

Fixed submission:
s=input()
t=input()

a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c+1):
  for j in range(b):
    
    if s[j+i]==t[j]:
      
      min2 += 1
  if min1<min2:
    min1 = min2
  min2 =0
print(b-min1)

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

print(s)
a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c):
  for j in range(b):
    if s[j]==t[i+j]:
      min2 += 1
  if min1>min2:
    min1 = min2
print(min1)
Problem p03250 (python)

Fixed submission:
d = input().split()

a = int(d[0])
b = int(d[1])
c = int(d[2])

e = 0

e = a*10+b+c

if e < b*10+a+c:
    e = b*10+a+c
    if e < c*10+a+b:
        e = c*10+a+b

if e < c*10+a+b:
    e= c*10+a+b
    if e < b*10+a+c:
        e = b*10+a+c

print(e)

Buggy submission (verdict: Runtime Error):
s1 = input()
t1 = input()

s = list(s1)
t = list(t1)

flag = 0
for i in range(len(s)):
    for j in range(len(s)):
        if s[i] == s[j]:
            if t[i] == t[j]:
                a = 1
            else:
                print("No")
                flag = 1
                break
        if flag == 1:
            break

        if t[i] == t[j]:
            if s[i] == s[j]:
                a = 1
            else:
                print("No")
                flag = 1
                break
        if flag == 1:
            break
    if flag == 1:
        break
if flag == 0:
    print("Yes")

Buggy submission (verdict: Runtime Error):
d = input().split()

a = int(d[0])
b = int(d[1])
c = int(d[2])

int e = 0

e = a*10+b+c

if e < b*10+a+c:
    e = b*10+a+c
    if e < c*10+a+b:
        e = c*10+a+b

if e < c*10+a+b:
    e= c*10+a+b
    if e < b*10+a+c:
        e = b*10+a+c

print(e)
Problem p02595 (python)

Fixed submission:
N,D=[int(i) for i in input().split()]
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
D=int(input())
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
D=int(input())
ans=0
for i in range(N):
  x,y=int(input()).split()
  if x*x + y*y <= D*D:
    ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
D=int(input())
ans=0
for i in range(N):
  x,y=int(input()).split()
  if x*x + y*y <= D*D
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
D=int(input())
count=0
a = list(map(int,input().strip().split()))[:N]
for i in range(len(a)):
  distance=((i[0]**2)+(i[1]**2))**0.5
  if distance>D:
    count+=1
print(count)
Problem p02571 (python)

Fixed submission:
S = input()
T = input()
mm = 0
for i in range(len(S)-len(T)+1):
    a = S[i:i+len(T)]
    mm_now = sum([x == y for x,y in [*zip(a,T)]])
    mm = max(mm_now, mm)
print(len(T) - mm)

Buggy submission (verdict: Runtime Error):
S,T = input().split()
mm = 0
for i in range(len(S)-len(T)):
    a = S[i:i+len(T)]
    mm_now = sum([x == y for x,y in [*zip(a,T)]])
    mm = max(mm_now, mm)
print(len(T) - mm)
Problem p02572 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ans = 0
mod = 10**9+7
 
for i in range(n-1):
    s -= a[i]
    ans += a[i]*s
 
print(ans%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7

partial_sum = copy.deepcopy(A)
sum_now = A[N-1]
for j in range(N-2,-1,-1):
    sum_now = int((sum_now+A[j])%mod)
    partial_sum[j] = sum_now
res = 0
for i in range(N-1):
    res = (res + (A[i]*partial_sum[i+1])%mod) %mod
print(int(res))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(x)%(1e9+7) for x in input().split()]

# calculating array sum (a1 + a2 ... + an) 
array_sum = 0
for i in range(0, n, 1): 
    array_sum = (array_sum + A[i])%(1e9+7)

    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = (array_sum * array_sum)%(1e9+7)

# calcualting a1^2 + a2^2 + ... + an^2 
individual_square_sum = 0
for i in range(0, n, 1): 
    individual_square_sum += (A[i] * A[i])%(1e9+7)
    individual_square_sum = individual_square_sum%(1e9+7)

# required sum is (array_sum_square - individual_square_sum) / 2 
print (array_sum_square - individual_square_sum) / 2
Problem p02594 (python)

Fixed submission:
x = input()
if int(x) >= 30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = input()
if x >= 30:
    print("Yes")
else:
    print("No")
Problem p02570 (python)

Fixed submission:
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) ]))
def invr():
    return(map(int,input().split()))
  
i = inlt()
D = i[0]
T = i[1]
S = i[2]
 
if D/T > S:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) ]))
def invr():
    return(map(int,input().split()))
  
i <- inlt()
D <- i[0]
T <- i[1]
S <- i[2]
 
if D > S*T:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) ]))
def invr():
    return(map(int,input().split()))
  
i <- inlt()
D <- i[0]
T <- i[1]
S <- i[2]

if D/T > S:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inlt():
    return(list(map(int,input().split())))
  
i <- inlt()
D <- i[0]
T <- i[1]
S <- i[2]

if D/T > S:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inlt():
    return(list(map(int,input().split())))
  
i <- inlt()

D <- i[0]
T <- i[1]
S <- i[2]

if D > S*T:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inp():
    return(int(input()))
i <- inp()

D <- i[0]
T <- i[1]
S <- i[2]

if D > S*T:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inp():
    return(int(input()))
  
i = inp()
D = inp[0]
T = inp[1]
S = inp[2]

if D/T > S:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
def inp():
    return(int(input()))
  
i = inp()
D = i[0]
T = i[1]
S = i[2]

if D/T > S:
	print("No")
else print("Yes")
Problem p02572 (python)

Fixed submission:
n = int(input())
numbers = list(map(int, input().split()))
result = 0
sum_of_numbers = sum(numbers)
for i in range(n - 1):
    sum_of_numbers -= numbers[i]
    result += numbers[i] * sum_of_numbers
    result %= 1000000007
print(result)

Buggy submission (verdict: Runtime Error):
# This is a sample Python script.

# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import math
from functools import reduce

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

n = int(input())
numbers = list(map(int, input().split())).sort()

for i in range(n):
    is_pair_wise_coprime = True
    for j in range(i + 1, n):
        if math.gcd(numbers[i], numbers[j]) != 1:
            is_pair_wise_coprime = False
            break
    if not is_pair_wise_coprime:
        break
else:
    print('pairwise coprime')
    exit(0)

if gcd(numbers) == 1:
    print('setwise coprime')
else:
    print('not coprime')
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S)):
    if i < K:
      print(S[i],end="")
    else:
      print("...")
      break

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S))
  	if i <= K:
      print(S[i],end="")
    else:
      print("...")
      break

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) == K:
  print(S)
else:
  sth = S.split(S[K])
  print(sth[0]+"...")

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
sth = S.split(S[K])
print(sth[0]+"...")
Problem p02753 (python)

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
if S[0] != S[1] and S[0] != S[2]:
    print("Yes")
elif S[0] != S[1] and S[1] != S[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S=input()
if S[1]!= S[2] and S[1]!=S[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if S[1]!= S[2] and S[1]!=S[3]:
    print("Yes")
else:
    print("No")
Problem p02682 (python)

Fixed submission:

def input_from_console():
    a, b, c, k = map(int, input().split())
    return a, b, c, k


def solve(a, b, c, k):
    sum = 0
    if k < a:
        return k
    else:
        k = k - a
        sum = a
    if k < b:
        return sum
    else:
        k = k - b
    sum -= k
    return sum

def main():
    a, b, c, k = input_from_console()
    print(solve(a, b, c, k))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()

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


def solve(a, b, c, k):
    all_list = [1] * a + [0] * b + [-1] * c
    return sum(all_list[0:k])


def main():
    a, b, c, k = input_from_console()
    print(solve(a, b, c, k))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()
Problem p03075 (python)

Fixed submission:
#a,b,c = map(int,inpput().split(" "))
#n = int(input())
#print(a,b,c)
t=[]
for i in range(5):
    t.append(int(input()))
n = int(input())
flag = True
for i in range(5):
    for j in range(5-i-1):
        if abs(t[i]-t[j+i+1]) >n:
            flag =False
            break
if not flag:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
t = map(int, input())
bottle_neck = min(t)[0]
ti = math.ceil(n/bottle_neck)
print(ti+4)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
t = map(int, input())
bottle_neck = min(t)[0]
ti = math.ceil(n/bottle_neck)
print(ti+4)

Buggy submission (verdict: Runtime Error):
n = int(input())
t=[]
t = map(int, input())
bottle_neck = min(t)[0]
ti = int(n/bottle_neck)
ti+=1
print(ti+4)
Problem p03077 (python)

Fixed submission:
import math
n = int(input())
t=[]
for i in range(5):
    t.append(int(input()))
bottle_neck = min(t)
ti = math.ceil(n/bottle_neck)
print(ti + 4)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
t = map(int, input())
bottle_neck = min(t)
ti = math.ceil(n/bottle_neck)
print(ti+4)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
t = map(int, input())
bottle_neck = min(t)[0]
ti = math.ceil(n/bottle_neck)
print(ti+4)

Buggy submission (verdict: Runtime Error):
n = int(input())
t=[]
t = map(int, input())
bottle_neck = min(t)[0]
ti = int(n/bottle_neck)
if bottle_neck * ti > n:
    ti=1
else:
    ti+=1
print(ti+4)

Buggy submission (verdict: Runtime Error):
n = int(input())
t = map(int, input())
bottle_neck = min(t)
ti = int(n/bottle_neck)
if bottle_neck * ti > n:
    ti=1
else:
    ti+=1
print(ti+4)

Buggy submission (verdict: Runtime Error):
n = int(input())
t = map(int, input())
bottle_neck = min(t)
ti = int(n/bottle_neck)
if n % bottle_neck == 0:
    pass
else:
    ti+=1
print(ti+4)
Problem p02577 (python)

Fixed submission:
def check(st) : 
  
    # Compute sum of digits 
    n = len(st) 
    digitSum = 0
      
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i]) 
  
    # Check if sum of digits 
    # is divisible by 9. 
    return (digitSum % 9 == 0) 
  
# Driver code 
x = input()
st= str(x)
  
if(check(st)) : 
    print("Yes") 
else :  
    print("No")

Buggy submission (verdict: Runtime Error):
def isDivBy9(n): 
    if (n == 0 or n == 9): 
        return True
    if (n < 9): 
        return False

    # If n is greater than 9, 
    # then recur for [floor(n / 9) - n % 8] 
    return isDivBy9((int)(n>>3) - (int)(n&7)) 

N = int(input())

if(isDivBy9(N)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":


    def isDivBy9(n): 
        if (n == 0 or n == 9): 
            return True
        if (n < 9): 
            return False
    
        # If n is greater than 9, 
        # then recur for [floor(n / 9) - n % 8] 
        return isDivBy9((int)(n>>3) - (int)(n&7)) 

    N = int(input())
    
    if(isDivBy9(N)):
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
def isDivBy9(n): 
  
    # Base cases 
    if (n == 0 or n == 9): 
        return True
    if (n < 9): 
        return False
   
    # If n is greater than 9, 
    # then recur for [floor(n / 9) - n % 8] 
    return isDivBy9((int)(n>>3) - (int)(n&7)) 
  



if __name__ == "__main__":
    N = int(input())

    if(isDivBy9(N)):
        print("Yes")
    else:
        print("No")
Problem p02571 (python)

Fixed submission:
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


S=list(ns())
T=list(ns())

INF=10**9
ans=INF
for i in range(len(S)-len(T)+1):
    tmp=0
    for j in range(len(T)):
        if(S[i+j]!=T[j]):
            tmp+=1
    ans=min(ans,tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


S=list(ns())
T=list(ns())

INF=10**9
ans=INF
for i in range(len(S)-len(T)):
    tmp=0
    for j in range(len(T)):
        if(S[i+j]!=T[j]):
            tmp+=1
    ans=min(ans,tmp)

print(tmp)
Problem p02580 (python)

Fixed submission:
import sys
import  math
import fractions
from collections import defaultdict
import heapq
from bisect import bisect_left,bisect

stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

H,W,M=nm()
r=[0]*(10**6)
c=[0]*(10**6)
mass=set()
for i in range(M):
    h,w=nm()
    mass.add(H*h+w)
    r[h]+=1
    c[w]+=1

rl=[]
cl=[]

r_max=0
for i in range(1,H+1):
    r_max=max(r[i],r_max)
    
c_max=0
for i in range(1,W+1):
    c_max=max(c[i],c_max)

for i in range(1,H+1):
    if(r[i]==r_max):
        rl.append(i)

for i in range(1,W+1):
    if(c[i]==c_max):
        cl.append(i)



for i in rl:
    for j in cl:
        if(i*H+j not in mass):
            print(r_max+c_max)
            sys.exit(0)


print(r_max+c_max-1)

Buggy submission (verdict: Runtime Error):
import sys
import  math
import fractions
from collections import defaultdict
import heapq
from bisect import bisect_left,bisect

stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

H,W,M=nm()
r=[0]*(10**6)
c=[0]*(10**6)
ans=0
mass=[[0 for i in range(10**6)] for j in range(10**6)]
for i in range(M):
    h,w=nm()
    mass[h][w]=1
    r[h]+=1
    c[w]+=1

inds1=list(range(10**6))
inds1.sort(key=lambda x: r[x])

inds2=list(range(10**6))
inds2.sort(key=lambda x: c[x])

r.sort(reverse=True)
l.sort(reverse=True)

r1=0
l1=0

while(1):
    if(r[r1+1]==r[r1])
        r1+=1
    else:
        break

while(1):
    if(l[l1+1]==l[l1])
        l1+=1
    else:
        break

flag=False
for i in range(r1+1):
    for j in range(l1+1):
        if(mass[inds1[i]][inds2[j]]==0):
            flag=True
        
if(flag==True):
    print(r[0]+l[0])
else:
    print(r[0]+l[0]-1)
Problem p02596 (python)

Fixed submission:
import sys
import  math
import fractions
from collections import defaultdict
import copy
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

K=int(input())
mod_l=[0]*(K*10)
mod_l[0]=7%K
mod_k=7%K
ans=1
for i in range(10*K-1):
    if(mod_l[i]==0):
        print(ans)
        sys.exit(0)
    mod_k=(mod_k*10)%K  
    if(mod_k==0):
        print("-1")
        sys.exit(0)
    mod_l[i+1]=(mod_l[i]+mod_k)%K
    ans+=1

print("-1")

Buggy submission (verdict: Runtime Error):
import sys
import  math
import fractions
from collections import defaultdict
import copy
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

K=int(input())
mod_l=[0]*(K*10)
mod_l[0]=7%K
mod_k=7%K
ans=1
for i in range(10*K):
    if(mod_l[i]==0):
        print(ans)
        sys.exit(0)
    mod_k=(mod_k*10)%K   
    if(mod_k==0):
        print("-1")
        sys.exit(0)
    mod_l[i+1]=(mod_l[i]+mod_k)%K
    ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import  math
import fractions
from collections import defaultdict
import copy
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

K=int(input())
mod_l=[0]*(K*10)
mod_l[0]=7%K
mod_k=7%K
ans=1
for i in range(10*K):
    if(mod_l[i]==0):
        print(ans)
        sys.exit(0)
    mod_k=(mod_k*10)%K   
    if(mod_k==0):
        print(-1)
        sys.exit(0)
    mod_l[i+1]=(mod_l[i]+mod_k)%K
    ans+=1



print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import  math
import fractions
from collections import defaultdict
import copy
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

K=int(input())
mod_l=[0]*K
mod_l[0]=7%K
mod_k=7%K
ans=1
for i in range(10*K):
    if(mod_l[i]==0):
        print(ans)
        sys.exit(0)
    mod_k=(mod_k*10)%K   
    if(mod_k==0):
        print(-1)
        sys.exit(0)
    mod_l[i+1]=(mod_l[i]+mod_k)%K
    ans+=1



print(ans)
Problem p02688 (python)

Fixed submission:
import sys
import itertools
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,K=nm()
A=[0 for i in range(N)]
for i in range(K):
    d=int(input())
    tmp=nl()
    for j in range(d):
        A[tmp[j]-1]+=1
c=0
for i in range(N):
        if(A[i]==0):
            c+=1

print(c)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
import heapq
import numpy as np
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,K=nm()
A=[0]*K
for i in range(K):
    d=int(input())
    tmp=nl()
    for j in range(d):
        A[tmp[j]-1]+=1
c=0
for i in range(N):
        if(A[i]==0):
            c+=1

print(c)
Problem p02793 (python)

Fixed submission:
import sys
import  math
import fractions
from collections import defaultdict
from functools import reduce
stdin = sys.stdin
         
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
     
INF=10**18
mod=10**9+7
N=int(input())
A=nl()
ans=0
min_bai=1
#for i in range(N):#最大公倍数
#    min_bai=min_bai*A[i]//fractions.gcd(min_bai,A[i])

lcm = reduce(lambda x,y: x//fractions.gcd(x,y)*y, A)
 
#for i in range(N):
#    ans+=lcm//A[i]

ans = sum(lcm//x for x in A)
print(ans%mod)

Buggy submission (verdict: Runtime Error):
import sys
import  math
import fractions
from collections import defaultdict
from functools import reduce
stdin = sys.stdin
         
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
     
INF=10**18
mod=10**9+7
N=int(input())
A=nl()
ans=0
min_bai=1
for i in range(N):#最大公倍数
    min_bai=min_bai*A[i]//fractions.gcd(min_bai,A[i])

lcm = reduce(lambda x,y: x//gcd(x,y)*y, A)
 
for i in range(N):
    ans+=lcm//A[i]


print(ans%mod)
Problem p02915 (python)

Fixed submission:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n=int(input())
print(n*n*n)

Buggy submission (verdict: Runtime Error):
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n=input()
print(n*n*n)