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

Fixed submission:
# Python template 
from collections import defaultdict 
import sys
import math 

def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

sys.setrecursionlimit(10**6) 
g = defaultdict(set)
(n,m) = get_ints()
visited = [0]*n 


def dfs(i,l,par):
    global visited
    visited[i] = True
    l.append(i)
    for j in g[i]:
        if j!=par and not visited[j]:
            dfs(j,l,i)

for i in range(m):
    (u,v) = get_ints()
    g[u-1].add(v-1)
    g[v-1].add(u-1)

ans = 0
for i in range(n):
    if not visited[i]:
        l = []
        dfs(i,l,-1)
        ans = max(ans,len(l))
        
print(ans)

Buggy submission (verdict: Runtime Error):
# Python template 
from collections import defaultdict 
import sys
import math 

def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()


g = defaultdict(set)
(n,m) = get_ints()
visited = [0]*n 


def dfs(i,l,par):
    global visited
    visited[i] = True
    l.append(i)
    for j in g[i]:
        if j!=par and not visited[j]:
            dfs(j,l,i)

for i in range(m):
    (u,v) = get_ints()
    g[u-1].add(v-1)
    g[v-1].add(u-1)

ans = 0
for i in range(n):
    if not visited[i]:
        l = []
        dfs(i,l,-1)
        ans = max(ans,len(l))
        
print(ans)
Problem p03160 (python)

Fixed submission:
from collections import defaultdict 
import sys
import math 
import random
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

sys.setrecursionlimit(10**5)

def r(ind):
    if dp[ind]!=-1:
        return dp[ind]
    if ind+1>=n:
        return 0
    ans1 = abs(a[ind+1]-a[ind])+r(ind+1)
    if ind+2>=n:
        dp[ind] = ans1 
        return dp[ind] 
    ans2 = abs(a[ind+2]-a[ind])+r(ind+2)
    dp[ind] = min(ans1,ans2)
    return dp[ind]

n = int(input())
a = get_array()
dp = [-1]*(n+5) 
print(r(0))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict 
import sys
import math 
import random
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()


def r(ind):
    if dp[ind]!=-1:
        return dp[ind]
    if ind+1>=n:
        return 0
    ans1 = abs(a[ind+1]-a[ind])+r(ind+1)
    if ind+2>=n:
        dp[ind] = ans1 
        return dp[ind] 
    ans2 = abs(a[ind+2]-a[ind])+r(ind+2)
    dp[ind] = min(ans1,ans2)
    return dp[ind]

n = int(input())
a = get_array()
dp = [-1]*(n+5) 
print(r(0))
Problem p02681 (python)

Fixed submission:
import re

a=input()
b=input()

if len(b)-len(a)==1:
    if re.search("^"+a,b) is None:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re

a=input()
b=input()

if len(b)-len(a)==1:
    if re.search(a,b) is None:
        print("No")
    else:
        print("Yes")
else
    print("No")
Problem p04044 (python)

Fixed submission:
str = input().split()
v=""
sa=list()
for i in range(int(str[0])):
    sa.append(input()[:int(str[1])])
sa.sort()
for i in sa:
    v=v+i

print(v)

Buggy submission (verdict: Runtime Error):
str = input().split()
v=""
sa=list()
for i in range(int(str[1])):
    sa.append(input()[:int(str[0])])
sa.sort()
for i in sa:
    v=v+i

print(v)

Buggy submission (verdict: Runtime Error):
str = input().split()
v=""
sa=list()
for i in range(int(str[1])):
    sa.append(input()[:int(str[0])])
sa.sort()
for i in sa:
    v=v+i

print(v)

Buggy submission (verdict: Runtime Error):
str = input().split()
v=""
sa=list()
for i in range(int(str[1])):
   sa.append(input().strip())
sa.sort()
for i in sa:
    v=v+i

print(v)
Problem p02765 (python)

Fixed submission:
N,R = map(int, input().split())
 
if (N < 10):
    print(R + ((10 - N) * 100))
else:
    print(R)

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

if (N < 10):
    print(R + ((10 - N) * 100))
else:
    print(R)
Problem p02780 (python)

Fixed submission:
# sys.stdin.readline()
import sys
input = sys.stdin.readline
def main():
    n,k = map(int,input().split())
    l=list(map(int,input().split()))
    l2 = [(1+i)/2 for i in l]
    kitai=sum(l2[0:k])
    tmp = kitai
    for idx in range(n)[:n - k]:
        tmp -= l2[idx]
        tmp += l2[idx+k]
        if (kitai < tmp):
           kitai = tmp
    print(kitai)
