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

Fixed submission:
snacks_num, persons = map(int, input().split())

if snacks_num % persons == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
if snacks_num % persons == 0:
    print(0)
else:
    print(1)
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()))

ans=1

if 0 in a:
    print(0)
    exit()

for i in a:
   ans*=i
   if ans>10**18:
    print(-1)
    exit()


print(ans)
Problem p02534 (python)

Fixed submission:
k = int(input())
print('ACL'*k)

Buggy submission (verdict: Runtime Error):
print('ACL'*int(input())
Problem p02657 (python)

Fixed submission:
A,B=(int(x) for x in input().split())
num = A * B
print(num)

Buggy submission (verdict: Runtime Error):
print(A*B)

Buggy submission (verdict: Runtime Error):
print(a*b)
Problem p02554 (python)

Fixed submission:
from sys import stdin
N = stdin.readline().rstrip()
N = int(N)
satisfied_pattern = 10**N - (2*(9**N) - 8**N)
output = satisfied_pattern % (10**9+7)
print(output)

Buggy submission (verdict: Runtime Error):
N = input()
satisfied_pattern = 10**N - (2*(9**N) - 8**N)
output = satisfied_pattern % (10**9+7)
print(output)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
print(str(a*b))

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

Buggy submission (verdict: Runtime Error):
a = int(input().split())
print(a[0]*a[1])
Problem p02608 (python)

Fixed submission:
n = int(input())
ans = [0 for i in range(10100)]
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            if x*x+y*y+z*z+x*y+y*z+z*x < 10001:
                ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for i in range(1010)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            if x*x+y*y+z*z+x*y+y*z+z*x < 1000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for i in range(1000)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            if x*x+y*y+z*z+x*y+y*z+z*x < 1000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for i in range(1000)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            if x*x+y*y+z*z+x*y+y*z+z*x < 1000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1

for i in range(n):
    print(ans[i])
Problem p02642 (python)

Fixed submission:
n=int(input())
a=[int(_) for _ in input().split()]
lim=10**6+7
a.sort()
dp=[True for i in range(lim+1)]
ans=0
for i in range(n):
    if dp[a[i]]:
        if i==n-1 or a[i]!=a[i+1]:
            ans+=1
        for j in range(lim//a[i]+1):
            dp[j*a[i]]=False

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(_) for _ in input().split()]
lim=10**6+7
a.sort()
dp=[True for i in range(lim)]
ans=0
for i in range(n):
    if dp[a[i]]:
        if i==n-1 or a[i]!=a[i+1]:
            ans+=1
        for j in range(lim//a[i]+1):
            dp[j*a[i]]=False

print(ans)
Problem p02697 (python)

Fixed submission:
n,m=[int(_) for _ in input().split()]

n=2*m+1
if m%2==0:
  for i in range(m//2):
    print(i+1,m-i)
  for i in range(m//2):
    print(m+1+i,n-i)
else:
  for i in range(m//2):
    print(i+1,m-i)
  for i in range(m//2+1):
    print(m+1+i,n-i)

Buggy submission (verdict: Runtime Error):
n,m=[int(_) for _ in input()]
m1=n//2
for i in range(min(m1//2,m)):
  print(i+1,m1-i)
if m>m1:
  for i in range(m-m1):
    print(m1+i+1,m1*2-i-1)
Problem p02818 (python)

Fixed submission:
a,b,k=[int(x) for x in input().split()]

if(a-k>0):
  print(a-k,b)
elif a+b-k>0:
  print(0,a+b-k)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
a,b,k=[int(x) for x in input().aplit()]

if(k-a>0):
  print(k-a,b)
elif a+b-k>0:
  print(0,a+b-k)
else:
  print(0,0)
Problem p02982 (python)

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

x=[list(map(int,input().split())) for i in range(n)]

lis=[False for i in range(16001)]
i=0
while(i*i<16000):
  lis[i*i]=True
  i+=1
  
ans=0
for i in range(n):
  for j in range(i):
    dis=sum([(x[i][k]-x[j][k])*(x[i][k]-x[j][k]) for k in range(d)])
 #   print(dis)
    if lis[dis]:
      ans += 1
print(ans)

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

x=[list(map(int,input().split())) for i in range(n)]

lis=[False for i in range(16001)]
for i in range(1264):
  lis[i*i]=True
  
ans=0
for i in range(n):
  for j in range(i):
    dis=sum([(x[i][k]-x[j][k])*(x[i][k]-x[j][k]) for k in range(d)])
    print(dis)
    if lis[dis]:
      ans += 1
print(ans)

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

x=[list(map(int,input().split())) for i in range(n)]

lis=[False for i in range(5000)]
for i in range(65):
  lis[i*i]=True
  
ans=0
for i in range(n):
  for j in range(i):
    dis=sum([(x[i][k]-x[j][k])*(x[i][k]-x[j][k]) for k in range(d)])
    #print(dis)
    if lis[dis]:
      ans += 1
print(ans)

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

x=[list(map(int,input().split())) for i in range(n)]

lis=[False for i in range(5000)]
for i in range(65):
  lis[i*i]=True
  
ans=0
for i in range(n):
  for j in range(i):
    dis=sum([(x[i][k]-x[j][k])*(x[i][k]-x[j][k]) for k in range(d)])
    print(dis)
    if lis[dis]:
      ans += 1
print(ans)

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

x=[list(map(int,input().split())) for i in range(n)]

lis=[False for i in range(4000)]
for i in range(63):
  lis[i*i]=True
  
ans=0
for i in range(n):
  for j in range(i):
    dis=sum([(x[i][k]-x[j][k])*(x[i][k]-x[j][k]) for k in range(d)])
    if lis[dis]:
      ans += 1
print(ans)
Problem p03067 (python)

Fixed submission:
a,b,c =[int(x) for x in input().split()]

if a < c < b or b < c < a:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = [int(x) for x in input().split()]

if ( a < c <b or b< c A):
  print("Yes")
else:
  print("No")
Problem p03193 (python)

Fixed submission:
N,W,H=[int(i) for i in input().split()]

ans=0

for i in range(N):
  w,h=[int(x) for x in input().split()]
  if h>=H and w>= W:
    ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N,W,H=[int(i) for i in input.split()]

ans=0

for i in range(N):
    h,w=[int(x) for x in input.split()]
    if h<=H and w<= W:
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N,W,H=[int(i) for i in input.split()]

ans=0

for i in range(N):
  h,w=[int(x) for x in input.split()]
  if h<=H and w<= W:
    ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N,W,H=[int(i) for i in input.split()]

nas=0

for i in range(N):
  h,w=[int(x) for x in input.split()]
  if h<=H and w<= W:
    ans+=1

print(ans)
Problem p03194 (python)

Fixed submission:
import sys

N,P=[int(i) for i in input().split()]
i=2
ans = 1
c=0
if N == 1:
  print(P)
  sys.exit()
while P>i*i-4:
  if P%i==0:
    P//=i
    c+=1
    if c==N:
      ans*=i
      c=0
  else:
    c=0
    i+=1
if P==i and c+1 ==N:
  ans*=i
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

N,P=[int(i) for i in input().split()]
i=2
ans = 1
c=0
if N == 1:
  print(P)
  sys.exit()
while P>i*i:
  if P%i==0:
    P//=i
    c+=1
    if c==N:
      ans*=i
      c=0
  else:
    c=0
    i+=1
if p==i and c+1 ==N:
  ans*=i
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

N,P=[int(i) for i in input().split()]
i=2
ans = 1
c=0
if N == 1:
  print(P)
  sys.exit()
while P>i*i:
  if P%i==0:
    P//=i
    c+=1
    if c==N:
      ans*=i
      c=0
  else:
    c=0
    i+=1
if p==i and c+1 ==N:
  ans*=i
print(ans)

Buggy submission (verdict: Runtime Error):
N,P=[input().split()]
i=2
ans = 1
c=0
while P>1:
  if P%i==0:
    P//=i
    c+=1
    if c==N:
      ans*=i
      c=0
  else:
    c=0
    i+=1

print(ans)
Problem p03213 (python)

Fixed submission:
n=int(input())
e=[0 for i in range(n+1)]
for i in range(2,n+1):
  for j in range(2,i+1):
    if i==1:
      break
    while i%j==0:
      i//=j
      e[j]+=1

def num(k):
  ret=0
  for i in range(n):
    if e[i]>=k-1:
      ret += 1
  return ret
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

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

e=[0 for i in range(n)]
for i in range(2,n):
  for j in range(2,i):
    if i==1:
      break
    while i%j==0:
      i//=j
      e[j]+=1

def num(k):
  ret=0
  for i in range(n):
    if e[i]>=k:
      ret += 1
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)
Problem p03214 (python)

Fixed submission:
n =int(input())
a=[int(x) for x in input().split()]
 
s=sum(a)
ans=0
diff=abs(s-a[0]*n)
for i in range(n):
  if diff>abs(s-a[i]*n): 
    diff= abs(s-a[i]*n)
    ans=i
print(ans)

Buggy submission (verdict: Runtime Error):
n =int(input())
a=[int(x) for x in input().spllit()]

s=sum(a)
ans=0
diff=abs(s-a[0]*n)
for i in range(len(a)):
  if diff<abs(s-a[i]*n):
    diff= abs(s-a[i]*n)
    ans=i
print(i)
Problem p03219 (python)

Fixed submission:
x,y = [int(i) for i in input().split()]

print(x+y//2)

Buggy submission (verdict: Runtime Error):
import math
math.gcd(1,2)

x,y = [int(i) for i in input().split()]

print(x+y//2)
Problem p03231 (python)

Fixed submission:
def gcd(a,b):
  if a%b == 0:
    return b
  return gcd(b,a%b)


N,M = [int(i) for i in input().split()]

S = input()
T = input()

x = N * M // gcd(N,M)
flag = True

#print(S[0 * (N / math.gcd(N,M)) + 1])
for i in range(gcd(N,M)):
  if not(S[i * (N //gcd(N,M))] == T[i * (M // gcd(N,M))]):
    flag = False
#    print(S[i * (N // math.gcd(N,M))]  , T[i * (M // math.gcd(N,M))])
if flag:
  print(x)
else:
  print('-1')

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


N,M = [int(i) for i in input().split()]

S = input()
T = input()

x = N * M // gcd(N,M)
flag = True

#print(S[0 * (N / math.gcd(N,M)) + 1])
for i in range(gcd(N,M)):
  if not(S[i * (N //gcd(N,M))] == T[i * (M // gcd(N,M))]):
    flag = False
#    print(S[i * (N // math.gcd(N,M))]  , T[i * (M // math.gcd(N,M))])
if flag:
  print(x)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
import math

N,M = [int(i) for i in input().split()]

S = input()
T = input()

x = N * M // math.gcd(N,M)
flag = True

#print(S[0 * (N / math.gcd(N,M)) + 1])
for i in range(math.gcd(N,M)):
  if not(S[i * (N // math.gcd(N,M))] == T[i * (M // math.gcd(N,M))]):
    flag = False
#    print(S[i * (N // math.gcd(N,M))]  , T[i * (M // math.gcd(N,M))])
if flag:
  print(x)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
import math

N,M = [int(i) for i in input().split()]

S = input()
T = input()

x = N * M // math.gcd(N,M)
flag = True

#print(S[0 * (N / math.gcd(N,M)) + 1])
for i in range(math.gcd(N,M)):
  if not(S[i * (N // math.gcd(N,M))] == T[i * (M // math.gcd(N,M))]):
    flag = False
#    print(S[i * (N // math.gcd(N,M))]  , T[i * (M // math.gcd(N,M))])
if flag:
  print(x)
else:
  print('-1')
Problem p03238 (python)

Fixed submission:
N = input()

if N == '1':
    print("Hello World")

else:
    print(int(input()) + int(input()))

Buggy submission (verdict: Runtime Error):

lis = []

N,M = [int(i) for i in input().split()]
M_ = M
i = 2

while True:
    if M % i == 0:
        M = M // i
        lis.append(i)
    elif M == 1:
        break
    else:
        i += 1
ans = M_

for n in range(2**len(lis)):
    m = bin(n)[-1:1:-1]
    ret = 1
    for l in range(len(m)):
        if int(m[l]):
            ret *= lis[l]
           # print(lis[l])
            if  ret >= N:
                break
    if ret >= N:
        #print(ret)
        ans = min(ans,ret)

print(M_//ans)
Problem p03239 (python)

Fixed submission:
N, T = [int(i) for i in input().split()]
ans = 1500
for i in range(N):
    c1, c2 = [int(j) for j in input().split()]

    if c2 <= T:
        ans = min(c1,ans)

if ans == 1500:
    ans = "TLE"
print(ans)

Buggy submission (verdict: Runtime Error):
N, T = [int(i) for i in input().split()]
ans = LTE
for i in range(N):
    c1, c2 = [int(j) for j in input().split()]

    if c2 <= T:
        ans = c1

print(ans)

Buggy submission (verdict: Runtime Error):
N,T = [int(i) for i in input()]
ans = LTE
for i in range(N):
  c1,c2 = [int(j) for j in input()]
  
  if c2 <= T:
    ans = c1
    
print(ans)
Problem p03241 (python)

Fixed submission:
import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)


lis.sort()
i =1
for i in lis:
    if i >= N:
        break

print(M//i )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)


lis.sort()
for i in lis:
    if i >= N:
        break

print(M//i )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)


lis.sort()
for i in lis:
    if i >= N:
        break

print(M//i3 )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)


ret = 0
for i in lis:

    ret = i
    if i >= N:
        break

print(M//ret )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]

for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)

lis.sort()
ret = 0
for i in lis:

    ret = i
    if i >= N:
        break

print(M//ret )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]
M_ = M
i = 2
for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)

lis.sort()
ret = 0
for i in lis:

    ret = i
    if i >= N:
        break

print(M_//ret )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]
M_ = M
i = 2
for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)

lis.sort()
ret = 0
for i in lis:

    ret = i
    if i > N:
        break

print(M_//ret )

Buggy submission (verdict: Runtime Error):
import  math
lis = []

N,M = [int(i) for i in input().split()]
M_ = M
i = 2
for i in range(1,int(math.sqrt(M))):
    if M % i == 0:
        lis.append(i)
        lis.append(M//i)

lis.sort()
ret = 0
for i in lis:
    if i > N:
        break
    ret = i

print(M_//ret )
Problem p03244 (python)

Fixed submission:
n = int(input())

v = [i for i in input().split()]

v1 = {}

v2 = {}

for i in range(n//2):
    if  v[2 *i +1] in v1.keys():
        v1[v[2 * i +1]] += 1
    else:
        v1[v[2 * i + 1]] = 1

    if v[2 * i] in v2.keys():
        v2[v[2 * i]] += 1
    else:
        v2[v[2 * i]] = 1


v1 = sorted(v1.items(),key=lambda x:  x[1])
v2 = sorted(v2.items(),key=lambda x:  x[1])
v1.reverse()
v2.reverse()
v1.append((None,0))
v2.append((None,0))
#print(v1)
if v1[0][0] == v2[0][0]:
    ans = max(v1[0][1]+v2[1][1] , v1[1][1] + v2[0][1])
else:
    ans = v1[0][1] + v2[0][1]

print(n - ans)

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

v = [int(i) for i in input().split()]

v1 = {}

v2 = {}

for i in range(n//2):
    if  v[2 *i +1] in v1.keys():
        v1[v[2 * i +1]] += 1
    else:
        v1[v[2 * i + 1]] = 1

    if v[2 * i] in v2.keys():
        v2[v[2 * i]] += 1
    else:
        v2[v[2 * i]] = 1


v1 = sorted(v1.items(),key=lambda x: - x[0])
v2 = sorted(v2.items(),key=lambda x: - x[0])
v1.reverse()
v2.reverse()
v1.append((None,0))
v2.append((None,0))
@print(v1)
if v1[0][0] == v2[0][0]:
    ans = max(v1[0][1]+v2[1][1] , v1[1][1] + v2[0][1])
else:
    ans = v1[0][1] + v2[0][1]

print(n - ans)
Problem p03294 (python)

Fixed submission:
a  = input()
 
ans = 0
a = [int(i) for i in input().split()]
 
for num in a:
  ans += num - 1
  
print(ans)

Buggy submission (verdict: Runtime Error):
a  = input()
 
ans = 0
a = [int(i) for i in input().split()]
 
for num in a:
  ans += num - 1
  
 print(ans)

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

ans = 0
a = [int(i) for i in input().split()]

for num in a:
  ans += num - 1
  
 print(ans)
Problem p03302 (python)

Fixed submission:
a,b = [int(i) for i in input().split()]

if a+b == 15:
    print('+')
elif a*b == 15:
    print('*')
else:
    print('x')

Buggy submission (verdict: Runtime Error):
a,b = [int(i) i for i in input().split()]
if a*b == 15:
  print('*')
elif a+b == 15:
  print('+')
else:
  print('x')

Buggy submission (verdict: Runtime Error):
a,b = [int(i) i for i in input().split()]
if a*b == 15:
	print('*')
elif a+b == 15:
	print('+')
else:
  	print('x')
Problem p03304 (python)

Fixed submission:
n,m,d = [int(i) for i in input().split()]
if d == 0:
    ans = (n-d)*(m-1)/(n*n)
else:
    ans = 2*(n-d)*(m-1)/(n*n)

print(ans)

Buggy submission (verdict: Runtime Error):
n,m,d = [int(i) for i in input().split()]

ans = 2(n-d)*(m-1)/(n*n)

print(ans)
Problem p03359 (python)

Fixed submission:
a , b = input().split()
a = int(a)
b = int(b)
if b >= a:
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):
a , b = input().split()
a = int(a)
b = int(b)
print(a,b)
if b > a:
    print(a+1)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
a , b = input().split()
a = int(a)
b = int(b)
print(a,b)
if b > a:
    print(a+1)
else:
    print(a)
Problem p03360 (python)

Fixed submission:
a, b, c = (int(i) for i in input().split())
d = int(input())
max_a = max(a,b,c)

ans = a + b + c + max_a * pow(2 , d) - max_a
print(ans)

Buggy submission (verdict: Runtime Error):
h , w = (int(i) for i in input().split())
a =[]
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]


for i in range(h):
    a.append(input())
    
f = True
def check(x,y):
    if a[x][y] =='.':
        return True
    for n in range(4):
        i = dx[n]
        j = dy[n]
#        print(a[x+i][y+j])
        if 0 <= x+i < w and 0 <= y + j < h and a[x+i][y+j]=='#':
            #print(x+i,y+j)
            return True
    return False
#print(check(0,3))
f = True
for i in range(w):
    for j in range(h):
        l = check(i,j)
        if not(l) and f:
            print ("No")
            f = False
if(f):
    print("Yes")
Problem p03363 (python)

Fixed submission:
N = int(input())

A = input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)

Buggy submission (verdict: Runtime Error):
N = raw_input()

A = raw_input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)

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

A = input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)

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

A = raw_input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)

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

A = raw_input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)

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

A = raw_input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)
Problem p03469 (python)

Fixed submission:
S = (input().split('/'))

print("2018/"+S[1]+'/'+S[2])

Buggy submission (verdict: Runtime Error):
S = int(input().split('/'))

print("2018/"+S[1]+'/'+S[2])
Problem p03493 (python)

Fixed submission:
a=[int(x) for x in input()]
print(sum(a))

Buggy submission (verdict: Runtime Error):
a=[int(x) for x in in input()]
print(sum(a))
Problem p03614 (python)

Fixed submission:
N = int(input())

p = input().split(' ')
ans = 0
for i in range(N):
    if int(p[i]) == i+1:
        if not(i==N-1) and not(p[i+1] ==i+1):
            rrr = p[i]
            p[i] = p[i+1]
            p[i+1] = rrr
            ans +=1
        else:
            rrr = p[i]
            p[i]=p[i-1]
            p[i-1] =rrr
            ans +=1

print(ans)
#print(p)

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

p = input().split(' ')
ans = 1
for i in range(N):
    if int(p[i])==i):
        ans += 1

print(ans//2)
Problem p03633 (python)

Fixed submission:
def gcd(a,b):
    if a % b ==0:
        return b
    return gcd(b,a%b)

N = int(input())
a = 1
for i in range(N):
    b = int(input())
    a = a * b // gcd(a,b)

print(a)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
a = 1
for i in range(N):
    b = int(input())
    a = a * b //math.gcd(a,b)

print(a)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
a = 1
for i in range(N):
    b = int(input())
    a = a * b //math.gcd(a,b)

print(a)
Problem p03636 (python)

Fixed submission:
s=input()

print(s[0],end="")
print(len(s)-2,end="")
print(s[-1])

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

print(s[0]+len(s)+s[-1])
Problem p03853 (python)

Fixed submission:
H,W = [int(i) for i in input().split()]

for i in range(H):
    line = input()
    print(line)
    print(line)

Buggy submission (verdict: Runtime Error):
H,W=[int(i) for i in input().split()
ans=[]
for i in range(H):
     lis =input()
     ans.append(lis)
     ans.append(lis)

print(ans)

Buggy submission (verdict: Runtime Error):
H,W=[int(i) for i in input().split()
ans=[]
for i in range(H):
lis =input()
     ans.append(lis)
     ans.append(lis)

print(ans)

Buggy submission (verdict: Runtime Error):
H,W=[int(i) for i in input().split()
ans=[]
for i in range(H):
 lis =input()
 ans.append(lis)
 ans.append(lis)

print(ans)
Problem p02606 (python)

Fixed submission:
l,r,d = map(int, input().split())
ans=0

for i in range(l,r+1):
    if (i%d == 0): ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):


l,r,d = map(input().split(), int)
ans=0

for i = range(l,r+1):
    if (i%d == 0) ans += 1

print(ans)