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

Fixed submission:
import sys

N=int(input())
A=list(map(int,input().split()))
dict={}

for a in A:
  if a in dict.keys():
    dict[a] = dict[a] + 1
  else:
    dict[a] = 1

if len(list(dict.keys())) > 3:
  print('No')
  sys.exit()
elif len(list(dict.keys()))==1:
  keys=list(dict.keys())
  if keys[0]==0:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
elif len(list(dict.keys()))==2:
  keys=list(dict.keys())
  a0=keys[0]
  a1=keys[1]
  a2=''
  b0=bin(a0)[2:]
  b1=bin(a1)[2:]
  if len(b0)<len(b1):
    b0,b1=b1,b0
  b1=b1.zfill(len(b0))
  for s0,s1 in zip(b0,b1):
    a2 = a2 + str( int(s0)^int(s1) )
  a2=int(a2,2)
  #print(a0,a1,a2)
  if a2==a0 or a2==a1:
    vals=list(dict.values())
    if vals[0]/2==vals[1] or vals[0]==vals[1]/2:
      print('Yes')
      sys.exit()
    else:
      print('No')
      sys.exit()
  
keys=list(dict.keys())
vals=set(dict.values())

if len(vals)> 1:
  print('No')
  sys.exit()
  
a0=keys[0]
a1=keys[1]
a2=''
b0=bin(a0)[2:]
b1=bin(a1)[2:]
if len(b0)<len(b1):
  b0,b1=b1,b0
b1=b1.zfill(len(b0))
for s0,s1 in zip(b0,b1):
  a2 = a2 + str( int(s0)^int(s1) )
a2=int(a2,2)

if a2!=keys[2]:
  print('No')
  sys.exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
import sys

N=int(input())
A=list(map(int,input().split()))
dict={}

for a in A:
  if a in dict.keys():
    dict[a] = dict[a] + 1
  else:
    dict[a] = 1

if len(list(dict.keys())) > 3:
  print('No')
  sys.exit()

keys=list(dict.keys())
vals=set(dict.values())

if len(vals)> 1:
  print('No')
  sys.exit()
  
a0=keys[0]
a1=keys[1]
a2=''
b0=bin(a0)[2:]
b1=bin(a1)[2:]
if len(b0)<len(b1):
  b0,b1=b1,b0
b1=b1.zfill(len(b0))
for s0,s1 in zip(b0,b1):
  a2 = a2 + str( int(s0)^int(s1) )
a2=int(a2,2)

if a2!=keys[2]:
  print('No')
  sys.exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
import sys

def checker(a0,a1,tmp):
  a2=''
  b0=bin(a0)[2:]
  b1=bin(a1)[2:]
  if len(b0)<len(b1):
    b0,b1=b1,b0
  b1=b1.zfill(len(b0))
  for s0,s1 in zip(b0,b1):
    a2 = a2 + str( int(s0)^int(s1) )
  a2=int(a2,2)
  #print(a0,a1,a2)
  if a2 not in tmp:
    return 1
  else:
    tmp.remove(a2)
    if  len(tmp)==0:
      return 0
    checker(a1,a2,tmp)

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

bia=1
for i in range(N-1):
  tmp=A.copy()
  tmp.remove(A[i])
  for j in range(N-bia):
    tmp.remove(A[j+bia])
    if checker(A[i],A[j+bia],tmp) == 1:
      break
    else:
      print('Yes')
      sys.exit()
  bia+=1
