Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

def dfs(x):
    stack = [x]
    visited = []
    if checked[x] == 1:
        return 0
    while stack:
        node = stack.pop()
        if node not in visited:
            visited.append(node)
            checked[node] = 1
            for i in graph[node]:
                stack.append(i)
                checked[i] = 1
    return len(visited)

n, m = inm()
checked = [0] * (n+1)
graph = {}
for i in range(m):
    a, b = inm()
    if a not in graph:
        graph[a] = []
    if b not in graph:
        graph[b] = []
    graph[a].append(b)
    graph[b].append(a)
ans = 0
for i in range(1, n+1):
    if checked[i] == 0:
        ans = max(ans, dfs(i))
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

def dfs(x):
    stack = [x]
    visited = 0
    checked[x] = 1
    while stack:
        visited += 1
        node = stack.pop()
        for i in graph[node]:
            if checked[i] == 0:
                stack.append(i)
                checked[i] = 1
    return visited
 
n, m = inm()
checked = [0] * (n+1)
graph = {}
for i in range(m):
    a, b = inm()
    if a not in graph:
        graph[a] = set()
    if b not in graph:
        graph[b] = set()
    graph[a].add(b)
    graph[b].add(a)
ans = 1
for i in graph:
    if checked[i] == 0:
        ans = max(ans, dfs(i))
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n, m, k = inm()
a = inl()
b = inl()
count = 0
for i in range(n-1):
    a[i+1] += a[i]
for i in range(m-1):
    b[i+1] += b[i]
for i in range(n):
    j = m-1
    if a[i] > k:
        break
    while a[i] + b[j] > k:
        j -= 1
    count = max(count, i+j + 2)
print(count)

Fixed submission:
import sys
import bisect
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n, m, k = inm()
a = inl()
b = [0] + inl()
count = 0
prev = 0
for i in range(n-1):
    a[i+1] += a[i]
for i in range(m+1):
    if b[i]+prev > k:
        break
    j = bisect.bisect(a, (k - b[i] - prev))
    count = max(count, i + j)
    prev += b[i]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

ans = []
n = ini()
a = inl()
count = 0
for i in range(1, n+1):
    ans.append(a.count(i))
out(ans)

Fixed submission:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n = ini()
a = inl()
ans = [0] * n
for i in a:
    ans[i-1] += 1