main()

Buggy submission (verdict: Runtime Error):
# sys.stdin.readline()
import sys
input = sys.stdin.readline
def main():
    n,k = map(int,input().split())
    l=list(map(int,input().split()))
    l2 = [(1+i)/2 for i in l]
    kitai=sum(l2[0:k])
    tmp = kitai
    for idx in range(n)[:n - k + 1]:
        tmp -= l2[idx]
        tmp += l2[idx+k]
        if (kitai < tmp):
           kitai = tmp
    print(kitai)
main()
Problem p02885 (python)

Fixed submission:
a,b = (int(i) for i in input().split())
print(a-b*2 if a-b*2 >= 0 else 0)

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

print(a-b*2 if a-b*2 >= 0 else 0)
Problem p02899 (python)

Fixed submission:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))

# a = np.array(a)
# ans = []
# while a.min() != 9999999:
#     min_index = a.argmin()
#     ans.append(min_index+1)
#     a[min_index] = 9999999

# print(' '.join([str(_) for _ in ans]))

l = []
for i in range(n):
    l.append([i+1, a[i]])

sl = sorted(l, key=lambda x: x[1])
sl0 = [r[0] for r in sl]
print(' '.join([str(_) for _ in sl0]))

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

n = int(input())
a = list(map(int, input().split()))

# a = np.array(a)
# ans = []
# while a.min() != 9999999:
#     min_index = a.argmin()
#     ans.append(min_index+1)
#     a[min_index] = 9999999

# print(' '.join([str(_) for _ in ans]))

l = []
for i in range(n):
    l.append([i+1, a[i]])

sl = sorted(l, key=lambda x: x[1])
sl0 = [r[0] for r in sl]
print(' '.join([str(_) for _ in sl0]))

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

n = int(input())
a = list(map(int, input().split()))

a = np.array(a)
ans = []
while a.min() != 9999999:
    min_index = a.argmin()
    ans.append(min_index+1)
    a[min_index] = 9999999

print(' '.join([str(_) for _ in ans]))
Problem p02700 (python)

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


 
while a>0 or c>0:
    c = c - b
    
    if c<1:
        
        break
    
    a = a - d
    
    if a < 1:

        break
    
   

  


if a<0 or a==0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
 
while b<1 or d<1:
  a = a - d
   if a<1:
      break
  c = c - b
  	if c < 1:
      break
  
if a<0 or a==0:
  print("No")
else:
  print("Yes")
Problem p02555 (python)

Fixed submission:
import math

S=int(input())
z = 10**9+7
if S>= 7:
    ans = 1
    n = S//3
    b = S%3
    a = 3+b
    
    c = n-1
    for i in range(n-2):
        # s=math.factorial(a+c-1)/(math.factorial(a)*math.factorial(c-1))
        y = max([a,c-1])
        r = min([a,c-1])
        # print(y,r,a+c)
        s = 1
        for k in range(y+1,a+c):
            s*=k
        # print(s)
        s//=math.factorial(r)
        s%=z
        ans += s
        a +=3
        c-=1
        # print(s)
    if b==0:
        ans+= 1
    if b==1:
        ans += n
    if b == 2:
        ans += n*(n-1)//2 +n
elif S==6:
    ans = 2
elif 3<=S<6:
    ans =1
else:
    ans= 0
print(ans%z)

Buggy submission (verdict: Runtime Error):
import math

S=int(input())
if S>= 7:
    ans = 2
    n = S//3
    b = S%3
    a = 3+b
    z = 10**9+7
    c = n-1
    for i in range(n-2):
        # s=math.factorial(a+c-1)/(math.factorial(a)*math.factorial(c-1))
        y = max([a,c-1])
        r = min([a,c-1])
        # print(y,r,a+c)
        s = 1
        for k in range(y+1,a+c):
            s*=k
        # print(s)
        s//=math.factorial(r)
        s%=z
        ans += s
        a +=3
        c-=1
        # print(s)
    ans += n-1
elif S==6:
    ans = 2
elif 3<=S<6:
    ans =1
else:
    ans= 0
print(ans%z)
Problem p02687 (python)

Fixed submission:
S = input()

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

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

if S == ABC:
    print("ARC")
else:
    print("ABC")