print('No')
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**5)
#print(sys.getrecursionlimit())
n,m=map(int,input().split())
dp=[-1]*n
E=[ [] for i in range(n) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(2000)
#print(sys.getrecursionlimit())
n,m=map(int,input().split())
dp=[-1]*n
E=[ [] for i in range(n) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100)
#print(sys.getrecursionlimit())
n,m=map(int,input().split())
dp=[-1]*n
E=[ [] for i in range(n) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
dp=[-1]*n
E=[ [] for i in range(n) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
dp=[-1]*100100
E=[ [] for i in range(100100) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
dp=[-1]*(n+1)
E=[ [] for i in range(n+1) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
dp=[-1]*n
E=[ [] for i in range(n) ]

for i in range(m):
  x,y=map(int,input().split())
  x-=1
  y-=1
  E[x].append(y)

def rec(v):
  if dp[v]!=-1:return dp[v]
  res=0
  for nv in E[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)
Problem p03438 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
res=0
for i in range(len(a)):
  tmp=a[i]-b[i]
  if tmp<0:
    tmp+=tmp%2
    tmp=tmp/2
  res+=tmp
if res>0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
res=0
for i in range(len(a)):
  res+=a-b
if res<=0:
  print('Yes')
else:
  print('No')
Problem p03720 (python)

Fixed submission:
N,M=input().split(' ')
dict={}
for i in range(int(N)):
  dict[i+1]=0
for i in range(int(M)):
  a,b=input().split(' ')
  a=int(a)
  b=int(b)
  dict[a]+=1
  dict[b]+=1
for i in range(int(N)):
  print(dict[i+1])

Buggy submission (verdict: Runtime Error):
N,M=input().split(' ')
dict={}
for i in range(int(M)):
  a,b=input().split(' ')
  a=int(a)
  b=int(b)
  if a not in dict:
    dict[a]=0
  dict[a]+=1
  if b not in dict:
    dict[b]=0
  dict[b]+=1
for i in range(int(N)):
  print(dict[i+1])
Problem p02641 (python)

Fixed submission:
a=input().split(' ')
X=int(a[0])
N=int(a[1])

if N!=0:
  Ls=input().split(' ')
  L=[]
  for i in range(N):
    L.append(int(Ls[i]))
  for i in range (N+1):
    if X-i in L and X+i in L:
      pass
    elif X-i not in L:
      s=X-i
      break
    elif X-i in L and X+i not in L:
      s=X+i
      break
else:
  s=X


print(s)

Buggy submission (verdict: Runtime Error):
a=input().split(' ')
X=int(a[0])
N=int(a[1])

if N!=0:
  Ls=input().split(' ')
  L=[]
  for i in range(N):
    L.append(int(Ls[i]))
  for i in range (N):
    if X-i in L and X+i in L:
      pass
    elif X-i not in L:
      s=X-i
      break
    elif X-i in L and X+i not in L:
      s=X+i
      break
else:
  s=X


print(s)

Buggy submission (verdict: Runtime Error):
a=input().split(' ')
X=int(a[0])
N=int(a[1])

if N!=0:
  Ls=input().split(' ')
  L=[]
  for i in range(N):
    L.append(int(Ls[i]))
else:
  s=X

for i in range (N):
  if X-i in L and X+i in L:
    pass
  elif X-i not in L:
    s=X-i
    break
  elif X-i in L and X+i not in L:
    s=X+i
    break
print(s)

Buggy submission (verdict: Runtime Error):
a=input().split(' ')
X=int(a[0])
N=int(a[1])

if N!=0:
  Ls=input().split(' ')
  L=[]
  for i in range(N):
    L.append(int(Ls[i]))
else:
  s=X

for i in range (N):
  if X-i in L and X+i in L:
    pass
  elif X-i not in L:
    s=X-i
    break
  elif X-i in L and X+i not in L:
    s=X+i
    break
print(s)

Buggy submission (verdict: Runtime Error):
a=input().split(' ')
X=int(a[0])
N=int(a[1])

if N!=0:
  Ls=input().split(' ')
  L=[]
  for i in range(N):
    L.append(int(Ls[i]))
else:
  s=X

for i in range (N):
  if X-i in L and X+i in L:
    pass
  elif X-i not in L:
    s=X-i
    break
  elif X-i in L and X+i not in L:
    s=X+i
    break
print(s)
Problem p03944 (python)

Fixed submission:
W,H,N=map(int,input().split())
a,b,c,d=0,W,0,H

for i in range(N):
  x,y,A=map(int,input().split())
  if A==1:
    a=max(a,x)
  if A==2:
    b=min(b,x)
  if A==3:
    c=max(c,y)
  if A==4:
    d=min(d,y)
  
print(max(0,b-a)*max(0,d-c))

Buggy submission (verdict: Runtime Error):
W,H,N=map(int.input().split())
a,b,c,d=0,W,0,H

for i in range(N):
  x,y,A=map(int.input().split())
  if A==1:
    a=max(a,x)
  if A==2:
    b=min(b,x)
  if A==3:
    c=max(c,y)
  if A==4:
    d=min(d,y)
  
print(max(0,b-a)*max(0,d-c))

Buggy submission (verdict: Runtime Error):
W,H,N=map(int.input().split())
a,b,c,d=0,W,0,H

for i in range(N):
  x,y,A=map(int.input().split())
  if A==1: a=max(a,x)
  if A==2: b=min(b,x)
  if A==3: c=max(c,y)
  if A==4: d=min(d,y)
  
print(max(0,b-a)*max(0,d-c))
Problem p03998 (python)

Fixed submission:
A=input()
B=input()
C=input()

l='a'

for i in range(300):
  if l=='a':
    if len(A)==0:
      print('A')
      exit()
    elif len(A)==1:
      l=A[0]
      A=''
    else:
      l=A[0]
      A=A[1:]
  elif l=='b':
    if len(B)==0:
      print('B')
      exit()
    elif len(B)==1:
      l=B[0]
      B=''
    else:
      l=B[0]
      B=B[1:]
  else:
    if len(C)==0:
      print('C')
      exit()
    elif len(C)==1:
      l=C[0]
      C=''
    else:
      l=C[0]
      C=C[1:]

Buggy submission (verdict: Runtime Error):
A=input()
B=input()
C=input()

l='a'

for i in range(300):
  if l=='a':
    
    if len(A)==0:
      print('A')
      exit()
    elif len(A)==1:
      l=A[0]
      A=''
    else:
      l=A[0]
      A=A[1:]
  elif l=='b':
    l=B[0]
    if len(B)==0:
      print('B')
      exit()
    elif len(B)==1:
      l=B[0]
      B=''
    else:
      l=B[0]
      B=B[1:]
  else:
    l=C[0]
    if len(C)==0:
      print('C')
      exit()
    elif len(C)==1:
      l=C[0]
      C=''
    else:
      l=C[0]
      C=C[1:]
Problem p02657 (python)

Fixed submission:
A, B = map(int, input().split())
print(A*B)

Buggy submission (verdict: Runtime Error):
A, B = int(input().split())
print(A*B)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
length = len(S)
T2 = T[0:length]

if S == T2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
import heapq

def end(flag):
    if flag:
        print('Yes')
    else:
        print('No')
    exit(0) #プログラムを終了

n = int(input())
plus = []
minus = []
zero = []
total = 0
for i in range(n):
    s = input()[:-1] #入力の右端の値を除去
    cnt = 0
    M = 0
    m = 0
    for t in s:
        if t == ')': #前から探索
            cnt += 1
            M = max(M,cnt) #'('が多い場合はcnt=0,')'が多い場合はcntは'('と')'の個数の差
        else:
            cnt -= 1
    cnt = 0
    for t in s[::-1]: #後ろから探索
        if t == ')':
            cnt += 1
        else:
            cnt -= 1
            m = min(m,cnt) #')'が多い場合はcnt=0,'('が多い場合はcntは'('と')'の個数の差
    if cnt > 0:
        minus.append((-m,cnt))
    elif cnt == 0:
        zero.append((-m,M))
    else:
        plus.append((M,-cnt))
    S = (M,-cnt)
    total += cnt
if total != 0:
    end(0)
plus.sort()
minus.sort()
cnt = 0
for need,increase in plus:
    if cnt < need:
        end(0)
    else:
        cnt += increase
cnt = 0
for need,increase in minus:
    if cnt < need:
        end(0)
    else:
        cnt += increase
for m,M in zero:
    if m > cnt or M > cnt:
        end(0)
end(1)
Problem p02646 (python)

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if (V > W):
    if (-(V-W)*T <= A - B <= (V-W)*T):
        print("YES")
    else:
        print("NO")

else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
s = (A - B) / (V - W)
if (V > W):
  if (s <= T and s >= -T):
    print("YES") 
else:
  print("NO")
Problem p02936 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
    
# 遅延評価で加えてあげるだけ
    
N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
    
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
    
value = [0] * (N+1)
for p,x in PX:
    value[p] += x
    
def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])
    
dfs(1,0,0)
    
answer = ' '.join(map(str,value[1:]))
print(answer)

Buggy submission (verdict: Runtime Error):
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10 ** 7)
     
    # 遅延評価で加えてあげるだけ
     
    N,Q = map(int,input().split())
    AB = [[int(x) for x in input().split()] for _ in range(N-1)]
    PX = [[int(x) for x in input().split()] for _ in range(Q)]
     
    graph = [[] for _ in range(N+1)]
    for a,b in AB:
        graph[a].append(b)
        graph[b].append(a)
     
    value = [0] * (N+1)
    for p,x in PX:
        value[p] += x
     
    def dfs(v,parent,add):
        value[v] += add
        for x in graph[v]:
            if x == parent:
                continue
            dfs(x,v,value[v])
     
    dfs(1,0,0)
     
    answer = ' '.join(map(str,value[1:]))
    print(answer)
Problem p02640 (python)

Fixed submission:
X, Y = map(int,input().split())

crain = (4 * X - Y) / 2
turtle = (Y - 2 * X) / 2

if (crain.is_integer() and crain >= 0) and ( turtle.is_integer() and turtle >= 0):
    print ("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
X, Y = map(int,input().split())

crain = (4 * X - Y) / 2
turtle = (Y - 2 * X) / 2

if (crain.is_integer() and crain >= 0) and ( turtle.is_integer() and turtle >= 0):n*2))
    print ("Yes")
else:
    print ("No")
Problem p02645 (python)

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

Buggy submission (verdict: Runtime Error):
import random

i=input()
a=random.sample(i, 3)
print(a*)
Problem p02646 (python)

Fixed submission:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
 
if a < b:
    if v <= w:
        print('NO')
    else:
        if b - a <= t * (v - w):
            print('YES')
        else:
            print('NO')
elif a > b:
    if v <= w:
        print('NO')
    else:
        if a - b <= t * (v - w):
            print('YES')
        else:
            print('NO')

Buggy submission (verdict: Runtime Error):
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if A < B:
  if V <= W:
    print("NO")
  else:
    if b-a <= T * (V-W):
      print("YES")
    else:
      print("NO")
elif A > B:
  if V <= W:
    print("NO")
  else:
    if a - b <= t * (v - w):
      print('YES')
    else:
      print('NO')
Problem p02658 (python)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Buggy submission (verdict: Runtime Error):
import functools
import operator

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

result = functools.reduce(operator.mul, A)

if result > 10^18:
  print("-1")
else:
  print(ANS)
Problem p02669 (python)

Fixed submission:
T = int(input())
for i in range(T):
    n, A, B, C, D = map(int, input().split())
    memo = {}
 
    def herasu(N):
        if N == 0:
            return 0
        if N == 1:
            return D
        if N in memo:
            return memo[N]
        m = 100000000000000000000000
        if N % 2 == 0:
            m = min([m, A + herasu(N//2)])
        else:
            m = min([m, A + herasu(N//2) + D])
            m = min([m, A + herasu(N//2 + 1) + D])
        if N % 3 == 0:
            m = min(m, B + herasu(N//3))
        else:
            m = min([m, B + herasu(N//3) + (N%3) * D])
            m = min([m, B + herasu(N//3 + 1) + (3-(N%3)) * D])
        if N % 5 == 0:
            m = min(m, C + herasu(N // 5))
        else:
            m = min([m, C + herasu(N//5) + (N%5) * D])
            m = min([m, C + herasu(N//5 + 1) + (5-(N%5)) * D])
        m = min([m, D * N])
        memo[N] = m
        return m
 
    print(herasu(n))

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

for i in range(T):
  x=0
  N = map(int,input().split())
  x += N[3]
  min = min(N)
if N[0] == 2:
	print(x + N[1])  
elif N[0] == 3:
      print(x + N[2])
elif N[0] == 5:
      print(x + N[3])
elif N[0] % min == 0:
      print(x + (min * ( N[0] / min)))
elif N[0] % min == 1:
      print(x + (min * ( N[0] / min) + N[3]))
Problem p02681 (python)

Fixed submission:
import sys

S=input()
T=input()

for i in range(len(S)):
    if S[i]==T[i]:
        continue
    else:
        print("No")
        sys.exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
sys.stdin=f

S=input()
T=input()

for i in range(len(S)):
    if S[i]==T[i]:
        continue
    else:
        print("No")
        sys.exit()

print("Yes")
Problem p02690 (python)

Fixed submission:
import sys
X=int(input())
for j in range(-118,120):
    for i in range(-118,120):
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            sys.exit()

Buggy submission (verdict: Runtime Error):
X=int(input())
for j in range(100):
    for i in range(100):
        if abs(pow(i,5)-X) == pow(j,5):
            if pow(i,5)-pow(j,5)==X:
                print(i,j)
                sys.exit()
            else:
                print(i,-j)
                sys.exit()
Problem p02784 (python)

Fixed submission:
H,N = list(map(int,input().split()))
A = list(map(int,input().split()))
s = A[0]
for i in range(1,len(A)):
    s += A[i]
if s>=H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H,N = list(map(int,input().split))
A = list(map(int,input().split))
s = A[0]
for i in range(1,len(A)):
    s += A[i]
if s>=H:
    print("Yes")
else:
    print("No")
Problem p02909 (python)

Fixed submission:
today = input()
if today == 'Sunny':
  tomorrow = 'Cloudy'
elif today == 'Cloudy':
  tomorrow = 'Rainy'
else:
  tomorrow = 'Sunny'
print(tomorrow)

Buggy submission (verdict: Runtime Error):
today = input()
if today == Sunny:
  tomorrow = Cloudy
elif today == Cloudy:
  tomorrow = Rainy
else:
  tomorrow = Sunny
print(tomorrow)
Problem p03471 (python)

Fixed submission:
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n+1):
  for j in range(n+1):
      if 10000*i + 5000*j + 1000*(n-i-j) == y and i+j <= n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Buggy submission (verdict: Runtime Error):
n, y =  map(int, input().split())
 
res_a, res_b, res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*(n-i-j) == y:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Buggy submission (verdict: Runtime Error):
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*k == y and i+j+k == n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

Buggy submission (verdict: Runtime Error):
ソースコード 

Copy
Copy
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*k == y and i+j+k == n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)
Problem p03854 (python)

Fixed submission:
s = input()
s = s[::-1]
t_list = ['dream','dreamer','erase','eraser']
t_list = [t[::-1] for t in t_list]
 
ans = 'NO'
i = 0
while i < len(s):  
  p = i
  for t in t_list:        
    if s[i:i+len(t)] == t:      
      i += len(t)
      if i == len(s):
        ans ='YES'
      break
  if p==i or ans=='YES':
    break
 
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
s = s[::-1]
t_list = ['dream', 'dreamer', 'erase', 'eraser']
t_list = [i[::-1] for i in t_list]
i = 0

while i < len(s):
    can = False
    for j in range(4):
        if s[i:i+len(t_list[j])] == t_list[j]:
            i+=len(t_list[j])
            can = True
    if can == False: # うまくいっても最後には`can=False`になる
        break

if can == True
    print('YES')
else:
    print('NO')
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
multi = list(map(int,input().split()))
result = 1 

for i in range(n):
    result = result * multi[i]
    if (result > 10**18):
        ans = -1
        exit()
        
print(result)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()

if(s == t[:-1]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input().trim()
t = input().trim()

if s in t and s < t and len(s) <= 10:
    print("Yes")
else:
    print("No")

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

if s in t and len(s) = len(t) +1:
    print("Yes")
else:
    print("No")

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

if s in t and t = s + 1:
    print("Yes")
else:
    print("No")
Problem p03844 (python)

Fixed submission:
a, op, b = input().split()
if(op == "+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a, op, b = input().split()
if(op == "+"):
    print(int(a)+int(b))
else:
    print(int(a)-int(b))
Problem p02675 (python)

Fixed submission:
#a,b,c=map(int,input().split())
a=input()
b=int(a[-1])

if b==0 or b==1 or b==6 or b==8:
    print("pon")

elif b==3:
    print("bon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
a=input()
b=int(a[-1])

if b=0or b=1 or b=6 or b=8:
    print("pon")

elif b=3:
    print("bon")
else:
    print("hon")
Problem p02687 (python)

Fixed submission:
a=input()
if a=="ARC":
  print("ABC")
 
if a=="ABC":
  print("ARC")

Buggy submission (verdict: Runtime Error):
a=input()
if a~="ARC":
  print("ABC")
 
if a~="ABC":
  print("ARC")
Problem p02705 (python)

Fixed submission:
import math

b=int(input())

print(math.pi*b*2)

Buggy submission (verdict: Runtime Error):
mport math

b=int(input())

print(math.pi*b*2)
Problem p02714 (python)

Fixed submission:
a=int(input())
b=str(input())
sum=0

riron_sum=b.count('R')*b.count('G')*b.count('B')

for i in range(0,a):
    for n in range(0,a+1):
        j = i+n
        k = j+n
        #print(j)
        #print(k)
        if k>=a:
        	break

        if b[i]!=b[j] and b[j]!=b[k] and b[k]!=b[i]:
                riron_sum-=1

print(riron_sum)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=str(input())
sum=0

riron_sum=b.count('R')*sum=b.count('G')*sum=b.count('B')
for i in range(1,a):
    for n in range(1,i):
        if i+n>N:
            j = i+d
            k = j+d
            if b[i]!=b[j] and b[j]!=b[k] and b[k]!=b[i]:
                riron_sum-=1

print(riron_sum)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=str(input())
sum=0

riron_sum=b.count('R')*sum=b.count('G')*sum=b.count('B')
for i in range(1,a):
    for n in range(1,i):
        if i+n>N:
            j = i+d
            k = j+d
            if b[i]!=b[j] and b[j]!=b[k] and b[k]!=b[i]:
                riron_sum-=1

print(riron_sum)
Problem p02743 (python)

Fixed submission:
import math
x,y,z=map(int,input().split(" "))

if (z-y-x)**2>4*x*y and z>y and z>x:
	print("Yes")
else:
 
	print("No")

Buggy submission (verdict: Runtime Error):
import math
x,y,z=map(int,input().split(" "))
if (x-y-z)**2-4xy>0:
	print("Yes")
else:
 
	print("No")

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split(" "))
if z**2-y**2-x**2>2x*y:
	print("Yes")
else:
 
	print("No")

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split(" "))
if z-y-x>2(pow(x, 0.5)+pow(y, 0.5)):
	print("Yes")
else:
 
	print("No")

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split(" "))
if z-y-y>2(pow(x, 0.5)+pow(y, 0.5)):
	print("Yes")
else:
 
	print("No")

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input(" "))
if pow(z, 0.5)>pow(x, 0.5)+pow(y, 0.5):
	print("Yes")
else:

	print("No")