out(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

n = ini()
a = inl()
if len(set(a)) == n:
    print(n - 2)
elif len(set(a)) == 1:
    print(n//2)
else:
    f = {}
    s = {}
    for i in range(n):
        if i % 2 == 0:
            if a[i] not in f:
                f[a[i]] = 0
            f[a[i]] += 1
        else:
            if a[i] not in s:
                s[a[i]] = 0
            s[a[i]] += 1
    fsum = sum(f.values())
    ssum = sum(s.values())
    f = sorted(f.items(), key=lambda x: x[1], reverse=True)
    s = sorted(s.items(), key=lambda x: x[1], reverse=True)
    if f[0][0] == s[0][0]:
        tmp1 = fsum - f[0][1] + ssum - s[0][2]
        tmp2 = fsum - f[0][2] + ssum - s[0][1]
        print(min(tmp1, tmp2))
    else:
        print(fsum - f[0][1] + ssum - s[0][1])

Fixed submission:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

n = ini()
a = inl()
if len(set(a)) == n:
    print(n - 2)
elif len(set(a)) == 1:
    print(n//2)
else:
    f = {}
    s = {}
    for i in range(n):
        if i % 2 == 0:
            if a[i] not in f:
                f[a[i]] = 0
            f[a[i]] += 1
        else:
            if a[i] not in s:
                s[a[i]] = 0
            s[a[i]] += 1
    fsum = sum(f.values())
    ssum = sum(s.values())
    f = sorted(f.items(), key=lambda x: x[1], reverse=True)
    s = sorted(s.items(), key=lambda x: x[1], reverse=True)
    if f[0][0] == s[0][0]:
        tmp1 = fsum - f[0][1] + ssum - s[1][1]
        tmp2 = fsum - f[1][1] + ssum - s[0][1]
        print(min(tmp1, tmp2))
    else:
        print(fsum - f[0][1] + ssum - s[0][1])
Buggy python submission (verdict: Runtime Error):
'''Author- Akshit Monga'''
n=int(input())
x=input()
x=x[::-1]
ans1=0
ans2=0
c=x.count('1')
for i in range(0,n):
    if x[i]:
        ans1=(ans1+pow(2,i,c+1))%(c+1)
        ans2=(ans2+pow(2,i,c-1))%(c-1)
to_print=[]
for i in range(0,n):
    if x[i]=='1':
        if c==1:
            to_print.append(0)
            continue
        var=(ans2%(c-1)-pow(2,i,c-1))%(c-1)
        a = 1
        while var:
            var = var % bin(var).count('1')
            a += 1
        to_print.append(a)
    else:
        # print(ans1)
        var = (ans1%(c+1) + pow(2, i, c +1))%(c+1)
        # print(c+1)
        # print(var)
        a = 1
        while var:
            var = var % bin(var).count('1')
            a += 1
        to_print.append(a)
for i in to_print[::-1]:
    print(i)

Fixed submission:
'''Author- Akshit Monga'''
n=int(input())
x=input()
x=x[::-1]
ans1=0
ans2=0
c=x.count('1')
for i in range(0,n):
    if x[i]=='1':
        ans1=(ans1+pow(2,i,c+1))%(c+1)
        if c!=1:
            ans2=(ans2+pow(2,i,c-1))%(c-1)
to_print=[]
for i in range(0,n):
    if x[i]=='1':
        if c==1:
            to_print.append(0)
            continue
        var=(ans2%(c-1)-pow(2,i,c-1))%(c-1)
        a = 1
        while var:
            var = var % bin(var).count('1')
            a += 1
        to_print.append(a)
    else:
        # print(ans1)
        var = (ans1%(c+1) + pow(2, i, c +1))%(c+1)
        # print(c+1)
        # print(var)
        a = 1
        while var:
            var = var % bin(var).count('1')
            a += 1
        to_print.append(a)
for i in to_print[::-1]:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
'''Author- Akshit Monga'''
n=int(input())
x=input()
for i in range(n):
    if x[i]=='1':
        temp='0'
    else:
        temp='1'
    var=x[0:i]+temp+x[i+1:]
    pivot=int(var,2)
    a=0
    while pivot:
        a+=1
        c=bin(pivot).count('1')
        pivot=pivot%c
    print(a)

Fixed submission:
'''Author- Akshit Monga'''
n=int(input())
x=input()
x=x[::-1]
ans1=0
ans2=0
c=x.count('1')
for i in range(0,n):
    if x[i]=='1':
        ans1=(ans1+pow(2,i,c+1))%(c+1)
        if c!=1:
            ans2=(ans2+pow(2,i,c-1))%(c-1)
to_print=[]
for i in range(0,n):
    if x[i]=='1':
        if c==1:
            to_print.append(0)
            continue
        var=(ans2%(c-1)-pow(2,i,c-1))%(c-1)
        a = 1
        while var:
            var = var % bin(var).count('1')
            a += 1
        to_print.append(a)
    else:
        # print(ans1)
        var = (ans1%(c+1) + pow(2, i, c +1))%(c+1)
        # print(c+1)
        # print(var)
        a = 1
        while var:
            var = var % bin(var).count('1')
            a += 1
        to_print.append(a)
for i in to_print[::-1]:
    print(i)
Buggy python submission (verdict: Runtime Error):
if x == 0:
 print('1')
elif x == 1:
 print('0')

Fixed submission:
x = int(input())
if x == 0:
 print('1')
elif x == 1:
 print('0')

Buggy python submission (verdict: Runtime Error):
if x==1 :
  print(0)
else :
  print(1)

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

Buggy python submission (verdict: Runtime Error):
if x==1 :
  print(0)
else print(1)

Fixed submission:
x = int(input())
if x == 1 :
  print(0)
else :
  print(1)
Buggy python submission (verdict: Runtime Error):
def get_ints() :
  list(map(int,input().split()))

a,b,c,d=get_ints()
ans=max(a*c,b*c,a*d,b*d)
print(ans)

Fixed submission:
def get_ints() :
  return list(map(int,input().split()))

a,b,c,d=get_ints()
ans=max(a*c,b*c,a*d,b*d)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(x):
    tmp=int(pow(x, 1/2))+1
    out=set()
    for i in range(1, tmp):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    if pow(x, 1/2)%1==0:
        out.add(pow(x, 1/2))
    out=list(out)
    out.sort()
    return out

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

pairwise=True
X=set()

for a in A:
  tmp=yakusu(a)
  for i in tmp[1:]:
    if i in X:
      pairwise=False
    else:
      X.add(i)
      
import math
tmp=A[0]+0
for a in A[1:]:
  tmp=math.gcd(tmp, a)
  
if tmp==1:
  setwise=True
else:
  setwise=False
  
if pairwise==True:
  print('pairwise coprime')
elif setwise==True:
  print('setwise coprime')
else:
  print('not coprime')

Fixed submission:
def yakusu(x):
    tmp=int(pow(x, 1/2))+1
    out=set()
    for i in range(1, tmp):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    if pow(x, 1/2)%1==0:
        out.add(pow(x, 1/2))
    out=list(out)
    out.sort()
    return out

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

pairwise=True
X=set()

for a in A:
  tmp=yakusu(a)
  for i in tmp[1:]:
    if i in X:
      pairwise=False
      break
    else:
      X.add(i)
  if pairwise==False:
    break
      
import math
tmp=A[0]+0
for a in A[1:]:
  tmp=math.gcd(tmp, a)
  
if tmp==1:
  setwise=True
else:
  setwise=False
  
if pairwise==True:
  print('pairwise coprime')
elif setwise==True:
  print('setwise coprime')
else:
  print('not coprime')

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(x):
    tmp=int(pow(x, 1/2))+1
    out=set()
    for i in range(1, tmp):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    if pow(x, 1/2)%1==0:
        out.add(pow(x, 1/2))
    out=list(out)
    out.sort()
    return out

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

pairwise=True
X=[1]*(A[-1]+1)  

for a in A:
  tmp=yakusu(a)
  for i in tmp[1:]:
    if X[i]==0:
      pairwise=False
    else:
      for j in range(i, A[-1]+1, i):
        X[i]=0
      
import math
tmp=A[0]+0
for a in A[1:]:
  tmp=math.gcd(tmp, a)
  
if tmp==1:
  setwise=True
else:
  setwise=False
  
if pairwise==True:
  print('pairwise coprime')
elif setwise==True:
  print('setwise coprime')
else:
  print('not coprime')

Fixed submission:
def yakusu(x):
    tmp=int(pow(x, 1/2))+1
    out=set()
    for i in range(1, tmp):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    if pow(x, 1/2)%1==0:
        out.add(pow(x, 1/2))
    out=list(out)
    out.sort()
    return out

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

pairwise=True
X=set()

for a in A:
  tmp=yakusu(a)
  for i in tmp[1:]:
    if i in X:
      pairwise=False
      break
    else:
      X.add(i)
  if pairwise==False:
    break
      
import math
tmp=A[0]+0
for a in A[1:]:
  tmp=math.gcd(tmp, a)
  
if tmp==1:
  setwise=True
else:
  setwise=False
  
if pairwise==True:
  print('pairwise coprime')
elif setwise==True:
  print('setwise coprime')
else:
  print('not coprime')
Buggy python submission (verdict: Time Limit Exceeded):
N, K=map(int, input().split())
A=list(map(int, input().split()))

x=0
y=max(A)

def f(l):
  nums=0
  for a in A:
    t=1
    while a/t>l:
      t+=1
    nums+=t-1
  if nums>K:
    return False
  else:
    return True

while y-x>1:
  tmp=(x+y)//2
  if f(tmp)==True:
    y=tmp
  else:
    x=tmp
    
print(y)

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

x=0
y=max(A)

def f(l):
  nums=0
  for a in A:
    if a%l==0:
      nums+=a//l-1
    else:
      nums+=a//l
  if nums>K:
    return False
  else:
    return True

while y-x>1:
  tmp=(x+y)//2
  if f(tmp)==True:
    y=tmp
  else:
    x=tmp
    
print(y)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C=map(int, input().split())
K=int(input())
i=0
while i<K:
  if B<A:
    B*=2
    i+=1
  elif C<B:
    C*=2
    i+=1
    
if A<B<C:
  print('Yes')
else:
  print('No')

Fixed submission:
A, B, C=map(int, input().split())
K=int(input())
i=0
while i<K:
  if B<=A:
    B*=2
  elif C<=B:
    C*=2
  i+=1
    
if A<B<C:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def f(n):
  if n==0:
    return 0
  c=0
  while n>0:
    n%=format(n, 'b').count('1')
    c+=1
  return c

N=int(input())
X=input()
nums=[f(i) for i in range(N+1)]

a=0
b=0
for i in range(N):
  if X[i]=='0':
    a+=1
  else:
    b+=1

s=0
t=0
for i in range(N):
  s=(s+int(X[i])*pow(2, N-1-i, b+1))%(b+1)
  t=(t+int(X[i])*pow(2, N-1-i, b-1))%(b-1)

for i in range(N):
  if X[i]=='0':
    tmp=(s+pow(2, N-1-i, b+1))%(b+1)
    print(nums[tmp]+1)
  else:
    tmp=(t-pow(2, N-1-i, b-1))%(b-1)
    print(nums[tmp]+1)

Fixed submission:
def f(n):
  c=0
  while n>0:
    n%=format(n, 'b').count('1')
    c+=1
  return c

N=int(input())
X=input()
nums=[0]+[f(i) for i in range(1, N+1)]

a=0
b=0
for i in range(N):
  if X[i]=='0':
    a+=1
  else:
    b+=1

s=0
t=0
if b>1:
  for i in range(N):
    s=(s+int(X[i])*pow(2, N-1-i, b+1))%(b+1)
    t=(t+int(X[i])*pow(2, N-1-i, b-1))%(b-1)
else:
  for i in range(N):
    s=(s+int(X[i])*pow(2, N-1-i, b+1))%(b+1)
    
if b==1:
  for i in range(N):
    if X[i]=='0':
      tmp=(s+pow(2, N-1-i, b+1))%(b+1)
      print(nums[tmp]+1)
    else:
      print(0)
  exit()

for i in range(N):
  if X[i]=='0':
    tmp=(s+pow(2, N-1-i, b+1))%(b+1)
    print(nums[tmp]+1)
  else:
    tmp=(t-pow(2, N-1-i, b-1))%(b-1)
    print(nums[tmp]+1)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

H, W, K=map(int, input().split())
x1, y1, x2, y2=map(int, input().split())
c=['@'*(W+2)]+['@'+input()+'@' for _ in range(H)]+['@'*(W+2)]
l=[[-2]*(W+2) for _ in range(H+2)]
q=[[0, x1, y1]]

heapq.heapify(q)

while q:
  tmp=heapq.heappop(q)
  l[tmp[1]][tmp[2]]=tmp[0]
  
  j=1
  while j<=K and c[tmp[1]-j][tmp[2]]=='.' and l[tmp[1]-j][tmp[2]]==-2:
    heapq.heappush(q, [tmp[0]+1, tmp[1]-j, tmp[2]])
    l[tmp[1]-j][tmp[2]]=-1
    j+=1
  j=1
  while j<=K and c[tmp[1]+j][tmp[2]]=='.':
    if l[tmp[1]+j][tmp[2]]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1]+j, tmp[2]])
      l[tmp[1]+j][tmp[2]]=-1
    j+=1
  j=1
  while j<=K and c[tmp[1]][tmp[2]-j]=='.':
    if l[tmp[1]][tmp[2]-j]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1], tmp[2]-j])
      l[tmp[1]][tmp[2]-j]=-1
    j+=1
  j=1
  while j<=K and c[tmp[1]][tmp[2]+j]=='.':
    if l[tmp[1]][tmp[2]+j]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1], tmp[2]+j])
      l[tmp[1]][tmp[2]+j]=-1
    j+=1
    
  if l[x2][y2]>=0:
    print(l[x2][y2])
    exit()