Problem p02690 (python)

Fixed submission:
X = int(input())
a = 0
while True:
    a5 = a**5
    d  = X-a5
    if d >= 0:
        c  = d**0.2
        b1 = int(c)
        b2 = b1+1
        if a5 + b1**5 == X:
            print(a,-b1)
            break
        if a5 + b2**5 == X:
            print(a,-b2)
            break
    else:
        c = ((-d)**0.2)
        b1 = int(c)
        b2 = b1+1
        if a5 - b1**5 == X:
            print(a,b1)
            break
        if a5 - b2**5 == X:
            print(a,b2)
            break
    a += 1

Buggy submission (verdict: Runtime Error):
X = int(input())
a = 0
while True:
    c  = (X -a**5)**0.2
    b = int(c)
    if c - b < 0.01:
        print(a,-b)
        break
    a += 1
Problem p02691 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
d = [0]*(10**6)
ans = 0
for i in range(N):
    m = i+1+A[i]
    if m < 10**6:
        d[i+1+A[i]] += 1
    
for i in range(1,N+1):
    f = A[-i]+N+1-i-(2*A[-i])
    if f >= 0 and f < 10**6:
        ans += d[f]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
d = [0]*2*10*9
ans = 0
for i in range(N):
    d[i+1+A[i]] += 1
    
for i in range(1,N+1):
    f = A[-i]+N+1-i-(2*A[-i])
    if f >= 0:
        ans += d[f]
print(ans)
Problem p02742 (python)

Fixed submission:
inp = list(map(int,input().split()))
 
a = inp[0]*inp[1]

if (inp[0]==1 or inp[1]==1):
    print("1")
else:
    if (a %2 == 1):
        b = int(a/2)+1
        print('{:.19g}'.format(b))
    else:
        b = a/2
        print('{:.19g}'.format(b))

Buggy submission (verdict: Runtime Error):
inp = list(map(int,input().split()))
 
a = inp[0]*inp[1]

if (inp[0]==1 or inp[1]==1):
    print("1")
else:
    if (a %2 == 1):
        b = int(a/2)+1
    else:
        b = a/2
 
print(b)
Problem p02743 (python)

Fixed submission:
inp = list(map(int,input().split()))
a =inp[0]
b = inp[1]
c = inp[2]
if (c - a- b > 0):
    if (0< a**2 +b**2 + c**2- 2*(a*b + b*c + a*c)):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if (inp[0]<8000000000):
    if (inp[0]+inp[1]-inp[2] < -2 * (inp[0]*inp[1])**0.5):
        print("Yes")
    else:
        print("No")
else:
    if(inp[0]**2+inp[1]**2+inp[2]**2-2*(inp[0]*inp[1]+inp[1]*inp[2]+inp[0]*inp[1])<0):
        print("No")
    else:
        print("Yes")
Problem p02882 (python)

Fixed submission:
import math
Input = list(map(int,input().split()))
a = Input[0]
b = Input[1]
x = Input[2]

taiseki = a**2*b

if x<=taiseki/2:
    theta = 90-math.degrees(math.atan(2*x/(a*b**2)))
else:
    theta = math.degrees(math.atan(-2*(x-a**2*b)/a**3))
print(theta)

Buggy submission (verdict: Runtime Error):
import math
Input = list(map(int,input().split()))
a = Input[0]
b = Input[1]
x = Input[2]

taiseki = a**2*b

if x>taiseki/2:
    theta = -math.atan(x/(a**2*(b-a)))
else:
    theta = math.atan(x/(a**2*b))
print(theta)
Problem p02612 (python)

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

Buggy submission (verdict: Runtime Error):
lis = []
a = []
n = int(input())
a = input().split()
a_  = sorted(a,reverse=True)
a_ = list(a_)
for i in a_:
    if len(lis)==0:
        lis.append(int(i))
    elif len(lis)==1:
        lis.append(lis[0])
    else:
        lis_ = sorted(lis,reverse=True)
        lis.append(lis_[1])
lis_.append(lis[1])
print(sum(int(j) for j in lis_))
Problem p02677 (python)

Fixed submission:
import math

a,b,h,m = map(int,input().split())

def calc_ans(rad):
    x = a**2 + b**2 -2*a*b*math.cos(rad)
    ans = math.sqrt(x)
    return ans

l_w = 2*math.pi/(12*60)
s_w = 2*math.pi/60

