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

Fixed submission:
#define
a=int(input())
b=int(input())
c=int(input())
x=int(input())

count=0
countlist=[]
#sorting
for e in range(0,a+1):
    if e*500 <= x:
        y=x-e*500
        for f in range(0,b+1):
            if f*100 <= y:
                z=y-100*f
                for g in range(0,c+1):
                    if g*50 == z :                                            
                        count = count +1

print(count)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
x=int(x/50)
countlist=[]

for e in range(a+1):
    if x < e*10:
        break
    else:
        x -= e*10
        count=0
        for f in range(b+1):
            if x < f*2 :
                break
            else:
                x-=2*f
                count=0
                for g in range(c+1):
                	if x<g:
                      break
                    else:
                     	count = count +1
				countlist.append(count)

print(sum(countlist))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
x=int(x/50)
countlist=[]

for e in range(a+1):
    if x < e*10:
        break
    else:
        x -= e*10
        count=0
        for f in range(b+1):
            if x < f*2 :
                break
            else:
                x-=2*f
                count=0
                for g in range(c+1):
                	if x<g:
                      break
                    else:
                     	count = count +1
						countlist.append(count)

print(sum(countlist))
Problem p03455 (python)

Fixed submission:
a, b=map(int, input().split())
c=(a*b)%2
if c==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=(a*b)%2
if c==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=(a*b)%2
if c=0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input("a"))
b=int(input("b"))
c=(a*b)%2
if c==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=input("a")
b=input("b")
c=(a*b)%2
if c=0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input("a"))
b=int(input("b"))
c=(a*b)%2
if c=0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input("a"))
b=int(input("b"))
c=a*b
amari=c%2
if amari=0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b=input()
a=int(a)
b=int(b)
c=a*b
amari=c%2
if amari=0:
  print("Even")
else:
  print("Odd")
Problem p03470 (python)

Fixed submission:
n=int(input())
a = []
for _ in range(n):
    a.append(int(input()))
b=[]
for x in range(1,101):
 for y in range(n):
     if a[y]==x:
        b.append(a[y])
        break

print(len(b))

Buggy submission (verdict: Runtime Error):
n=int(input())
a = []
for _ in range(n):
    a.append(int(input()))
for x in range(n-1):
    for y in range(x+1,n):
        if a[y] == a[x]:
            a.remove(a[x])

print(len(a))
Problem p02645 (python)

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

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


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = i - a
            top = i + a + 1
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
        if A == B:
            A = B
            break
        A = B[:]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = np.zeros(N)
        for i, a in enumerate(A):
            bottom = int(i - a)
            top = int(i + a + 1)
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] += np.ones(top-bottom)
        A = B[:]

    ans = ' '.join(list(map(str, map(int, A))))
    print(ans)


if __name__ == '__main__':
    main()
Problem p02647 (python)

Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from numba import jit
import sys
input = sys.stdin.readline


@jit
N, K = map(int, input().split())
A = list(map(int, input().split()))

for _ in range(K):
    B = [0]*(N+1)
    for i, a in enumerate(A):
        B[max(0, i-a)] += 1
        B[min(N, i+a+1)] -= 1
    for j in range(1, N):
        B[j] += B[j-1]
    if A == B[:-1]:
        A = B[:-1]
        break
    A = B[:-1]

ans = ' '.join(list(map(str, A)))
print(ans)

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


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = max(0, i-a)
            top = min(N, i+a+1)

            # B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
            B[bottom] += 1
            B[top] -= 1
        for j in range(1, N):
            B[j] += B[j-1]

        if A == B:
            A = B[:]
            break
        A = B[:]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()
Problem p02678 (python)

Fixed submission:
# 入力
N, M = map(int, input().split()) # ノード数, エッジ数
edges = [[] for i in range(N)] # エッジ
for i in range(M):
    A, B = map(int, input().split())
    edges[A - 1] += [B - 1]
    edges[B - 1] += [A - 1]