if l[x2][y2]<0:
  print(-1)
else:
  print(l[x2][y2])

Fixed submission:
import heapq

H, W, K=map(int, input().split())
x1, y1, x2, y2=map(int, input().split())
c=['@'*(W+2)]+['@'+input()+'@' for _ in range(H)]+['@'*(W+2)]
l=[[-2]*(W+2) for _ in range(H+2)]
ll=[[-2]*(W+2) for _ in range(H+2)]
q=[[0, x1, y1]]

heapq.heapify(q)
ll[x1][y1]=0

while q:
  tmp=heapq.heappop(q)
  if ll[tmp[1]][tmp[2]]==tmp[0]:
    l[tmp[1]][tmp[2]]=tmp[0]
  else:
    continue
  
  j=1
  while j<=K and c[tmp[1]-j][tmp[2]]=='.':
    if l[tmp[1]-j][tmp[2]]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1]-j, tmp[2]])
      l[tmp[1]-j][tmp[2]]=-1
      ll[tmp[1]-j][tmp[2]]=tmp[0]+1
      j+=1
    elif ll[tmp[1]-j][tmp[2]]==tmp[0]+1:
      j+=1
    else:
      j=K+1
    
  j=1
  while j<=K and c[tmp[1]+j][tmp[2]]=='.':
    if l[tmp[1]+j][tmp[2]]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1]+j, tmp[2]])
      l[tmp[1]+j][tmp[2]]=-1
      ll[tmp[1]+j][tmp[2]]=tmp[0]+1
      j+=1
    elif ll[tmp[1]+j][tmp[2]]==tmp[0]+1:
      j+=1
    else:
      j=K+1
      
  j=1
  while j<=K and c[tmp[1]][tmp[2]-j]=='.':
    if l[tmp[1]][tmp[2]-j]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1], tmp[2]-j])
      l[tmp[1]][tmp[2]-j]=-1
      ll[tmp[1]][tmp[2]-j]=tmp[0]+1
      j+=1
    elif ll[tmp[1]][tmp[2]-j]==tmp[0]+1:
      j+=1
    else:
      j=K+1
      
  j=1
  while j<=K and c[tmp[1]][tmp[2]+j]=='.':
    if l[tmp[1]][tmp[2]+j]==-2:
      heapq.heappush(q, [tmp[0]+1, tmp[1], tmp[2]+j])
      l[tmp[1]][tmp[2]+j]=-1
      ll[tmp[1]][tmp[2]+j]=tmp[0]+1
      j+=1
    elif ll[tmp[1]][tmp[2]+j]==tmp[0]+1:
      j+=1
    else:
      j=K+1

