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

Fixed submission:
N, L = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
P = "Possible"
for i in range(N-1):
  if a[i] + a[i+1] >= L:
    start = i
    break  
else:
  P = "Impossible"
print(P)

if P == "Possible":
  ans = [start]
  if start > 0:
    ans += reversed(list(range(start)))
  if start != N-2:
    ans += list(range(start+1, N-1))
  ans.reverse()
  for a in ans:
    print(a+1)

Buggy submission (verdict: Runtime Error):
N, L = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
P = "Possible"
for i in range(N-1):
  if a[i] + a[i+1] >= L:
    start = i
    break  
else:
  P = "Impossible"

ans = [start]
if start > 0:
  ans += list(range(start))
if start != N-2:
  ans += reversed(list(range(start+1, N-1)))

ans.reverse()
print(P)
if P == "Possible":
  for a in ans:
    print(a+1)
Problem p03741 (python)

Fixed submission:
N = int( input() )
A = list( map( int, input().split() ) )
s = 0
f = 0
for i in range( N ):
  s += A[ i ]
  x = s
  if i & 1: # -> -1
    if x < 0: continue
    s -= x - ( -1 )
    f += x - ( -1 )
  else:
    if x > 0: continue
    s += 1 - x
    f += 1 - x
s = 0
g = 0
for i in range( N ):
  s += A[ i ]
  x = s
  if ~i & 1: # -> -1
    if x < 0: continue
    s -= x - ( -1 )
    g += x - ( -1 )
  else:
    if x > 0: continue
    s += 1 - x
    g += 1 - x
print( min( f, g ) )

Buggy submission (verdict: Runtime Error):
N = int( input() )
A = list( map( int, input().split() ) )
ans = 0
s = A[ 0 ]
for i in range( 1, N, 1 ):
  ns = s + A[ i ]
  if ns * s >= 0:
    ns = s // abs( s ) * -1
    ans += abs( ns - ( s + A[ i ] ) )
  s = ns
print( ans )
Problem p02778 (python)

Fixed submission:
a = len(input())
print("x"*a)

Buggy submission (verdict: Runtime Error):
a = str(input())
print(str(x)*len(a))

Buggy submission (verdict: Runtime Error):
a = input()
print(str(x)*len(a))
Problem p02791 (python)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
count = 1
m = x[0]

for i in range(1,n):
  if m >=x[i]:
    count+=1
    m = x[i]
  
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
count = 1
if n >=2:
  for i in range(n-2):
    a = min(x(range(0,i,1)))
    if a >=x[i+1]:
      count+=1
    else:
      count+=0
else:
  print(count)
  exit()
  
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
count = 1
if n >=2:
  for i in range(n-2):
    a = min(x(range(0,i)))
    if a >=x[i+1]:
      count+=1
    else:
      count+=0
else:
  print(count)
  exit()
  
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
count = 1
if n >=2:
  for i in range(n-2):
    a = min(x(range(0,i)))
    if a>=x[i+1]:
      count+=1
    else:
      count+=0
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
count = 1
if n >=2:
  for i in range(n-2):
    if min(x[0:i])>=x[i+1]:
      count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
count = 1
if n >=2:
  for i in range(n-1):
    if min(x[0:i])>=x[i+1]:
      count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
count = 1
for i in range(1,n):
  if min(x[0:i-1])>=x[i]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
x = list(map(int,input().split()))
count = 1
for i in range(1,n):
  if min(x[0:i-1])>=x[i]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
x = list(map(int,input().split()))
count = 0
for i in range(1,n):
  if all(x[j]>x[i] for j in range(0,i-1)):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
x = list(map(int,input().split()))
count = 0
for i in range(1,n):
  if all(x[j]>x[i]) for j in range(0,i-1):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
x = list(map(int,input().split()))
count = 0
for i in range(1,n):
  if all(x[j]>x[i]) for for j in range(0,i-1):
    count+=1
print(count)
Problem p02801 (python)

Fixed submission:
n = input()
a = ord(n)
print(chr(a+1))

