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

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
k=0
if 0 in A:
  print(0)
else:
  for i in range(N):
    a*=A[i]
    if a>10**(18):
      k=1
      break
  if k==1:
    print(-1)
  else:
    print(a)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000000000)
N=int(input())
A=list(map(int,input().split()))
def f(i):
  if i==0:
    return 1
  else:
    return f(i-1)*A[i-1]
a=f(N)
print(a if a<=10**(18) else -1)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
def f(i):
  if i==0:
    return 1
  else:
    return f(i-1)*A[i-1]
a=f(N)
print(a if a<=10**(18) else -1)
Problem p02684 (python)

Fixed submission:
n, k = map(int,input().split())
a = list(map(int,input().split()))

s = [True] * n #訪れているかを判定するlist
c = [1] #訪ずれた順番を記録するlist
now = 0 #現在地
while s[now]:
    s[now] = False #訪ずれた地点を記録
    now = a[now] - 1
    c.append(now+1)

start_cycle = c.index(c[-1]) #ループに入る点
loop = c[start_cycle:-1] #ループのlist
cycle = len(loop)

if k < start_cycle: #ループまで到達できないK
    print(c[k])
else:
    k -= start_cycle
    k %= cycle
    print(loop[k])

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
now=1
count=0
a=0
l=[1]
b=0
c=0
q=[True]*N
while a==0and count<K:
    now=A[now-1]
    count+=1
    if q[now-1]:
        a=1
    else:
        l.append(now)
        q[now-1]=False
        
b=l.index(now)
c=count-b
if count==K:
    print(now)
else:
    n= ((K-b)%c)
    print(l[b+n])
Problem p02705 (python)

Fixed submission:
import math
a=int(input())
print(2* math.pi *a)

Buggy submission (verdict: Runtime Error):
N,K =map(int,input().split())
count=0
for a in range(K,N+2):
  count+=0.5*(N-a+1)*(N-a+2)-0.5*a*(a-1)+1
print(count%(10**9+7))

Buggy submission (verdict: Runtime Error):
N=int(input())
A =list(map(int,input().split()))
for i in range(N):
  print(A.count(i+1))

Buggy submission (verdict: Runtime Error):
N,M= map(int,input().split())
List = [map(int,input().split())]
print(N-sum(List) if N-sum(List) >= 0 else -1)

Buggy submission (verdict: Runtime Error):
import.math
a=int(input())
print(2* math.pi *a)

Buggy submission (verdict: Runtime Error):
a=int(input())
print(2* \pi *a)

Buggy submission (verdict: Runtime Error):
a=input()
print(2* \pi *a)
Problem p02706 (python)

Fixed submission:
N,M= map(int,input().split())
List = list(map(int,input().split()))
print(N-sum(List) if N-sum(List) >= 0 else -1)

Buggy submission (verdict: Runtime Error):
N M = map(int,input().split())
List = list(map(int,input().split()))
print(N-sum(List) if N-sum(List) >= 0 else -1)

Buggy submission (verdict: Runtime Error):
N M = map(int,input().split())
List = list(map(int,input().split()))
print(N-sum(List) if N-sum(List) >= 0 else -1)

Buggy submission (verdict: Runtime Error):
N M = map(int,input().split())
List = [map(int,input().split())]
print(N-sum(List) if N-sum(List) >= 0 else -1)
Problem p02708 (python)

Fixed submission:
N,K =map(int,input().split())
count=0
for a in range(K,N+2):
  count+=0.5*N*(N+1)-0.5*(N-a)*(N-a+1)-0.5*a*(a-1)+1
print(int(count%(10**9+7)))

Buggy submission (verdict: Runtime Error):
N,K =map(int,input().split())
count=0
for a in range(K:N+2):
  count+=0.5*(N-a+1)*(N-a+2)-0.5*a*(a-1)+1
print(count%(10**9+7))
Problem p02713 (python)

Fixed submission:
import math
from functools import reduce

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

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

K = int(input())
count = 0
for a in range(1,K+1):
  for b in range(1,K+1):
    for c in range(1,K+1):
      count+=gcd(a,b,c)
print(count)

Buggy submission (verdict: Runtime Error):
from math import gcd()
K = int(input())
count = 0
for a in range(1,K+1):
  for b in range(1,K+1):
    for c in range(1,K+1):
      count+=gcd(a,b,c)