if l[x2][y2]<0:
  print(-1)
else:
  print(l[x2][y2])
Buggy python submission (verdict: Time Limit Exceeded):
N, K=map(int, input().split())
A=list(map(int, input().split()))
for i in range(K):
  p=[0]*N
  n=[0]*N
  for i in range(N):
    if i-A[i]>0:
      p[i-A[i]]+=1
    else:
      p[0]+=1
    if i+A[i]<N-1:
      n[i+A[i]+1]+=1
  light=0
  Ncount=0
  for i in range(N):
    light=light+p[i]-n[i]
    A[i]=light
    if light==N:
      Ncount+=1
  if Ncount==N:
    out=[N]*N
    print(*out, sep=' ')
    exit()
print(*A, sep=' ')

Fixed submission:
N, K=map(int, input().split())
A=list(map(int, input().split()))
for i in range(K):
  p=[0]*N
  n=[0]*N
  for i in range(N):
    if i-A[i]>0:
      p[i-A[i]]+=1
    else:
      p[0]+=1
    if i+A[i]<N-1:
      n[i+A[i]+1]+=1
  light=0
  Ncount=0
  for i in range(N):
    light=light+p[i]-n[i]
    A[i]=light
    if light==N:
      Ncount+=1
  if Ncount==N:
    out=[N]*N
    print(*out, sep=' ')
    exit()