long_rad = l_w * (h*60+m)
short_rad = s_w * m

if abs(long_rad-short_rad) >= math.pi:
    rad = 2*math.pi-abs(long_rad-short_rad)
else:
    rad = abs(long_rad-short_rad)

ans = calc_ans(rad)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

a,b,h,m = map(int,input().split())

def calc_ans(rad):
    x = a**2 + b**2 -2*a*b*math.cos(rad)
    ans = math.sqrt(x)
    return ans

l_w = 2*math.pi/(12*60)
s_w = 2*math.pi/60

long_rad = l_w * (h*60+m)
short_rad = s_w * m

if abs(long_rad-short_rad) >= math.pi:
    rad = 2*math.pi-abs(long_rad-short_rad)
else:
    rad = abs(long_rad-short_rad)

ans = calc_a
Problem p02747 (python)

Fixed submission:
import re

s = input()
 
result = re.fullmatch("(hi){1,5}",s)
 
if result == None:
    print("No")
else:
    print("Yes")

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

result = re.fullmatch("(hi){1,5}",s)

if result == None:
    print("No")
else:
    print("Yes")
Problem p02645 (python)

Fixed submission:
a=[]
a=input()
print('%s%s%s'%(a[0],a[1],a[2]))

Buggy submission (verdict: Runtime Error):
import copy
n,k=map(int,input().split())
a=list(map(int,input().split()))
maxed={}
for m in range(0,k):
    temp=[0]*n
    if len(maxed)==n:
        print(' '.join(map(str,a)))
        exit()
    for i in range(0,n):
        d=a[i]
        if d==n:
            temp[i]=n
            maxed[i]=1
        elif d !=0 :
            for x in range(i-d, i+d+1):
                if x >= 0 and x < n :
                    temp[x]+=1
        else:
            temp[i]+=1
    a=copy.copy(temp)

print(' '.join(map(str,a)))

Buggy submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if a<b and b-a <= (v-w)*t:
    print ("YES")
else:
    print("NO")
Problem p02675 (python)

Fixed submission:
N=input()
n=int(N[-1])
if n in [2,4,5,7,9]:
  print("hon")
elif n in [0,1,6,8]:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
from queue import Queue
s=input().split(' ')
N=int(s[0])
M=int(s[1])
room_from=[]
room_to=[]

for i in range(M):
  s=input().split(' ')

#道は両方向に使える
  room_from.append(int(s[0]))
  room_to.append(int(s[1]))
  room_from.append(int(s[1]))
  room_to.append(int(s[0]))

#for i in range(2*M):
#  print("from=",room_from[i],"to=",room_to[i])


#最小経路の回答を入れる. ansewr[room_from]=room_to


answer={}
todo={}
temp={}
todoq=Queue(N)

for (i,room) in enumerate(room_to): 
  if room_to[i] == 1:
    todo[room_from[i]]=1

answer.update(todo)

while True:
  for a in todo:
    for (i,room) in enumerate(room_to): 
      if room == a and room_from[i] not in temp and room_from[i] not in answer and room_from[i] != 1:
        temp[room_from[i]]=a
  if len(temp)==0:
    break
  else:
    todo.clear()
    todo.update(temp)
    answer.update(temp)
    temp.clear()
print(answer)
if len(answer)== N-1 :
  print ("Yes")
  for n in answer:
    print (answer[n])
else:
  print ("No")

Buggy submission (verdict: Runtime Error):
s=input().split(' ')
N=int(s[0])
M=int(s[1])
room_from=[]
room_to=[]

for i in range(M):
  s=input().split(' ')

#道は両方向に使える
  room_from.append(int(s[0]))
  room_to.append(int(s[1]))
  room_from.append(int(s[1]))
  room_to.append(int(s[0]))

#for i in range(2*M):
#  print("from=",room_from[i],"to=",room_to[i])


#最小経路の回答を入れる. ansewr[room_from]=room_to


answer={}
temp={}
for (i,room) in enumerate(room_to): 
  if room_to[i] == 1:
    answer[room_from[i]]=1

temp={}
for n in range(N):
  for a in answer:
    for (i,room) in enumerate(room_to): 
      if room == a and room_from[i] not in temp and room_from[i] not in answer and room_from[i] != 1:
        temp[room_from[i]]=a
  #        print("temp=",temp)
  answer.update(temp)
#  print ("answer=",answer)

if len(answer)== N-1 :
  print ("Yes")
  for n in answer:
    print (answer[n])
