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

Fixed submission:
n =  int(input())
a =list(map(int,input().split()))
rev_a=[]
b=0
       

for i in a:
    j = 1 / i
    rev_a.append(j)
b=0
for k in rev_a:
    b += k

print(1/b)

Buggy submission (verdict: Runtime Error):
n =  int(input())
a =[int(input) for _ in range(n)]
b = 0
rev_a =[]

for i in a:
    j = 1 / i
    rev_a.append(j)

for k in rev_a:
    b += k

print(1/b)

Buggy submission (verdict: Runtime Error):
n =  int(input())
a =[int(input) for _ in range(n)]
rev_a =[]

for i in a:
    j = 1 / i
    rev_a.append(j)
    
print(1/ sum(rev_a))
Problem p02952 (python)

Fixed submission:
N = int(input())
count = 0

for i in range(1,N+1):
  if len(str(i))%2 == 1:
    count+=1
print(count)

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

for i in range(1,N+1):
  if len(i)%2 == 1:
    count+=1
print(count)
Problem p02957 (python)

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

print( (A+B)//2 if (A+B)%2 ==0 else 'IMPOSSIBLE')

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

print((A+B)//2 if (A+B)% ==0 else 'IMPOSSIBLE')

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

print( (A+B)//2 if (A+B)% ==0 else 'IMPOSSIBLE')

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

print( (A+B)/2 if type((A+B)/2) =int else 'IMPOSSIBLE')
Problem p03035 (python)

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

Buggy submission (verdict: Runtime Error):
print(B if A >=13 else B//2 if 6 <= A <= 12 else 0)
Problem p03037 (python)

Fixed submission:
N,M =map(int, input().split())
L,R =[],[]
 
for i in range(M):
  x,y = map(int,input().split())
  L.append(x)
  R.append(y)
 
print(max(0,min(R)-max(L)+1))

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

for i in range(M+1):
  x,y = map(int,input().split())
  L.append(x)
  R.append(y)

print(max(0,min(R)-max(L)+1))

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

for i in range(M+1):
  x,y = map(int,input().split())
  L.append(x)
  R.append(y)

print(max(0,min(R)-max(L))
Problem p03059 (python)

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

print((T//A)*B)

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

print((T//A)*B)
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split())
a = []
b = []

for i in range(1,A+1):
  if A%i==0:
    a.append(i)
for j in range(1,B+1):
  if B%j==0:
    b.append(j)

abset = list(sorted(set(a)&set(b)))[::-1]

print(abset[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
a = []
b = []

for i in range(1,A+1):
  if A%i==0:
    a.append(i)
for j in range(1,B+1):
  if B%j==0:
    b.append(j)

abset = list(set(a)&set(b))

print(abset[K+1])
Problem p03219 (python)

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

print(X + Y//2)

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

print( X + Y/2)
Problem p03238 (python)

Fixed submission:
if int(input()) ==1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
if input() ==1:
  'Hello World'
else:
  A = int(input())
  B = int(input())
  print(A+B)
Problem p03260 (python)

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

print('No' if A*B % 2 == 0 else 'Yes')

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

print('Yes' if A*B % 2 ==0 else 'No')
Problem p03264 (python)

Fixed submission:
N = int(input())

if N %2 == 0:
  print((N//2)**2)
else:
  print( ((N+1)//2) * ((N-1)//2) )

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

if N% == 0:
  print((N//2)**2)
else:
  print(((N+1)//2)*((N-1)//2))
Problem p03288 (python)

Fixed submission:
R = int(input())

print('ABC' if R <1200 else 'ARC' if R < 2800 else 'AGC')

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

print('ABC' if R <1200 else 'ARC' if N < 2800 else 'AGC')
Problem p03308 (python)

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

print(a[-1] - a[0])

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

print(a[-1] - a[0])
Problem p03377 (python)

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

print('YES' if A <= X and A+B >= X else 'NO')

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

print('YES' if A =< X and A+B >= X else 'NO')
Problem p03455 (python)

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

print('Even' if a*b %2 == 0 else 'Odd')

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

print('Even' if a*b % == 0 else 'Odd')
Problem p03469 (python)

Fixed submission:
S = input()
print("2018"+S[4:])

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

print( 2018 + S[:4])
Problem p03471 (python)

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

for i in range(n+1):
    for j in range(n-i+1):
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            print(i, j, n-i-j)
            exit()
print(-1,-1,-1)

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

or i in range(n+1):
    for j in range(n-i+1):
        print(i,j,n-i-j)
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            print(i, j, n-i-j)
            exit()
        print(-1,-1,-1)
Problem p03473 (python)

Fixed submission:
print( 48 - int(input()) )

Buggy submission (verdict: Runtime Error):
print(48 -int(input())
Problem p03477 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
print("Left" if A+B > C+D else "Balanced" if A+B == C+D else "Right")

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

print('Left' if A+B > C+D  'Balanced' elif A+B == C+D else 'Right')

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

print('Left' if A+B > C+D else 'Balanced' A+B == C+D else 'Right')
Problem p03485 (python)

Fixed submission:
import math

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

x = math.ceil((a+b)/2)

print(x)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())
print(math.cail((a+B)/2))

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

print(math.ceil((a+b)/2))
Problem p03494 (python)

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

count = 0

while all(a % 2 == 0 for a in A):
  A =[a/2 for a in A]
  count += 1
print(count)

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

count = 0

while all(a % == 0 for a in A):
  A =[a/2 for a in A]
  count += 1
print(count)
Problem p03502 (python)

Fixed submission:
N = input()
print("No" if int(N) % sum(map(int, N)) else "Yes")

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

print('Yes' if sum(map(N)) % N == 0 else 'No')

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

print('Yes' if sum(map(int,N)) % N == 0 else 'No')
Problem p03543 (python)

Fixed submission:
a,b,c,d = input()

print('Yes' if a == b == c or b == c == d else 'No')

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

print('Yes' if a == b == c or b == c == d else 'No')

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

print('Yes' if a = b = c or b = c = d else 'No')
Problem p03636 (python)

Fixed submission:
s = input()

print(s[0] + str(len(s)-2) + s[-1])

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

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

Fixed submission:
N = int(input())

print('ABC'+ str(N))

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

print('ABC'+ N)

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

print('ABC'+ N, end='')
Problem p03671 (python)

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

print(a+b)

Buggy submission (verdict: Runtime Error):
a,b,c = sorted(map(int.input().split()))

print(a+b)
Problem p03962 (python)

Fixed submission:
abc = list(input().split())

print(len(set(abc)))

Buggy submission (verdict: Runtime Error):
abc = lits(input().split())

print(len(set(abc)))
Problem p02618 (python)

Fixed submission:
d=int(input())
c=list(map(int, input().split()))
s=[list(map(int, input().split())) for _ in range(d)]
t=[0]*26
ans=0
for i in range(1,d+1):
  tmp=s[i-1].index(max(s[i-1]))
  print(tmp+1)

Buggy submission (verdict: Runtime Error):
for i in range(d):
  print(i%26+1)
Problem p02621 (python)

Fixed submission:
a=int(input())
print(a+a*a+a*a*a)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
ans=0
a, b=[0], [0]
for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
for i in range(n+1):
    if k<a[i]:
        break
    j=m
    while b[j]>k-a[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,m,k=map(int,input().split())
A=[0]
A.append(list(map(int, input().split())))
B=[0]
B.append(list(map(int, input().split())))
ans=0
a=np.cumsum(np.array(A))
b=np.cumsum(np.array(B))
for i in range(n+1):
    if k<a[i]:
        break
    j=m
    while b[j]>k-a[i]:
        j-=1
        ans=max(ans,i+j)
print(ans)
Problem p02681 (python)

Fixed submission:
s=str(input())
t=str(input())
if s==t[:len(s)]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
chokudai
chokudaiz
Problem p02690 (python)

Fixed submission:
def main():
  x=int(input())
  for a in range(-250,251):
    for b in range(-250,251):
        if pow(a,5)-pow(b,5)==x:
            print(a,b)
            exit()
main()

Buggy submission (verdict: Runtime Error):
def main():
x=int(input())
for a in range(-250,251):
  for b in range(-250,251):
      if pow(a,5)-pow(b,5)==x:
          print(a,b)
          exit()
main()
Problem p02705 (python)

Fixed submission:
n=int(input())
print(2*n*3.14159235359)

Buggy submission (verdict: Runtime Error):
  n=int(input())
  print(n*3.1415923535897932)
Problem p02706 (python)

Fixed submission:
import sys
input = sys.stdin.readline
def main():
  n,m=map(int,input().split())
  a=list(map(int,input().split())) #横一列リスト
  ans=0
  for i in range(m):
    ans+=a[i]
  if ans<=n:
      print(n-ans)
  else:
      print('-1')
main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
def main():
  n=int(input())
  n,m=map(int,input().split())
  a=list(map(int,input().split())) #横一列リスト
  ans=0
  for i in range(m):
    ans+=a[i]
  if ans<=n:
      print(n-ans)
  else:
      print('-1')
main()

Buggy submission (verdict: Runtime Error):
n=int(input())
n,k=map(int,input().split())
a=list(map(int,input().split())) #横一列リスト
ans=0
for i in range(n):
    ans+=a[i]
if ans<=n:
    print(n-ans)
else:
    print('-1')
Problem p02741 (python)

Fixed submission:
K =int(input())
A =[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]
print(A[K-1])

Buggy submission (verdict: Runtime Error):
H,W =map(int,input().split())
if H==1 or W==1:
  print(1)
elif H%2==0:
  print(W*H//2)
else:
  if W%2==1:
    print(W*(H//2)+W//2+1)
  else:
    print(W*(H//2)+W//2)

Buggy submission (verdict: Runtime Error):
K =int(input())
A =[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]
print(A[K])
Problem p02743 (python)

Fixed submission:
import math
a,b,c=map(int,input().split())
if c-a-b>0 and (c-a-b)**2 > 4*a*b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
H,W =map(int,input().split())
if H==1 or W==1:
  print(1)
elif H%2==0:
      print(W*H//2)
else:
  if W%2==1:
    print(W*(H//2)+W//2+1)
  else:
    print(W*(H//2)+W//2)
Problem p02747 (python)

Fixed submission:
A=input()
if A=='hi' or A=='hihi' or A=='hihihi' or A=='hihihihi' or A=='hihihihihi':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A=input
if A='hi' or A='hihi' or A='hihihi' or A='hihihihi' or A='hihihihihi' or A='hih' or A='hihih' or A='hihihih' or A='hihihihih':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A=input()
if A='hi' or A='hihi' or A='hihihi' or A='hihihihi' or A='hihihihihi':
    print('Yes')
else:
    print('No')
Problem p02748 (python)

Fixed submission:
A,B,M=map(int,input().split())
vecA=list(map(int,input().split()))
vecB=list(map(int,input().split()))
matX=[input().split() for k in range(M)]
price = 10**6
for i in range(0,M):
    pricecom = int(vecA[int(matX[i][0]) -1]) + int(vecB[int(matX[i][1]) -1]) - int(matX[i][2])
    if pricecom<= price:
        price=pricecom
    else:
        pass
price2=int(min(vecA)) + int(min(vecB))
if price2<=price:
    price=price2
print(price)

Buggy submission (verdict: Runtime Error):
A,B,M=map(int,input().split())
vecA=list(map(int,input().split()))
vecB=list(map(int,input().split()))
matX=[input().split() for k in range(M)]
price = 10**6
for i in range(0,M):
    pricecom = int(vecA[int(matX[i][0]) -1]) + int(vecB[int(matX[i][1]) -1]) - int(matX[i][2])
    if pricecom<= price:
        price=pricecom
    else:
        pass
for m in range(M):
    for n in range (M):
        price2=int(vecA[m]) + int(vecB[n])
        if price2<=price:
            price=price2
print(price)
Problem p02786 (python)

Fixed submission:
import math
k=int(input())
i=0
while k:
  k=math.floor(k/2)
  i+=1
print(2**i-1)

Buggy submission (verdict: Runtime Error):
import math
k=int(input())
ans=0
if k==1:
  print('1')
i=0
while True:
  k=math.floor(k/2)
  ans+=2**i
  i+=1
  if k=<1:
    print(ans)
    exit()

Buggy submission (verdict: Runtime Error):
import math
k=int(input())
ans=0
if k==1:
  print('1')
i=0
while True:
  k=math.floor(k/2)
  ans+=2**i
  i+=1
  if k=<1:
    print(ans)
    exit()
Problem p03160 (python)

Fixed submission:
n=int(input())
h=list(map(int, input().split())) 
dp=[float('inf')]*n
dp[0]=0
for i in range(n-1):
  dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]))
  if i < n - 2:
    dp[i + 2] = min(dp[i + 2], dp[i] + abs(h[i + 2] - h[i]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[False]*(k+1)
for j in range(1,k+1):
  for i in a:
    if 0<=j-i and dp[j-1]==False:
      dp[j]=True
if dp[k]:
  print('First')
else:
  print('Second')

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

dp = [0, abs(h[1]-[0])]

for i in range(2,n):
    dp.append(min(dp[i-1] + abs(h[i]-h[i+1]), dp[i] + abs(h[i]-h[i+2])))
    
print(dp[-1])
Problem p02536 (python)

Fixed submission:
N,M=map(int,input().split())
ab=[list(map(int,input().split()))for _ in range(M)]

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf=UnionFind(N)
for a,b in ab:
    uf.union(a-1,b-1)
print(uf.group_count()-1)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ab=[list(map(int,input().split()))for _ in range(M)]

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf=UnionFind(N)
for a,b in ab:
    uf.union(a,b)
print(uf.group_count()-1)
Problem p02642 (python)

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

A.sort()
count=[0]*(A[-1]+1)
i=0
while i<N:
    j=A[i]
    if 2<=count[j]:
        i+=1
        continue
    k=1
    while j*k<=A[-1]:
        count[j*k]+=1
        k+=1
    i+=1

print(sum(count[a]==1 for a in A))

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

A.sort()
ans=N
i=0
while i<len(A):
    if i==0 and A[i]==A[i+1]:
        ans-=1
        i+=1
        continue
    for a in A[:i]:
        if A[i]%a==0:
            ans-=1
            break
        if a>A[i]//2+1:
            break
    i+=1

print(ans)

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

A.sort()
ans=N
i=0
while i<len(A):
    if i==0 and A[i]==A[i+1]:
        ans-=1
        i+=1
        continue
    for a in A[:i]:
        if A[i]%a==0:
            ans-=1
            A=A[:i]+A[i+1:]
            i-=1
            break
    i+=1

print(ans)

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

A.sort()
ans=N
i=0
while i<N:
    if i==0 and A[i]==A[i+1]:
        ans-=1
        i+=1
        continue
    if A[i]==A[i-1]:
        ans-=1
        i+=1
        continue
    for a in A[:i]:
        if A[i]%a==0:
            ans-=1
            break
        if i>10**4 and a>int(A[i]**0.5)+1:
            break
    i+=1

print(ans)
Problem p02677 (python)

Fixed submission:
A,B,H,M=map(int,input().split())
import math

X=H*30+30*(M/60)
Y=M*6

ans=A*A+B*B-2*A*B*math.cos(math.radians(X-Y))
print(ans**0.5)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
AB=[list(map(int,input().split()))for _ in range(M)]

count=[0]*(N+1)
Problem p02684 (python)

Fixed submission:
N,K=map(int,input().split())
*A,=map(int,input().split())

point=[0]*N
count_X=0
count_Y=0
i=0
while point[i]!=3:
    if point[i]<2:
        count_X+=1
    point[i]+=1
    i=A[i]-1
    if point[i]>1:
        count_Y+=1
count_Y-=1

if K>=count_X:
    Z=count_X+(K-count_X)%count_Y
else:
    Z=K

i=0
ans=1
while i<Z:
    ans=A[ans-1]
    i+=1

print(ans)

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

point=[0]*N
count_X=0
count_Y=0
i=0
while 3 not in point:
    if 2 not in point:
        count_X+=1
    point[i]+=1
    i=A[i]-1
    if 2 in point:
        count_Y+=1
count_Y-=1

if K>=count_X:
    Z=count_X+(K-count_X)%count_Y
else:
    Z=K

i=0
ans=1
while i<Z:
    ans=A[ans-1]
    i+=1

print(ans)
Problem p02854 (python)

Fixed submission:
N=int(input())
*A,=map(int,input().split())
S=sum(A)

count1=0
count2=[0]*N
i=0
while i<N:
    count1+=A[i]
    count2[i]=abs(S-2*count1)
    i+=1

print(min(count2))

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

count1=0
i=0
while True:
    count1+=A[i]
    i+=1
    ans1=count1-sum(A[i:])
    if ans1>=0 and ans1<=i:
        break


A=A[::-1]
count2=0
j=0
while True:
    count2+=A[j]
    j+=1
    ans2=count2-sum(A[j:])
    if ans2>=0 and ans2<=j:
        break

print(min(ans1,ans2))
Problem p02939 (python)

Fixed submission:
S=list(input())
S=['_']+S
i=1
ans=0
while i<=len(S)-3:
    ans+=1
    if S[i-1]==S[i]:
        S[i+1]='_'
        i+=1
    i+=1

if len(S)==2:
    ans+=1
elif len(S)-i==1:
    ans+=1
elif S[i-1]!=S[i] and S[i]!=S[i+1]:
    ans+=2
else:
    ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
S=list(input())
S=['_']+S
i=1
ans=0
while i<=len(S)-3:
    ans+=1
    if S[i-1]==S[i]:
        S[i+1]='_'
        i+=1
    i+=1

if len(S)==2:
    ans+=1
elif len(S)-i==1:
    ans+=1
elif S[i]!=S[i+1] and S[i+1]!=S[i+2]:
    ans+=2
else:
    ans+=1

print(ans)
Problem p03006 (python)

Fixed submission:
N=int(input())
xy=[list(map(int,input().split()))for _ in range(N)]

count=[]
for x1,y1 in xy:
    for x2,y2 in xy:
        if x1==x2 and y1==y2:
            continue
        c=str(x1-x2)+':'+str(y1-y2)
        count.append(c)

from collections import*
C=Counter(count)
C['zentsu999']=0
print(N-max(C.values()))

Buggy submission (verdict: Runtime Error):
N=int(input())
xy=[list(map(int,input().split()))for _ in range(N)]

count=[]
for x1,y1 in xy:
    for x2,y2 in xy:
        if x1==x2 and y1==y2:
            continue
        c=str(x1-x2)+':'+str(y1-y2)
        count.append(c)

from collections import*
C=Counter(count)
print(N-max(C.values()))
Problem p03150 (python)

Fixed submission:
S=input()

ans='NO'
if S.find('k')==0 and S.rfind('eyence')==len(S)-6:
    ans='YES'
elif S.find('ke')==0 and S.rfind('yence')==len(S)-5:
    ans='YES'
elif S.find('key')==0 and S.rfind('ence')==len(S)-4:
    ans='YES'
elif S.find('keye')==0 and S.rfind('nce')==len(S)-3:
    ans='YES'
elif S.find('keyen')==0 and S.rfind('ce')==len(S)-2:
    ans='YES'
elif S.find('keyenc')==0 and S.rfind('e')==len(S)-1:
    ans='YES'

print(ans)

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

ans='NO'
if 'keyence'in S:
    ans='YES'
elif S.find('k')>=0 and S.find('k')<S.rfind('eyence'):
    ans='YES'
elif S.find('ke')>=0 and S.find('ke')<S.rfind('yence'):
    ans='YES'
elif S.find('key')>=0 and S.find('key')<S.rfind('ence'):
    ans='YES
elif S.find('keye')>=0 and S.find('keye')<S.rfind('nce'):
    ans='YES'
elif S.find('keyen')>=0 and S.find('keyen')<S.rfind('ce'):
    ans='YES'
elif S.find('keyenc')>=0 and S.find('keyenc')<S.rfind('e'):
    ans='YES'

print(ans)
Problem p03244 (python)

Fixed submission:
N=int(input())
*V,=map(int,input().split())

from collections import*
C1=Counter(V[::2])
C1=sorted(C1.items(),key=lambda x:x[1])
C2=Counter(V[1::2])
C2=sorted(C2.items(),key=lambda x:x[1])

K1=C1[-1][0]
V1=C1[-1][1]
K2=C2[-1][0]
V2=C2[-1][1]
if V1>V2:
    if K1==K2:
        V2=C2[-2][1]
elif V2>V1:
    if K1==K2:
        V1=C1[-2][1]
else:
    if K1==K2:
        if len(set(V))==1:
            V2=0
        else:
            V2=max(C1[-2][1],C2[-2][1])

print(N-V1-V2)

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

from collections import*
C1=Counter(V[::2])
C1=sorted(C1.items(),key=lambda x:x[1])
C2=Counter(V[1::2])
C2=sorted(C2.items(),key=lambda x:x[1])

K1=C1[-1][0]
V1=C1[-1][1]
K2=C2[-1][0]
V2=C2[-1][1]
if V1>V2:
    if K1==K2:
        V2=C2[-2][1]
elif V2>V1:
    if K1==k2:
        V1=C1[-2][1]
elif K1==K2:
    if len(set(C1))==1:
        V2=C2[-2*(len(set(C2))>1)][1]*(len(set(C2))>1)
    else:
        V1=C1[-2*(len(set(C1))>1)][1]*(len(set(C1))>1)

print(N-V1-V2)
Problem p03285 (python)

Fixed submission:
N=int(input())

ans='No'
i=0
while 7*i<=N:
    if (N-7*i)%4==0:
        ans='Yes'
    i+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
*H,=map(int,input().split())
RH=H[::-1]

ans='Yes'
i=0
while i+1<=N-1:
    if RH[i+1]-RH[i]==1:
        RH[i+1]-=1
    elif RH[i+1]-RH[i]>=
Problem p03288 (python)

Fixed submission:
K=int(input());print('ABC'*(K<1200)or'ARC'*(K<2800)or'AGC')

Buggy submission (verdict: Runtime Error):
K=int(input());print('ABC'(K<1200)or'ARC'(K<2800)or'AGC')