print(*A, sep=' ')

Buggy python submission (verdict: Time Limit Exceeded):
N, K=map(int, input().split())
A=list(map(int, input().split()))
for i in range(K):
  p=[0]*N
  n=[0]*N
  for i in range(N):
    if i-A[i]>0:
      p[i-A[i]]+=1
    else:
      p[0]+=1
    if i+A[i]<N-1:
      n[i+A[i]+1]+=1
  light=0
  Ncount=0
  for i in range(N):
    light=light+p[i]-n[i]
    A[i]=light
    if light==N:
      Ncount+=1
  if Ncount==N:
    out=[N]*N
    print(*out, sep=' ')
print(*A, sep=' ')

Fixed submission:
N, K=map(int, input().split())
A=list(map(int, input().split()))
for i in range(K):
  p=[0]*N
  n=[0]*N
  for i in range(N):
    if i-A[i]>0:
      p[i-A[i]]+=1
    else:
      p[0]+=1
    if i+A[i]<N-1:
      n[i+A[i]+1]+=1
  light=0
  Ncount=0
  for i in range(N):
    light=light+p[i]-n[i]
    A[i]=light
    if light==N:
      Ncount+=1
  if Ncount==N:
    out=[N]*N
    print(*out, sep=' ')
    exit()
print(*A, sep=' ')
Buggy python submission (verdict: Runtime Error):
a, b=map(int, input().split())
print(int(a*b))