else:
  print ("No")
Problem p03457 (python)

Fixed submission:
N=int(input())
t=[]
x=[]
y=[]
#t.append(0)
#x.append(0)
#y.append(0)
t_cur=0
x_cur=0
y_cur=0

for i in range(N):
  plan=input().split(' ')
  t.append(int(plan[0]))
  x.append(int(plan[1]))
  y.append(int(plan[2]))

for i in range(N):
  t_gap=t[i]-t_cur
  x_gap=abs(x[i]-x_cur)
  y_gap=abs(y[i]-y_cur)

  dist=x_gap+y_gap

#  print("trip=",t[i],x[i],y[i])
#  print("t_gap=",t_gap)
#  print("dist=",dist)
  if (t_gap-dist)>=0 and (t_gap-dist)%2==0:
    t_cur=t[i]
    x_cur=x[i]
    y_cur=y[i]
  else:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
N=int(input())
t=[]
x=[]
y=[]
#t.append(0)
#x.append(0)
#y.append(0)
t_cur=0
x_cur=0
y_cur=0

for i in range(N):
  plan=input().split(' ')
  t.append(int(plan[0]))
  x.append(int(plan[1]))
  y.append(int(plan[2]))

for i in range(N):
  t_gap=t[i]-t_cur
  abs(x_gap)=x[i]-x_cur
  abs(y_gap)=y[i]-y_cur

  dist=x_gap+y_gap

#  print("trip=",t[i],x[i],y[i])
#  print("t_gap=",t_gap)
#  print("dist=",dist)
  if (t_gap-dist)>=0 and (t_gap-dist)%2==0:
    t_cur=t[i]
    x_cur=x[i]
    y_cur=y[i]
  else:
    print("No")
    exit()
print("Yes")
Problem p02642 (python)

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

cnt=[0]*(a[-1]+1)
#cntは0が25個続くリスト
for x in a:
  #xは3,8,11,16,24
 for i in range(x,a[-1]+1,x):
  #x = 3ならrange(3, 25, 3) = 3, 6, 9, 12, 15, 18, 21, 24
  
  cnt[i]+=1
  #xの倍数(xを含む)だったら1が足される
ans=0
for x in a:
 if cnt[x]==1:
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
line = list(map(int,input().split()))
line2 = []
line.sort()
#[3, 8, 11, 16, 24]
for ele in line:
  line2.append(ele)
x = 0


while len(line2) > 0:
  line3 = []
  for k in line:
    if line2[0] != k:
      amari = (line2[0])%k
      line3.append(amari)
      
    else:
      line3.append(0)
    
  line2.remove(line2[0])  
  line3.sort()
  if line3[1] != 0:
    x += 1
print(x)
Problem p03161 (python)

Fixed submission:
def ans():
    n, k, *h = map(int, open(0).read().split())
    dp = [float("inf")] * n
    dp[0] = 0
    for i in range(1, n):
        min_j = max(0, i-k)
        dp[i] = min([dp[j] + abs(h[i] - h[j]) for j in range(min_j , i)])
    print(dp[n-1])
 
ans()

Buggy submission (verdict: Runtime Error):
number = list(map(int,input().split()))
line = list(map(int,input().split()))

num = number[0]
K = number[1]
dp = [0, abs(line[1] - line[0])]
for i in range(2, num):
  line2 = []
  for k in range(1, K + 1):
    a = dp[-k] + abs(line[i] - line[i - k])
    line2.append(a)
  dp += [min(line2)]
print(dp[-1])
Problem p02784 (python)

Fixed submission:
h,n=map(int,input().split())
att=list(map(int,input().split()))
if sum(att)>=h:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
att=list(map()int,input().split())
if sum(att)>=h:
  print("Yes")
else:
  print("No")
Problem p02885 (python)

Fixed submission:
x,y = map(int,input().split())	
print(max(0,x-2*y))

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())	
print(max(0,x-2y))
Problem p02934 (python)

Fixed submission:
N=int(input())
aa=list(map(int,input().split()))
for i in range(N):
  aa[i]=1/aa[i]
Q=sum(aa)
print(1/Q)

Buggy submission (verdict: Runtime Error):
N=int(input())
aa=list(map(int,input().split()))
s=list[]
for i in range(N):
  s[i]=1/s[i]
  s.attend(s[i])
Q=sum(s)  
print(1/Q)
Problem p02957 (python)