# 幅優先探索
que = [0] # 探索用キュー
ans = [0] + [-1 for i in range(N - 1)] # 未探索ノード 兼 道しるべ
while -1 in ans: # 未探索ノードがある間
    quetmp = que
    que = []
    for node in quetmp: # 探索キュー内のノードに対して
        for neighbor in edges[node]: # 全ての隣接ノードに対して
            if ans[neighbor] == -1: # 未探索なら
                ans[neighbor] = node + 1 # 道しるべを設定
                que += [neighbor] # キューに入れる

# 出力
print('Yes')
for a in ans[1:]:
    print(a)

Buggy submission (verdict: Runtime Error):
from collections import deque

N, M = map(int, input().split()) # ノード数, エッジ数
edges = [[] for i in range(M)] # エッジ
for i in range(M):
    A, B = map(int, input().split())
    edges[A - 1] += [B - 1]
    edges[B - 1] += [A - 1]

que = deque([0]) # 探索用キュー
ans = [0] + [-1 for i in range(N - 1)] # 未探索ノード 兼 道しるべ

while -1 in ans: # 未探索ノードがある間
    node = que.popleft() # キューから取り出し
    for neighbor in edges[node]: # 全ての隣接ノードに対して
        if ans[neighbor] == -1: # 未探索なら
            ans[neighbor] = node + 1 # 道しるべを設定
            que.append(neighbor) # キューに入れる

print('Yes')
for a in ans[1:]:
    print(a)

Buggy submission (verdict: Runtime Error):
from collections import deque

n, m = map(int, input().split()) #ノード数, エッジ数
x = [] #エッジ
y = {i + 1 for i in range(n)} #未探索ノード
z = deque([1]) #探索用キュー
ans = []

for i in range(m):
    x += [set(map(int, input().split()))]

while y != set():
    s = set()
    t = z.popleft()
    for u in x:
        if t in u:
            s.add((u - t).pop())
    for v in s & y:
        ans[v - 1] = t
        z.append(v)
    y.remove(t)

print('Yes')
for w in ans[1:]:
    print(w)
Problem p02640 (python)

Fixed submission:
import numpy as np

X, Y = map(int, input().split())

cranes = np.arange(X+1) * 2
turtles = (np.arange(X+1)*4).reshape(-1,1)

total = np.diag(np.fliplr(cranes + turtles))


if np.any(total == Y):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np

X, Y = map(int, input().split())

cranes = np.arange(X) * 2
turtles = (np.arange(X)*4).reshape(-1,1)

total = cranes + turtles

if np.any(total == Y):
  print('Yes')