Fixed submission:
a, b=input().split()
a=int(a)
b=int(b[0]+b[2:])
print(int(a*b//100))
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())

def f(p, q):
    s=(q-p**4)/5
    if s%1>0:
        return False, None
    
    t=yakusu(s)
    for A in t:
        if A*(A**3-2*p*(A**2)+2*A*(p**2)-p**3)==s:
            if A>=0:
                A=int(A)
            else:
                A=-int(-A)
            B=A-p
            if B>=0:
                B=int(B)
            else:
                B=-int(-B)
            return True, [A, B]
    return False, None

def yakusu(x):
    if x<0:
        x*=-1
    tmp=int(pow(x, 1/2))+1
    out=set()
    for i in range(1, tmp):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    if pow(x, 1/2)%1==0:
        out.add(pow(x, 1/2))
    out=list(out)
    out=out+[-i for i in out]
    out.sort()
    return out

tmp=yakusu(X)
for p in tmp:
    q=X//p
    hantei, ans=f(p, q)
    if hantei==True:
        print(ans[0], ans[1])
        exit()
        
    hantei, ans=f(-p, -q)
    if hantei==True:
        print(ans[0], ans[1])
        exit()
        


Fixed submission:
X=int(input())

for A in range(-10**3, 10**3):
  for B in range(-10**3, 10**3):
    if A**5-B**5==X:
      print(A, B)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())

def f(p, q):
    s=(q-p**4)/5
    if s%1>0:
        return False, None
    
    t=yakusu(s)
    for A in t:
        if A*(A**3-2*p*(A**2)+2*A*(p**2)-p**3)==s:
            if A>=0:
                A=int(A)
            else:
                A=-int(-A)
            B=A-p
            if B>=0:
                B=int(B)
            else:
                B=-int(-B)
            return True, [A, B]
    return False, None