Buggy submission (verdict: Runtime Error):
print(chr(ord((input())+1))
Problem p02817 (python)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
print(b+a)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
print(b+a, end="")
Problem p02818 (python)

Fixed submission:
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a<k and k<=a+b:
  print(0,a+b-k)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a<k and k<=a+b 
  print(0,a+b-k)
else:
  print(0,0)
Problem p02837 (python)

Fixed submission:
N = int(input())
testimony = [[-1]*N for i in range(N)]
count = 0
for i in range(N):
  A = int(input())
  for j in range(A):
    x,y = map(int,input().split())
    testimony[i][x-1]=y
for i in range(2**N):
  honest = [0]*N
  for j in range(N):
    if(i>>j)&1:
      honest[j]=1
  flag=True
  for j in range(N):
    if honest[j]==1:
      for k in range(N):
        if testimony[j][k]==-1:
          continue
        if testimony[j][k]!=honest[k]:
          flag=False
  if flag==True:
    count=max(count,honest.count(1))
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
testimony = [[-1]*N for i in range(N)]
count = 0
for i in range(N):
  A = int(input())
  for j in range(A):
    x,y = map(int,input().split())
    testimony[i][x-1]=y
fro i in range(2**N):
  honest = [0]*N
  for j in range(N):
    if(i>>j)&1:
      honest[j]=1
  flag=True
  for j in range(N):
    if honest[j]==1:
      for k in range(N):
        if testimony[j][k]==-1:
          continue
        if testimony[j][k]!=honest[k]:
          flag=False
  if flag==True:
    count=max(count,hones.count(1))
print(count)
Problem p02848 (python)

Fixed submission:
n = int(input())
s = input()
ans = ""
for i in s:
  ans += chr(ord("A") + (ord(i)-ord("A")+n)%26)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(input())
A_change={}
B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
for i in A:
  for j in B:
    if i==j:
      A_change[i] = str(B[(B.index(j)+n)%26])
print(list(A_change.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(input())
A_change={}
B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
for i in A:
  for j in B:
    if i= j:
      A_change[i] = B[(B.index(j)+n)%26]
print(list(A_change.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(input())
A_change={}
B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]
for i in A:
  for j in B:
    if A[i]=B[j]
  A_change[i] = B[(j+n)%26]
print(list(A_change.values()))
Problem p02861 (python)

Fixed submission:
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
sum = 0
for i in range(n):
  for j in range(i+1,n):
    sum += ((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)**0.5
print(2*sum/n)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
sum = 0
for i in range(n):
  for j in range(j+1,n):
    sum += ((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)**0.5
print(2*sum/n)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
a = np.array(l)
dic = list(itertools.permutations(n,n))
sum = 0
for i in range(len(dic)):
  for j in range(n-1):
    sum += np.linalg.norm(a[dic[i][j]]-a[dic[i][j+1]])
print(sum//len(dic))

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
a = np.array(l)
dic = itertools.permutations(n,n)
sum = 0
for i in range(len(dic)):
  for j in range(n-1):
    sum += np.linalg.norm(a[dic[i][j]]-a[dic[i][j+1]])
print(sum//len(dic))
Problem p02887 (python)

Fixed submission:
n = int(input())
x = list(input())
count = n
for i in range(n-1):
  if x[i]==x[i+1]:
    count-=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(input())
for i in range(n,1,-1):
  if x[i]==x[i-1]:
    x.pop(i)
print(len(x))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(input())
for i in range(n-1):
  if x[i]==x[i+1]:
    x.pop(i)
print(len(x))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(input())
for i in range(n):
  if x[i]==x[i+1]:
    x.pop(i)
print(len(x))
Problem p02898 (python)

Fixed submission:
n,k=map(int,input().split())
xlist =list(map(int,input().split()))
count = 0
for i in range(n):
  if xlist[i]>=k:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
xlist =list(map(int,input().split()))
count = 0
for i in range(n):
  if x[i]>=k:
    count+=1
print(count)
Problem p02921 (python)

Fixed submission:
a=input()
b=input()
count=0
for i in range(3):
  if a[i]==b[i]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
count=0
for i in range(3):
  if a[i]=b[i]:
    count+=1
print(count)
Problem p02934 (python)

Fixed submission:
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(a):
  c += 1/b[i]
print(1/c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c == c + 1/b[i]
print(1/c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c += 1/b[i]
print(1/c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c += c + 1/b[i]
print(1/c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(int,input().split())
c = 1/b[0]
for i in range(a-1):
  c += c + 1/b[i]
print(1/c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(int,input().split())
c = 1/b[0]
for i in range(a-1):
  c = c + 1/b[i]
print(1/c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(int,input().split())
c = 1/b[0]
for i in range(len(b)-1):
  c = c + 1/b[i]
print(1/c)
Problem p02946 (python)

Fixed submission:
K,X=map(int,input().split())
print(*list(range(X-K+1,X+K)))

Buggy submission (verdict: Runtime Error):
K,X=map(int,input().split())
print(*list(range[X-K+1:X+K]))

Buggy submission (verdict: Runtime Error):
K,X=map(int,input().split())
print(*list(range[X-K+1,X+K]))

Buggy submission (verdict: Runtime Error):
K,X=map(int,input().split())
print(*list[X-K+1:X+K])

Buggy submission (verdict: Runtime Error):
K,X=map(int,input().split())
print(*list[X-K+1,X+K])

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
print(int(y-x+1:y+x-1))
Problem p02947 (python)

Fixed submission:
n = int(input())
d = dict()
for i in range(n):
  S = ''.join(sorted(list(input())))
  if S in d.keys():
    d[S] +=1
  else:
    d[S] = 1
 
ans = 0
for i in d.values():
  ans += i*(i-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
s = [''.join(sorted(input())) for i in range(n)]
count = 0
for i in range(n):
  for j in range(i+1,n):
    if s[j][0]==s[i][0]:
      count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
s = [''.join(sorted(input())) for i in range(n)]
count = 0
for i in range(n):
  for j in range(i+1,n):
    if s[j]==s[i]:
      count+=1
print(count)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = input()
s = [''.join(sorted(input())) for i in range(n)]
d = Counter(s)
count = 0
for i in d.values():
  if i !=1:
    count+=i
print(count)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = input()
s = [''.join(list(input()).sort()) for i in range(n)]
d = Counter(s)
count = 0
for i in d.values():
  if i !=1:
    count+=i
print(count)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = input()
s = [list(input()).sort() for i in range(n)]
d = Counter(s)
count = 0
for i in d.values():
  if i !=1:
    count+=i
print(count)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = input()
s = [list(input()).sort() for i in range(n)]
d = {a: len(a) for a in s}
count = 0
for i in d.values():
  if i !=1:
    count+=i
print(count)
Problem p02953 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
m = 0
for i in range(n):
  m = max(m,a[i])
  if a[i] < m-1:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
x＝[list(map(int,input().split()))]
y = []
for i in x:
  if x[i]>x[i+1]:
    y.append(x[i]-1)
  else:
    y.append(x[i])
for j in y:
  if y[j]>y[j+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
x＝[list(map(int,input().split()))]
y = []
for i in range(n):
  if x[i]>x[i+1]:
    y.append(x[i]-1)
  else:
    y.append(x[i])
for j in range(n):
  if y[j]>y[j+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
x＝list(map(int, input().split()))
y = []
for i in range(n):
  if x[i]>x[i+1]:
    y.append(x[i]-1)
  else:
    y.append(x[i])
for j in range(n):
  if y[j]>y[j+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
x＝list(map(int, input().split()))
for i in range(n):
  if x[i]>x[i+1]:
    x[i]==x[i]-1
for j in range(n):
  if x[j]>x[j+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
x＝list(map(int, input().split()))
for i in range(n-1):
  if x[i]>x[i+1]:
    x[i]-=1
for j in range(n-1):
  if x[j]>x[j+1]:
    print("No")
    exit()
print("Yes")
Problem p02982 (python)

Fixed submission:
n,d = map(int,input().split())
import numpy as np
xlist = [list(map(int,input().split())) for i in range(n)]
xarray = np.array(xlist)
ans = 0
for i in range(n):
  for j in range(i+1,n):
    if np.linalg.norm(xarray[i]-xarray[j])==int(np.linalg.norm(xarray[i]-xarray[j])):
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split())
import numpy as np
xlist = [list(map(int,input().split())) for i in range(n)]
xarray = np.array(xlist)
ans = 0
for i in range(n):
  for j in range(i+1,n):
    if np.linalg.norm(xarray[i]-xarray[j])==int(np.linalg.norm(xarray[i]-xarray[j])):
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split())
import numpy as np
xlist = [list(map(int,input().split())) for i in range(n)]
xarray = np.array(xlist)
ans = 0
for i in range(n):
  for j in range(i+1,n):
    if np.linalg.norm(xarray[i]-xarray[j])%1!=0:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split())
import numpy as np
xlist = [list(map(int,input().split())) for i in range(n)]
xarray = np.array(xlist)
ans = 0
for i in range(n):
  for j in range(i+1,n+1):
    if np.linalg.norm(xarray[i]-xarray[j])%1!=0:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split())
import numpy as np
xlist = [list(map(int,input().split())) for i in range(n)]
xarray = np.array(xlist)
ans = 0
for i in range(n):
  for j in range(i+1,n+1):
    if (xarray[i]-xarray[j])%1!=0:
      ans+=1
print(ans)
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())
ans = float('inf')
for i in range(L,R):
  for j in range(i+1,R+1):
    if (i*j)%2019==0:
      print(0)
      exit()
    ans = min(ans,(i*j)%2019)
print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())
 
if R - L >=2019:
  print(0)
else:
  ans = 2019
  for i in range(L,R-1):
    for j in range(i+1,R):
    ans = min(ans,(i*j)%2019)
  print(ans)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())
 
if R - L >=2019:
  print(0)
else:
  ans = 2019
  for i in range(L,R):
    for j in range(i+1,R):
      a = (i*j)%2019
    ans = min(ans,a)
  print(a)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())
 
if R - L >2019:
  print(2)
else:
  ans = 2019
  for i in range(L,R-1):
    a = (i*(i+1))%2019
    ans = min(ans,a)
  print(a)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())

if R - L >2019:
  print(2)
else:
  ans = 2019
  for i in range(L,R-1):
    a = ((i%2019)*((i%2019)+1))%2019
    ans = min(ans,a)
  print(a)
Problem p02994 (python)

Fixed submission:
N,L = map(int,input().split())
a = []
for i in range(1,N+1):
  a.append(L+i-1)
b = []
for i in a:
  b.append(abs(i))
for i in range(1,N+1):
  if abs(L+i-1) == min(b):
    print(sum(a)-L-i+1)

Buggy submission (verdict: Runtime Error):
N,L = map(int,input().split())
a = []
for i in range(1,N+1):
  a.append(L+i-1)
b = []
for i in a:
  b.append(abs(i))
for i in range(1,N+!):
  if abs(L+i-1) == min(b):
    print(sum(a)-L-i+1)

Buggy submission (verdict: Runtime Error):
N,L = map(int,input().split())
a = []
for i in range(N):
  a.append(L+i-1)
b = []
for i in a:
  b.append(abs(i))
for i in range(N):
  if abs(L+i-1) = min(b):
    print(sum(a)-L-i+1)

Buggy submission (verdict: Runtime Error):
N,L = map(int,input().split())
a = []
for i in range(N):
  a.append(L+i-1)
b = []
for i in a:
  b.append(abs(i))
for i in range(N)
  if abs(L+i-1) = min(b):
    print(sum(a)-L-i+1)
Problem p03001 (python)

Fixed submission:
W,H,x,y = map(int,input().split())
print(W*H*0.5, int(x==W*0.5 and y==H*0.5))

Buggy submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
print(W*H*0.5, int(x=W*0.5 and y=H*0.5))

Buggy submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
print(W*H*0.5, end="")
if x=W*0.5 and y=H*0.5:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
print(W*H*0.5, end="")
print(1 if x=W*0.5 and y=H*0.5: 0)
Problem p03030 (python)

Fixed submission:
n = int(input())
x = []
for i in range(n):
  s,p=input().split()
  x.append([s,int(p),i+1])
x.sort(key=lambda x:(x[0],-x[1]))
for i in x:
  print(i[2])

Buggy submission (verdict: Runtime Error):
n = input()
x = []
for i in range(n):
  s,p=input().split()
  x.append([s,int(p),i+1])
x.sort(key=lambda x:(x[0],-x[1]))
for i in x:
  print(i[2])
Problem p03076 (python)

Fixed submission:
import math
a = []
for i in range(5):
    a.append(int(input()))
sum = 0
r =10
for i in range(5):
  if a[i] % 10 ==0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r = min(r,a[i]%10)
    sum+= (10*math.ceil(a[i]/10))
print(sum-10+r)

Buggy submission (verdict: Runtime Error):
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 ==0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    sum+= (10*math.ceil(a[i]/10))
    r.append(int(a[i]%10))
print(sum-10+min(r))

Buggy submission (verdict: Runtime Error):
import math
a = [int(input()) for i in range(5)]
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 ==0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r.append(a[i]%10)
    sum+= (10*math.ceil(a[i]/10))
print(sum-10+min(r))

Buggy submission (verdict: Runtime Error):
import math
a = [int(input()) for i in range(5)]
sum = 0
r =[]
for i in range(5):
  if a[i] % 10 =0:
    sum+=a[i]
  elif a[i] % 10 !=0:
    r.append(a[i]%10)
    sum+= (math.ceil(a[i]/10)*10)
print(sum-10+min(r))
Problem p03085 (python)

Fixed submission:
a = input()
print("A" if a =="T" else "T" if a =="A" else "G" if a =="C" else "C")

Buggy submission (verdict: Runtime Error):
a = input()
print("A" if a = "T" else "T" if a ="A" else "G" if a ="C" else "C")
Problem p03086 (python)

Fixed submission:
n = input()
count=0
m = 0
for s in n:
  if s =="A" or s == "C" or s == "G" or s== "T" :
    count+=1
    m =max(m,count)
  else:
    count=0
print(m)

Buggy submission (verdict: Runtime Error):
n = input()
count=0
m = 0
for i in n:
  if s =="A" or s == "C" or s == "G" or s== "T" :
    count+=1
  else:
    m =max(m,count)
    count=0
print(m)
Problem p03087 (python)

Fixed submission:
a,b=map(int,input().split())
n = input()
m = [0]*a
for i in range(1,a):
  if n[i-1:i+1]=="AC":
    m[i]=m[i-1]+1
  else:
    m[i]=m[i-1]
for j in range(b):
  s,t=map(int,input().split())
  print(m[t-1]-m[s-1])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n = input()
for i in range(b):
  s,t=input().split()
  count=0
  for j in range(s-1,t-1):
    if n[j:j+2]=="AC":
      count+=1
  print(count)
Problem p03102 (python)

Fixed submission:
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
count = 0
for i in range(N):
  a = list(map(int,input().split()))
  P = C  
  for j in range(M):
    P += B[j]*a[j]
  if P>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
count = 0
for i in range(N):
  a = list(map(int,input().split()))
  for j in range(M):
  P = C  
  P += B[j]*a[j]
  if P>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
count = 0
for i in range(N):
  a = list(int,input().split())
  for j in range(M):
  P = C  
  P += B[j]*a[j]
  if P>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(int,input().split())
count = 0
for i in range(N):
  a = list(int,input().split())
  for j in range(M):
  P = C  
  P += B[j]*a[j]
  if P>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(int,input().split())
count = 0
for i in range(N):
  a = list(int,input().split())
  for i in range(M):
    s += B[i]*a[i]
  if s+C>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(int,input().split())
count = -
for i in range(N):
  a = list(int,input().split())
  for i in range(M)
  if sum(B[i]*a[i])+C>0:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(int,input().split())
count = -
for i in range(N):
  a = list(int,input().split())
  for i in range(M)
  if sum(B[i]*a[i])+C=0:
    count+=1
print(count)
Problem p03109 (python)

Fixed submission:
s = input()
if s <= "2019/04/30":
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
s = input()
if s <= 2019/04/30:
  print("Heisei")
else:
  print("TBD")
Problem p03110 (python)

Fixed submission:
n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="BTC":
    sum+=float(i)*380000
  else:
    sum+=int(i)
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="BTC":
    sum+=float(i)*380000
  else:
    sum+=i
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="JPY":
    sum+=i
  else:
    sum+=float(i)*380000
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum =0
for j in range(n):
  i,c = input().split()
  if c =="JPY":
    sum+=i
  else:
    sum+=i*380000
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [input().split() for i,c in range(n)]
sum =0
for i,c in l:
  if c =="JPY":
    sum+=i
  else:
    sum+=i*380000
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [list(input().split()) for i,c in range(n)]
sum =0
for i,c in l:
  if c =="JPY":
    sum+=i
  else:
    sum+=i*380000
print(sum)
Problem p03126 (python)

Fixed submission:
N,M = map(int,input().split())
foods = [0]*(M+1)
for i in range(N):
  line = list(map(int,input().split()))
  for j in range(1,line[0]+1):
    foods[line[j]]+=1
print(foods.count(N))

Buggy submission (verdict: Runtime Error):
N,P = map(int,input().split())
List=[]
for i in range(N):
    List+=list(map(int,input().split()))
count = 0
for i in range(P+1):
  if List.count(List[i])=N:
    count +=1
print(count)