else:
  print('No)
Problem p02741 (python)

Fixed submission:
s=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(s[k-1])

Buggy submission (verdict: Runtime Error):
s=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(s[k+1])
Problem p03471 (python)

Fixed submission:
import sys

num = raw_input().strip().split()
N = int(num[0])
Y = int(num[1])
for x in range(N + 1):
    for y in range(N + 1 - x):
        if 0 <= N - x - y  and 10000*x + 5000*y + 1000*(N - x - y) == Y:
            print(str(x)+ " "+ str(y) + " " + str(N-x-y))
            sys.exit()

print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import sys

N, Y = map(int, input().split())
res = (-1, -1, -1)
for x in range(N + 1):
    for y in range(N + 1 - x):
        if 0 <= N - x - y  and 10000*x + 5000*y + 1000*(N - x - y) == Y:
            print(x, y, N-x-y)
            sys.exit()

print("-1 -1 -1")
Problem p02641 (python)

Fixed submission:
X,N = map(int,input().split())
 
p = list(map(int,input().split()))
 
import sys
for i in range(300):
 
    if X-i not in p:
        print (X-i)
        sys.exit()
    elif X+i not in p:
        print (X+i)
        sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
p = [int(i) for i in input().split()]
q = []

if n == 0 or x not in p:
  print(x)
  sys.exit() 

for i in range(1, 101-x):
  if x + i not in p:
    q.append(x + i)
    if x - i not in p:
      q.append(x - i)
      break
    break

print(min(q))

Buggy submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
p = [int(i) for i in input().split()]
q = []

if n == 0 or x not in p:
  print(x)
  sys.exit() 

for i in range(1, 101-x):
  if x + i not in p:
    q.append(x + i)
    if x - i not in p:
      q.append(x - i)
  break
print(min(q))
Problem p02802 (python)

Fixed submission:
N, M = map(int, input().split())
 
ac, wa = [0]*N, [0]*N
 
for i in range(M):
    p, s = input().split()
    if s == 'WA' and ac[int(p)-1] == 0:
            wa[int(p)-1] += 1
    elif s == 'AC' and ac[int(p)-1] == 0:
            ac[int(p)-1] += 1
print('%d %d' % (sum(ac), sum([wa[k] for k in [i for i, j in enumerate(ac) if j != 0]])))

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

ac = [0]*n
wa = [0]*n

for i in range(m):
    p, s = input().split()

    if s == 'WA' and ac[int(p)-1] == 0:
            wa[int(p)-1] += 1
    elif s == 'AC' and ac[int(p)-1] == 0:
            ac[int(p)-1] += 1

print('%d %d' % (sum(ac), sum([wa[k] for k in [i for i,j in enumerete(ac) if j != 0]])))

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

ac = [0]*n
wa = [0]*n

for i in range(m):
    p, s = input().split()

    if s == 'WA' and ac[int(p)-1] == 0:
        wa[int(p)-1] += 1
    elif s == 'AC' and ac[int(p)-1] == 0:
        ac[int(p)-1] += 1

print('%d %d' % (sum(ac), sum([wa[k] for k in [i for i,j in enumerete(ac) if j != 0]])))

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

ac = [0]*n
wa = [0]*n

for i in range(m):
  p, s = input().split()

  if s == 'WA' and ac[int(p)-1] == 0:
    wa[int(p)-1] += 1
  elif s == 'AC' and ac[int(p)-1] == 0:
    ac[int(p)-1] += 1

print('%d %d' % (sum(ac), sum([wa[k] for k in [i for i,j in enumerete(ac) if j != 0]])))

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

ac = [0]*n
wa = [0]*n

for i in range(m):
  p, s = input().split()
  p = int(p)-1

  if s == 'WA' and ac[p] == 0:
    wa[p] += 1
  elif s == 'AC' and ac[p] == 0:
    ac[p] += 1

print('%d %d' % (sum(ac), sum([wa[k] for k in [i for i,j in enumerete(ac) if j != 0]])))

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

ac = [0]*n
wa = [0]*n

for i in range(m):
  p, s = input().split()
  p = int(p)-1

  if s == 'WA' and ac[p] == 0:
    wa[p] += 1
  elif s == 'AC' and ac[p] == 0:
    ac[p] += 1

print('%d %d' % (sum(ac), sum(wa[k] for k in [i for i,j in enumerete(ac) if j != 0])))

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

ac = [0]*n
wa = [0]*n

for i in range(m):
  p, s = input().split()
  p = int(p)-1

  if s == 'WA' and ac[p] == 0:
    wa[p] += 1
  elif s == 'AC' and ac[p] == 0:
    ac[p] += 1

print(sum(ac), sum(wa[k] for k in [i for i,j in enumerete(ac) if j != 0]))
Problem p02714 (python)

Fixed submission:
n = int(input())
s = input()
r = 0
g = 0 
for i in s:
  if i == 'R':
    r += 1
  elif i == 'G':
    g += 1
  
c = r*g*(n-r-g)
for j in range(1, n-1):
  for i in range(1, min(j, n - j -1) + 1):
    if (s[j] != s[j + i] ) and (s[j] != s[j - i]) and (s[j - i] != s[j + i]):
      c -= 1
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
r = 0
g = 0 
for i in range(s):
  if i == 'R':
    r += 1
  elif i == 'G':
    g += 1
  
c = r*g*(n-r-g)
for j in range(1, n):
  for i in range(1, min(j, n - j -1) + 1):
    if s[j] != s[j + i] and s[j] != s[j - i] and s[j - i] != s[j + 1]:
      c -= 1
print(c)
Problem p02921 (python)

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

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

Fixed submission:
M,D=map(int,input().split())
# print(M,D)
 
count = 0
for ii in range(1,M+1):
    
    for i in range (22, D + 1):
        #print(i)
        d1 = i % 10
        d2 = i // 10
        
        if d1 < 2 or d2 < 2:
            continue
        
        if ii == d1 * d2:
            count = count + 1
        
        
 
print(count)

Buggy submission (verdict: Runtime Error):
M,D=(int(input()) for _ in range(2))
# print(M,D)

count = 0
for ii in range(1,M+1):
    
    for i in range (22, D + 1):
        #print(i)
        d1 = i % 10
        d2 = i // 10
        
        if d1 < 2 or d2 < 2:
            continue
        
        if ii == d1 * d2:
            count = count + 1
        
        

print(count)

Buggy submission (verdict: Runtime Error):
M,D= int(input().split())
# print(M,D)

count = 0
for ii in range(1,M+1):
    
    for i in range (22, D + 1):
        #print(i)
        d1 = i % 10
        d2 = i // 10
        
        if d1 < 2 or d2 < 2:
            continue
        
        if ii == d1 * d2:
            count = count + 1
        
        

print(count)
Problem p02934 (python)

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

Buggy submission (verdict: Runtime Error):
a = 0
count = 0
while count < int(input())+1:
  b = int(input())
  a += 1/b
  count +=1
c = 1/a
print(c)

Buggy submission (verdict: Runtime Error):
a = 0
for i in range(1,int(input())+1):
  b = int(input())
  a += 1/b
a = 1/a

Buggy submission (verdict: Runtime Error):
a = 0
for i in range(1,int(input())+1):
  a += 1/int(input())
a = 1/a
Problem p02936 (python)

Fixed submission:
#D解説実装
n,q = map(int,input().split())
l = [0 for i in range(n)]
for _ in range(n-1):
    a,b = map(int,input().split())
    l[b-1] = (a-1)
ans = [0 for _ in range(n)]
p = [list(map(int,input().split())) for i in range(q)]
for p1 in p:
    ans[p1[0]-1] += p1[1]
for i in range(1,n):
    ans[i] += ans[l[i]]
print(" ".join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
l = [ [] for i in range(n)]
for _ in range(n-1):
    a,b = map(int,input().split())
    l[a-1].append(b-1)
ans = [0 for _ in range(n)]
p = [list(map(int,input().split())) for i in range(q)]
def f(p,x):
    ans[p] +=x
    for i in l[p]:
        f(i,x)
for p1 in p:
    f(p1[0]-1,p1[1])
print(" ".join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
l = [ [] for i in range(n)]
for _ in range(n-1):
    a,b = map(int,input().split())
    l[a-1].append(b-1)
ans = [0 for _ in range(n)]
p = [list(map(int,input().split())) for i in range(q)]
def f(p,x):
    ans[p] +=x
    for i in l[p]:
        f(i,x)
for p1 in p:
    f(p1[0]-1,p1[1])
print(" ".join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
l = [ [] for i in range(n)]
for _ in range(n-1):
    a,b = map(int,input().split())
    l[a-1].append(b-1)
ans = [0 for _ in range(n)]
p = [list(map(int,input().split())) for i in range(q)]
def f(p,x):
    ans[p] +=x
    for i in l[p]:
        f(i,x)
for p1 in p:
    f(p1[0]-1,p1[1])
print((ans))
Problem p02995 (python)

Fixed submission:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
a,b,c,d = map(int,input().split())
ans = b-a+1
dim = 0
ca = a % c
if not ca:
    dim +=1
da = a % d
if not da:
    dim +=1
cd = lcm(c,d)
cda = a%cd
if not cda:
    ans+=1
dim+= (b-a+ca)//c
dim+= (b-a+da)//d
ans += (b-a+cda)//cd
print(ans-dim)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a,b,c,d = map(int,input().split())
ans = b-a+1
dim = 0
ca = a % c
if not ca:
    dim +=1
da = a % d
if not da:
    dim +=1
cd = lcm(c,d)
cda = a%cd
if not cda:
    ans+=1
dim+= (b-a+ca)//c
dim+= (b-a+da)//d
ans += (b-a+cda)//cd
print(ans-dim)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if(S[K-1] == S[i]):
        print(S[i],end="")
    else:
        print("*",end="")
print()

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if(S[K] == S[i]):
        print(S[K],end="")
    else:
        print("*",end="")
print()
Problem p03845 (python)

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
for _ in range(int(input())):
  p,x = map(int,input().split())
  l=t.copy()
  l[p-1] = x
  print(sum(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
t = list(map(int,input().split()))
for _ in int(input()):
  p,x = map(int,input().split())
  l=t.copy()
  l[p-1] = x
  print(sum(l))
Problem p02687 (python)

Fixed submission:
x = input()

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

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

if x = "ABC":
  print("ARC")
else:
  print("ABC")
Problem p02830 (python)

Fixed submission:
N = int(input())
str = input()
str = str.split()
str1 = str[0]
str2 = str[1]

ans = ''
for i in range(0, N):
  ans += str1[i] + str2[i]
print(ans)

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

ans = ''
for i in range(0, N):
  ans += str1[i] + str2[i]
print(ans)
Problem p02909 (python)

Fixed submission:
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainy']
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Buggy submission (verdict: Runtime Error):
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainly']
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Buggy submission (verdict: Runtime Error):
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainly']
print(list[1])
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)
Problem p02658 (python)

Fixed submission:
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in ls:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
	print(ans)

Buggy submission (verdict: Runtime Error):
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in ls:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
print(ans)

Buggy submission (verdict: Runtime Error):
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in A:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
print(ans)
Problem p02657 (python)

Fixed submission:
a,b=[float(x) for x in input().strip().split(" ")]
x=a*(b*100)/100
print(int(x))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().strip().split(" ")]
x=1
c=pow(10,18)
for i in range(N):
    if x<c or x!=0:
        x *=A[i]
    
if x>pow(10,18):
    print("-1")
else:
    print(x)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().strip().split(" ")]
x=1

for i in range(N):
    x *=A[i]
    
if x>pow(10,18):
    print("-1")
else:
    print(x)
Problem p02639 (python)

Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
print(str(a.index(0))+1)

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
print(str(a.index(0))+1)

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split())
print(a.index(0)+1)

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split())
print(a.index(0)+1)
Problem p02641 (python)

Fixed submission:
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]