def yakusu(x):
    if x<0:
        x*=-1
    tmp=int(pow(x, 1/2))+1
    out=set()
    for i in range(1, tmp):
        if x%i==0:
            out.add(i)
            out.add(x//i)
    if pow(x, 1/2)%1==0:
        out.add(pow(x, 1/2))
    out=list(out)
    out=out+[-i for i in out]
    out.sort()
    return out

tmp=yakusu(X)
for p in tmp:
    q=X//p
    hantei, ans=f(p, q)
    if hantei==True:
        print(ans[0], ans[1])
        exit()
        
    hantei, ans=f(-p, -q)
    if hantei==True:
        print(ans[0], ans[1])
        exit()
        


Fixed submission:
X=int(input())

for A in range(-10**3, 10**3):
  for B in range(-10**3, 10**3):
    if A**5-B**5==X:
      print(A, B)
      exit()
Buggy python submission (verdict: Runtime Error):
N, M, Q=map(int, input().split())
abcd=[list(map(int, input().split())) for _ in range(Q)]

def f(nums):
  out=0
  for samp in abcd:
    if nums[samp[1]-1]-nums[samp[0]-1]==samp[2]:
      out+=samp[3]
  return out

def g(nums):
  if nums[-1]<M-1:
    nums[-1]+=1
    return nums, False
  
  i=N-1
  while i>=0 and nums[i]==M-1:
    i-=1
  if i<0:
    return None, True
  
  nums=nums[:i]+[nums[i]+1]*(M-i)
  return nums, False

nums=[0]*N
fi=False
ans=0

while fi==False:
  p=f(nums)
  if ans<p:
    ans=p
  nums, fi=g(nums)
  
print(ans)


  

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

def f(nums):
  out=0
  for samp in abcd:
    if nums[samp[1]-1]-nums[samp[0]-1]==samp[2]:
      out+=samp[3]
  return out

def g(nums):
  if nums[-1]<M:
    nums[-1]+=1
    return nums, False
  
  i=N-1
  while i>=0 and nums[i]==M:
    i-=1
  if i<0:
    return None, True
  
  nums=nums[:i]+[nums[i]+1 for _ in range(N-i)]
  return nums, False

nums=[1]*N
fi=False
ans=0

while fi==False:
  p=f(nums)
  if ans<p:
    ans=p
  nums, fi=g(nums)
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
S=input()
N=len(S)

mats=np.zeros((10, 2019, 2019))
for i in range(2019):
  for j in range(10):
    tmp=(i*10+j)%2019
    mats[j][tmp][i]+=1
    
out=0
dp=np.zeros(2019)
dp[int(S[0])]=1
for i in range(1, N):
    dp=np.dot(mats[int(S[i])], dp)
    dp[int(S[i])]+=1
    out+=dp[0]
print(int(out))

Fixed submission:
MOD=2019
S=input()
N=len(S)
nums=[0]*N
nums[-1]=int(S[-1])%MOD
for i in range(-2, -N-1, -1):
  nums[i]=(int(S[i])*pow(10, -(i+1), MOD)+nums[i+1])%MOD

a=[0]*2019
for i in range(N):
  a[nums[i]]+=1
  
print(a[0]+sum([(a[i]*(a[i]-1))//2 for i in range(2019)]))

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
N=len(S)
dp=[[0]*2019 for _ in range(N)]
dp[0][int(S[0])]=1
for i in range(1, N):
    for j in range(2019):
        dp[i][(j*10+int(S[i]))%2019]+=dp[i-1][j]
    dp[i][int(S[i])]=1
print(sum([dp[i][0] for i in range(N)]))

Fixed submission:
MOD=2019
S=input()
N=len(S)
nums=[0]*N
nums[-1]=int(S[-1])%MOD
for i in range(-2, -N-1, -1):
  nums[i]=(int(S[i])*pow(10, -(i+1), MOD)+nums[i+1])%MOD

a=[0]*2019
for i in range(N):
  a[nums[i]]+=1
  
print(a[0]+sum([(a[i]*(a[i]-1))//2 for i in range(2019)]))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
print(*[A.count(i) for i in range(1, N+1)], sep='\n')

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

nums=[0]*(N+1)
for i in range(N-1):
    nums[A[i]]+=1
    
print(*nums[1:], sep='\n')