Fixed submission:
x,y = map(int,input().split())
if x%2!=y%2:
  print('IMPOSSIBLE')
else:
  print(int((x+y)/2))

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x%2!==y%2:
  print('IMPOSSIbLE')
else: print((x+y)/2)
Problem p02988 (python)

Fixed submission:
#5
#1 3 5 4 2
#2
N=int(input())
li=list(map(int,input().split()))
cnt=0
for i in range(N-2):
  if li[i]<li[i+1]<li[i+2] or li[i+2]<li[i+1]<li[i]:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
#5
#1 3 5 4 2
#2
N=int(input())
num=list(map(int,input().split()))
cnt=0
for i in range(N-2):
  if li[i]<li[i+1]<li[i+2] or li[i+2]<li[i+1]<li[i]:
    cnt+=1
print(cnt)
Problem p03035 (python)

Fixed submission:
a,p= map(int,input().split())
if a>=13:
  print(p)
elif 6<=a<=12:
  print(int(p/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,p= map(int,input().split())
if a>=13:
  print(b)
elif 6<=a<=12:
  print(b/2)
else:
  print(0)
Problem p03085 (python)

Fixed submission:
b=input()
if b==("A"):
  print("T")
elif b==('T'):
  print("A")
elif b==('G'):
  print("C")
else:
  print('G')

Buggy submission (verdict: Runtime Error):
b=input()
if b==("A"):
  print("T")
if b==('T'):
  print("A")
if b==('G'):
  print("C"):
else:
  print('G')

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

Fixed submission:
a = input()
a = int(a)

if a == 7 or a == 5 or a == 3:
    print('YES')
else:
    print('NO')

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

if x==7:
  	print("Yes")
elif x==5:
  	print("Yes")
elif x==3:
  	print("Yes")
else:
  	print("No"
Problem p03424 (python)

Fixed submission:
N=int(input())
arare=list(input())
if 'Y' in arare:
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
N=int(input())
arare=list(input())
if Y in arare:
  print('Four')
else:
  print('Three')
Problem p03434 (python)

Fixed submission:
N=int(input())
li=list(map(int,input().split()))
lis=sorted(li,reverse=True)
lisalice=lis[0::2]
lisbob=lis[1::2]
print(sum(lisalice)-sum(lisbob))

Buggy submission (verdict: Runtime Error):
N=int(input())
li=list(map(int,input().split()))
lis=list.sort(reverse=True)
lisAlice=lis[0::2]
lisbob=lis[1::2]
print(sum(lislalice)-sum(lisbob))
Problem p03455 (python)

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

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

Fixed submission:
x=int(input())
n=10**5
import math
def eratosthenes(n):
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
q=eratosthenes(n)

ans=[0]*(10**5+1)
for i in range(10**5):
    ans[i+1]=ans[i]+(1 if i+1 in q and (i+1+1)//2 in q else 0 )
for i in range(x):
    l,r = map(int,input().split())	
    print(ans[r]-ans[l-1])

Buggy submission (verdict: Runtime Error):
import numpy
x=int(input())
n=10**5
import math
def eratosthenes(n):
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
q=eratosthenes(n)

ans1=[0]*(10**5+1)
for i in range(10**5+1):
    ans1[i]=(1 if i in q and (i+1)//2 in q else 0 )

ans=numpy.cumsum(ans1)
for i in range(x):
    l,r = map(int,input().split())	
    print(ans[r]-ans[l-1])
Problem p03494 (python)

Fixed submission:
N=int(input())
num=list(map(int,input().split()))
cnt=0
while all(num[i]%2==0 for i in range(N)):
  cnt+=1
  num=[i/2 for i in num]
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
num=list(map(int,input().split()))
cnt=0
while num[i]%2==0 for i in range(N):
  cnt+=1
  num[x]/2 for x in range(N):
print(N)
Problem p03730 (python)

Fixed submission:
a, b, c = map(int, input().split())
lp=list((a*i%b for i in range(1,b+1)))
if c in lp:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
lp=[a*i/b-c for i in range(10*10)]
if 0 in ;p:
  print('YES')
else:
  print('NO')
Problem p02576 (python)

Fixed submission:
N,X,T=map(int,input().split())
if N%X==0:
  print((N//X)*T)
else:
  print(((N//X)*T)+T)

Buggy submission (verdict: Runtime Error):
N,M,T=map(int,input().split())
print((N//X)*T+1)