if x not in a:
    print(x)
else:
    a.sort()
    idx=a.index(x)
    i=max(idx-1,0)
    j=min(idx+1,n-1)
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=x-d
            break
        else:
            i=max(i-1,0)
        if(a[j]!=x+d):
            ans=x+d
            break
        else:
            j=min(j+1,n-1)
        d+=1
    print(ans)

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]

if x not in a:
    print(x)
else:
    a.sort()
    idx=a.index(x)
    i=max(idx-1,0)
    j=min(idx+1,n-1)
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=x-d
            break
        else:
            i-=1
        if(a[j]!=x+d):
            ans=x+d
            break
        else:
            j+=1
        d+=1
    print(ans)

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]
if not x in a:
    print(x)
else:
    a.sort()
    i=a.index(x)-1
    j=i+2
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=a[i]
            break
        else:
            i-=1
        if(a[j]!=x+d):
            ans=a[j]
            break
        else:
            j+=1
        d+=1
    print(ans)

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
a=list(map(int,input().split()))
if not x in a:
    print(x)
else:
    a.sort()
    i=a.index(x)-1
    j=i+2
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=a[i]
            break
        else:
            i-=1
        if(a[j]!=x+d):
            ans=a[j]
            break
        else:
            j+=1
        d+=1
    print(ans)
Problem p03861 (python)

Fixed submission:
def main():
    
    end, start, divisor = [int(i) for i in input().split()]
    a = start//divisor - (end-1)//divisor

    print(a)

main()

Buggy submission (verdict: Runtime Error):
import sys
def I_dont_know_what_to_do():
    a = long(input())
    b = long(input())
    c = int(input())

    if a < b:
        n = a
        a = b
        b = n

    s = (a - b + 2 - a % c - b % c) / c
    print(s)


I_dont_know_what_to_do()

Buggy submission (verdict: Runtime Error):
def I_dont_know_what_to_do():
    a = long long int(input())
    b = long long int(input())
    c = int(input())

    if (a - b < 0)
        n = a
        a = b
        b = n

    s = (a - b + 2 - a % c - b % c) / c
    print(s)


I_dont_know_what_to_do()