Problem p02720 (python)

Fixed submission:
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  elif a%10==0:
    que.extend([10*a,10*a+1])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)

Buggy submission (verdict: Runtime Error):
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k-1:
  a=que.popleft()
  count+=1
  if a%10==1:
    que.extend([10*a+1,10*a+2])
  elif a%10==9:
    que.extend([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)

Buggy submission (verdict: Runtime Error):
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)

Buggy submission (verdict: Runtime Error):
from collections import deque
que=deque([range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)

Buggy submission (verdict: Runtime Error):
from collections import deque
que=deque([range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft
  count+=1
  if a%10 == 1:
    que.append([10*a+1,10*a+2])
  elif a%10==9:
    que.append([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.append([b,b+1,b+2])
print(count)
Problem p02724 (python)

Fixed submission:
X = int(input())
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)

Buggy submission (verdict: Runtime Error):
X = input()
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)
Problem p02756 (python)

Fixed submission:
from collections import deque
S=deque(list(input()))
Q=int(input())
l=list(input().split() for i in range(Q))
a=0
for j in l:
  if j[0]=="1":
      a+=1
  else:
    if j[1]=="1":
        if a %2==0:
            S.appendleft(j[2])
        else:
            S.append(j[2])
    else:
        if a %2==1:
            S.appendleft(j[2])
        else:
            S.append(j[2])
        
if a%2==0:
    print("".join(S))
else:
    S.reverse()
    print("".join(S))

Buggy submission (verdict: Runtime Error):
from collections import deque
S=deque(list(input()))
Q=int(input())
l=list(input().split() for i in range(Q))
a=0
for j in l:
  if j[0]=="1":
      a+=1
  else:
    if j[1]=="1":
        if a %2==0:
            S.appendleft(j[2])
        else:
            S.append(j[2])
    else:
        if a %2==1:
            S.appendleft(j[2])
        else:
            S.append(j[2])
        
if a%2==0:
    print("".join(S))
else:
    S=S[::-1]
    print("".join(S))
Problem p02768 (python)

Fixed submission:
n,a,b=map(int,input().split())
def comb(n,k):
    nCk = 1
    MOD = 10**9+7

    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk

x=pow(2,n,10**9+7)-1
y=comb(n,a)+comb(n,b)
ans=x-y





while ans<0:
          ans+=10**9+7
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
mod = 10**9+7
MAX_N = 10**6

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%mod)

fact_inv[-1] = pow(fact[-1],mod-2,mod)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%mod


def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod



x=mod_comb_k(n,a,mod)+mod_comb_k(n,b,mod)
y=((pow(2,n)-1)%(10**9+7))
ans=(y-x%(10**9+7))
while ans<0:
          ans+=10**9+7
print(ans)

Buggy submission (verdict: Runtime Error):

n,a,b=map(int,input().split
mod = 10**9+7
MAX_N = 10**6

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%mod)

fact_inv[-1] = pow(fact[-1],mod-2,mod)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%mod


def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod



x=mod_comb_k(n,a,mod)+mod_comb_k(n,b,mod)
y=((pow(2,n)-1)%(10**9+7))
ans=(y-x%(10**9+7))
while ans<0:
          ans+=10**9+7
print(ans)

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce
n,a,b=map(int,input(),split())
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

x=cmb(n,a)+cmb(n,b)
y=pow(2,n)-1
ans=(y-x%(10**9+7))
print(ans)
Problem p02786 (python)

Fixed submission:
H=int(input())
n=0
while H!=1:
  H=int(H/2)
  n+=1
print(2**(n+1)-1)

Buggy submission (verdict: Runtime Error):
H=input()
count=0
m=1
while H:
  if H==1:
    count+=m
  else:
    m*=2
    H=int(H/2)
print(count)
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a**2*b>=2*x:
  ans=math.degrees(math.atan(2*x/(a*b**2)))
  print(90-ans)
else:
  ans=math.degrees(math.atan(a**2/(2*a*b-2*x/a)))
  print(90-ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a**2*b>=2*x:
  ans=math.degrees(math.atan(2*x/(a*b**2)))
  print(ans)
else:
  ans=math.degrees(math.atan(a**2/(2*a*b-2*x/a)))
  print(ans)

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
if a**2*b>2*x:
  ans=math.degree(math.atan(2*x/(a*b**2)))
  print(ans)
else:
  ans=math.degree(math.atan(a**2/(2*a*b-x/a)))
  print(ans)
Problem p03160 (python)

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

dp=[0]*N
dp[1]=abs(h[1]-h[0])
for i in range(N-2):
  dp[i+2]=min(dp[i+1]+abs(h[i+2]-h[i+1]),dp[i]+abs(h[i+2]-h[i]))

print(dp[N-1])

Buggy submission (verdict: Runtime Error):
dp=[0]*N
dp[1]=abs(h[1]-h[0])
for i in range(N):
  dp[i+2]=min(dp[i+1]+abs(h[i+2]-h[i+1]),dp[i]+abs(h[i+2]-h[i]))

print(dp[N])
Problem p03636 (python)

Fixed submission:
a=input()
print(a[0]+str(len(a)-2)+a[-1])

Buggy submission (verdict: Runtime Error):
a=input()
print(a[0]+str(len(s)-2)+a[-1])

Buggy submission (verdict: Runtime Error):
a=input()
print(a[1]+str(len(s)-2)+a[-1])
Problem p03860 (python)

Fixed submission:
x,y,z=map(str,input().split())
print('A'+y[0]+'C')

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split())
print('A'+y[0]+'C')
Problem p04001 (python)

Fixed submission:
S=input()
n=len(S)
ans=0

for bit in range(1<<(n-1)):
  f=S[0]
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=S[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
def dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(dfs(0,S[0])

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
dfs dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(def(0,S[0])

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
def dfs(i,f):
  if i==n:
    return sum(map(int,f.split("+")))
  return dfs(i+1,f)+dfs(i+1,f+"+"+S[i+1])
print(def(0,S[0])

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)
ans=0
f=S[0]
for bit in range(1<<(n-1)):
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=s[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)-1
ans=0
f=S[0]
for bit in range(1<<(n-1)):
  for i in range(n-1):
    if bit & (1<<i):
      f+="+"
    f+=s[i+1]
  ans+=sum(map(int,f.split("+")))
print(ans)
Problem p03264 (python)

Fixed submission:
K = input()

gusu = int(int(K) / 2)
kisu = int((int(K)+1) / 2)

print(int(kisu * gusu))

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

kisu = K/2
gusu = (K+1)/2

print(kisu * gusu)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split()) 
if (a * b) / 2 %= 0:
  print("Even")
else:
  print("Odd")
Problem p03493 (python)

Fixed submission:
a = input()
print(a.count('1'))

Buggy submission (verdict: Runtime Error):
a = input()
print(a.count('1')

Buggy submission (verdict: Runtime Error):
a = list(input())
print(a.count('1')
Problem p03494 (python)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
b = float('inf')
for a in li:
    c = 0
    while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int, input().split())
b = float('inf')

for a in li:
    c = 0
	while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)

Buggy submission (verdict: Runtime Error):
a = int(input())
li = list(map(int, input().split())
b = float()

for a in li:
    c = 0
	while a%2 == 0:
      a = a/2
      c += 1
    b = min(b,c)
print(b)

Buggy submission (verdict: Runtime Error):
a = int(input())
li = list(map(int, input().split())
b = float('inf')

for a in li:
          c = 0
	while a%2 == 0:
          a = a/2
          c += 1
          b = min(b,c)
print(b)

Buggy submission (verdict: Runtime Error):
a = int(input())
li = list(map(int, input().split())
b = float()

for a in li:
          c = 0
	while a%2 == 0:
          a = a/2
          c += 1
          b = min(b,c)
    print(b)
Problem p02600 (python)

Fixed submission:
# -*- coding: utf-8 -*-

X=int(input())

400 <= X <=1999

if (400<= X <= 599):
    print("8")
elif (600<= X <=799):
    print("7")
elif(800<= X <=999):
    print("6")
elif(1000<= X <=1199):
    print("5")    
elif(1200<= X <=1399):
    print("4")   
elif(1400<= X <=1599):
    print("3")   
elif(1600<= X <=1799):
    print("2")
elif(1800<= X <=1999):
    print("1")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

X=int(input())

400 <= X <=1999

if (400<= X <= 599):
    print("8")
elif (600<= X <=799):
    print("7")
elif(800<= X <=999):
    print("6")
elif(1000<= X <＝1199):
    print("5")    
elif(1200<= X <=1399):
    print("4")   
elif(1400<= X <=1599):
    print("3")   
elif(1600<= X <=1799):
    print("2")   
elif(1800<= X <=1999):
    print("1")
Problem p02730 (python)

Fixed submission:
s= input()
flag = True
for i in range((len(s)-1)//2):
	if s[i] == s[len(s)-i-1]:
		continue
	else:
		flag = False
		break

if flag:
	left = s[:(len(s)-1)//2]
	right = s[(len(s)+3)//2-1:]
	if left == right:
		print("Yes")
	else:
		print("No")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
 = input()
flag = True
for i in range((len(s)-1)//2):
	if s[i] == s[len(s)-i-1]:
		continue
	else:
		flag = False
		break

if flag:
	left = s[:(len(s)-1)//2]
	right = s[(len(s)+3)//2-1:]
	if left == right:
		print("Yes")
	else:
		print("No")
else:
	print("No")
Problem p02684 (python)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

num = 1
li = [1]
flag = [True] * n
flag[0] = False

for i in range(k):
    num = a[num-1]
    if flag[num-1]:
        li.append(num)
        flag[num-1] = False
    else:
        break

d = li.index(num)
ans = (k-d)%(len(li)-d)+d

print(li[ans])

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,K=map(int,readline().split())
A=list(map(lambda x: int(x)-1,readline().split()))

visited=[True]*N
visitednum=[]
now=0
for i in range(K+1):
    if not visited[now]:
        break
    else:
        visited[now]=False
        visitednum.append(now)
        now=A[now]
d=visitednum.index(now)
ans=(K-d)%(len(visitednum)-d)+d
print(visitednum[ans]+1)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,K=map(int,readline().split())
A=list(map(lambda x: int(x)-1,readline().split()))

visited=[True]*N
visitednum=[]
now=0
for i in range(K):
    if not visited[now]:
        break
    else:
        visited[now]=False
        visitednum.append(now)
        now=A[now]
d=visitednum.index(now)
ans=(K-d)%(len(visitednum)-d)+d
print(visitednum[ans]+1)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
visit=[1]
pos=0
while True:
    visit.append(a[pos])
    if a[pos]-1 in visit:
        break
    pos=a[pos]-1
loop=[]
looppos=visit[-1]-1
while True:
    loop.append(a[looppos])
    looppos=a[looppos]-1
    if a[looppos] in loop:
        break
print(visit)
print(loop)
if len(visit)>k:
    print(visit[k])
else:
    t=(k%len(visit))
    print(loop[t])
Problem p02690 (python)

Fixed submission:
import math
x=int(input())
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if i**5-j**5==x:
            print(i,j,sep=" ")
            exit()

Buggy submission (verdict: Runtime Error):
import bisect
import os
 
X=int(input())
hist = []
for a in range(100000):
    hist.append(a ** 5)
    i = bisect.bisect_left(hist, a ** 5 - X)
    if hist[i] == a ** 5 - X:
        print(a, i)
        break
    i = bisect.bisect_left(hist, X - a ** 5)
    if hist[i] == X - a ** 5:
        print(a, -i)
        break
Problem p02789 (python)

Fixed submission:
x,y = map(int,input().split())
print("Yes") if x == y else print("No")

Buggy submission (verdict: Runtime Error):
def gcd(n,m):
  if n>m:
    return gcd(m,n);
  if n==0:
    return m;
  return gcd(m-n*(m//n),n)
 
def lcm(x, y):
    return (x * y) // gcd(x, y)
  
n=int(input())
a=list(map(int,input().split()))
s=1
for i in a:
  s=lcm(s,i)
ans=0
for i in a:
  ans+=s//i
  ans % 1000000007
print(ans)
Problem p02814 (python)

Fixed submission:
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
a = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (M + l // 2) // l

print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
g = a[0]
for i in a:
    g = g * i // fractions.gcd(g,i)
if g/2 > m:
    print(0)
else:
    print((m + g // 2) // g)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
a = set(a)
g = 1
for i in a:
    g *= i // gcd(g,i)
if g * 0.5 > m:
    print(0)
else:
    print(math.floor((m / (g/2) + 1) / 2))
Problem p02841 (python)

Fixed submission:
m1,d1 = map(int,input().split())
m2,d2= map(int,input().split())
print(1) if d2 == 1 else print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = 0
for i in range(1000):
    c = [i // 100, (i // 10) % 10, i % 10]
    digit = 0
    for j in s:
        if c[digit] == int(j):
            digit+=1
        if digit == 3:
            break
    if digit == 3:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = 0
for i in range(1000):
    c = [i // 100, (i // 10) % 10, i % 10]
    digit = 0
    for j in s:
        if c[digit] == int(j):
            digit+=1
        if digit == 3:
            break
    if digit == 3:
        ans += 1
print(ans)
Problem p02927 (python)

Fixed submission:
m,d = map(int,input().split(" "))
ans = 0
for i in range(2,m+1):
    for j in range(2,d+1):
        if((j//10) * (j%10) == i and j//10 != 1 and j%10 != 1):
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
lis_a = list(map(int, input().split()))
mod = 1000000007
ans = 0
temp = 0
for i in range(len(lis_a)-1):
    for j in range(len(lis_a)):
        if(lis_a[i] > lis_a[j]):
            temp += 1
ans = (k*(temp+temp*k)//2) % mod
    
print(ans)
Problem p03085 (python)

Fixed submission:
# coding: utf-8

x = input()

if x == 'A':
	print('T')
elif x == 'T':
	print('A')
elif x == 'G':
	print('C')
elif x == 'C':
	print('G')

Buggy submission (verdict: Runtime Error):
# coding: utf-8

x = input()

if x == 'A':
	print('T')
elif x == 'T'
	print('A')
elif x == 'G'
	print('C')
elif x == 'C'
	print('G')
Problem p02583 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k]:
                    ans += 1
print(ans)

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

count = 0
for x in itertools.combinations(A, 3):
  if(x[0] + x[1] > x[2] and x[1] + x[2] > x[0] and x[2] + x[0] >x[1]):
    if(x[0]!=x[1] and x[0]!=x[1] and x[2] != x[3]):
    	count +=1
print(count)
Problem p02612 (python)

Fixed submission:
n = int(input())
if n%1000 != 0:
    print(1000 - n%1000)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%10**3 != 0:
  return 1000 - n%10**3
else:
  return 0
Problem p02576 (python)

Fixed submission:
import math
N, X, T = map(int, input().split())

a = math.ceil(N / X)
b = T * a

print(b)

Buggy submission (verdict: Runtime Error):
import math
N, X, T = map(int,input().zsplit())

a = math.ceil(N / X)
b = T * a

print(b)
Problem p02927 (python)

Fixed submission:
# -*- coding: utf-8 -*-

M, D = map(int, input().split())
count = 0

for i in range(1, M+1):
    di = len(str(i))
    for j in range(1, D+1):
        d_10 = j // 10
        d_1 = j % 10
        if d_10 >= 2 and d_1 >= 2 and d_10 * d_1 == i:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

M, D = map(int, input().split())
count = 0

for i in range(1, M+1):
    for j in range(1, D+1):
        d_1 = int(str(j).zfill(len(str(M)))[-1])
        d_10 = int(str(j).zfill(len(str(M)))[-2])
        if d_10 > 1 and d_1 >1 and d_10 * d_1 == i:
            count += 1

print(count)
Problem p02582 (python)

Fixed submission:
def main():
    s = input()
    c = 0
    if s[0] == s[1] == s[2] == "R":
        print(3)
        return
    if s[0] == s[1] == "R" or s[1] == s[2] == "R":
        print(2)
        return
    if s[0] == s[1] == s[2] == "S":
        print(0)
        return

    print(1)
    return

main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    c = 0
    if s[0] == s[1] == s[2] == "R":
            print(3)
        return
    if s[0] == s[1] == "R" or s[1] == s[2] == "R":
        print(2)
        return
    if s[0] == s[1] == s[2] == "S":
        print(0)
        return

    print(1)
    return

main()
Problem p02657 (python)

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

print(a * b)

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

r = 1
for tt in t:
    r *= tt

rr = r - 10**18
if rr > 0:
    print(-1)
else:
    print(r)