Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())

a=list(map(int,input().split()))
b=0
for i in range(len(a)-1):
    if a[i]//2==0:
        if a[i]//3==0 or a[i]//5==0:
            b=b+1
    else:
        b=b+1

if b==n:
    print("APPROVED")
else:
    print("DENIED")

Fixed submission:
a,b,c=map(int,input().split())
if a==b==c:
    print("No")
elif a == b or b==c or c==a:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b==c:
    print("No")
elif　a==b or b==c:
    print("Yes")
else:
    print("No")


Fixed submission:
a,b,c=map(int,input().split())
if a==b==c:
    print("No")
elif a == b or b==c or c==a:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A=map(int,input().split())
if A[0]=A[1]=A[2]:
    print("No")
elif　A[0]=A[1] orA[1]=A[2]:
    print("Yes")
else:
    print("No")


Fixed submission:
a,b,c=map(int,input().split())
if a==b==c:
    print("No")
elif a == b or b==c or c==a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
an = list(map(int, input().split()))
sum_a = sum(an)
if an - sum_a < 0:
    print(-1)
else:
    print(an-sum_a)

Fixed submission:
n,m = map(int, input().split())
an = list(map(int, input().split()))
sum_a = sum(an)
if n - sum_a < 0:
    print(-1)
else:
    print(n-sum_a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

num_rgb = {'R':0, 'G':0, 'B':0}
num_list = []
for i in range(n):
    num_rgb[s[i]] += 1
    num_list.append(num_rgb.copy())

total = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] == s[j]:
            continue
        target = ''
        if not (s[i] == 'R' or s[j] == 'R'):
            target = 'R'
        elif not (s[i] == 'G' or s[j] == 'G'):
            target = 'G'
        elif not (s[i] == 'B' or s[j] == 'B'):
            target = 'B'
        num = num_list[n-1][target]-num_list[j][target]
        if 2*j-i < n and s[j+j-i] == target:
            num -= 1
        total += num
print(total)


Fixed submission:
s = input()
res = False
for c in s:
  if c == '7':
    res = True
    break
if res:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
from itertools import combinations

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

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

n = int(input())
total = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            total += gcd(i,j,k)
print(total)

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)

n = int(input())
total = 0
for i in range(1,n+1):
    for j in range(i,n+1):
        for k in range(j,n+1):
            t = 1
            if i != k and i != j and j!= k:
                t = 6
            elif (i == j and i != k) or (i != j and j == k):
                t = 3
            total += gcd(i,j,k)*t
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

num_rgb = {'R':0, 'G':0, 'B':0}
num_list = []
for i in range(n):
    num_rgb[s[i]] += 1
    num_list.append(num_rgb.copy())

total = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] == s[j]:
            continue
        target = ''
        if not (s[i] == 'R' or s[j] == 'R'):
            target = 'R'
        elif not (s[i] == 'G' or s[j] == 'G'):
            target = 'G'
        elif not (s[i] == 'B' or s[j] == 'B'):
            target = 'B'
        num = num_list[n-1][target]-num_list[j][target]
        if 2*j-i < n and s[j+j-i] == target:
            num -= 1
        total += num
print(total)

Fixed submission:
n = int(input())
s = input()
 
num_rgb = {'R':0, 'G':0, 'B':0}
num_list = []
for i in range(n):
    num_rgb[s[i]] += 1
    num_list.append(num_rgb.copy())
 
total = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] == s[j]:
            continue
        target = ''
        if not (s[i] == 'R' or s[j] == 'R'):
            target = 'R'
        elif not (s[i] == 'G' or s[j] == 'G'):
            target = 'G'
        elif not (s[i] == 'B' or s[j] == 'B'):
            target = 'B'
        num = num_list[n-1][target]-num_list[j][target]
        if 2*j-i < n and s[j+j-i] == target:
            num -= 1
        total += num
print(total)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = list(map(int, input().split()))

s = a.sum()
min_num = s//(4*m)

res = "No"
count = 0
for x in a:
    if x >= min_num:
        count += 1
    if count >= m:
        res = "Yes"
        break
print(res)

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

s = sum(a)
min_num = float(s)/(4*m)

res = "No"
count = 0
for x in a:
    if x >= min_num:
        count += 1
    if count >= m:
        res = "Yes"
        break
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
an = list(map(int, input().split()))

dic = {}
for i in range(n):
  if an[i] not in dic.keys():
    dic[an[i]] = 1
  else:
    dic[an[i]] += 1

for i in range(n):
  sum = 0
  for k,v in dic.items():
    if an[i] == k:
      sum += (v-1)*(v-2)//2
    else:
      sum += v*(v-1)//2
  print(sum)

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

dic = {}
for i in range(n):
  if an[i] not in dic.keys():
    dic[an[i]] = 1
  else:
    dic[an[i]] += 1

ans = {}
all_pattern = 0
for k,v in dic.items():
    if v >= 2:
        all_pattern += v*(v-1)//2
for k,v in dic.items():
    ans[k] = all_pattern - (v-1)
for v in an:
    print(ans[v])
Buggy python submission (verdict: Runtime Error):
import itertools
n = int(input())
dn = list(map(int, input().split())
print(sum(d*cumulate for d, cumulate in zip(dn[1:], itertools.accumulate(dn)))

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

sum = 0
for i in range(n):
    for j in range(i+1,n):
        sum += d[i]*d[j]

print(sum)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
after_fusion = []

current = ''
for i in range(n):
    if s[i] != current:
        after_fusion.append(s[i])
        current = s[i]

print(len(after_fusion)

Fixed submission:
n = int(input())
s = input()
after_fusion = []

current = ''
for i in range(n):
    if s[i] != current:
        after_fusion.append(s[i])
        current = s[i]

print(len(after_fusion))
Buggy python submission (verdict: Runtime Error):
import heapq
n,m = map(int, input().split())
job_list = []
for i in range(n):
    a,b = map(int, input().split())
    job_list.append((a,b))

hq = []
max_income = 0
j = 0
for i in range(1,m+1):
    while j < n and job_list[j][0] <= i:
        heapq.heappush(hq, (-job_list[j][1],job_list[j][0]))
    if len(hq) < 1:
        continue
    b_i, a_i = heapq.heappop(hq)
    max_income += -b_i

print(max_income)

Fixed submission:
a,b = map(int,input().split())
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
n,m = map(int, input().split())
job = {}
for i in range(n):
    a,b = map(int, input().split())
    if a not in job.keys():
        job[a] = [(-b,a)]
    else:
        job[a].append((-b,a))

hq = []

max_income = 0
for i in range(1,m+1):
    if i in job.keys():
        for j in job[i]:
            heapq.heappush(hq,(j))
    if len(hq) < 1:
        continue
    b_i, a_i = heapq.heappop(hq)
    max_income += -b_i

print(max_income)


Fixed submission:
import heapq
n,m = map(int, input().split())
job_list = []
for i in range(n):
    a,b = map(int, input().split())
    job_list.append((a,b))
job_list.sort(key=lambda x:x[0])
# print(job_list)

hq = []
max_income = 0
j = 0
for i in range(1,m+1):
    while j < n and job_list[j][0] <= i:
        heapq.heappush(hq, (-job_list[j][1],job_list[j][0]))
        j += 1
    if len(hq) < 1:
        continue
    b_i, a_i = heapq.heappop(hq)
    max_income += -b_i

print(max_income)

Buggy python submission (verdict: Runtime Error):
import heapq
n,m = map(int, input().split())
job = {}
for i in range(n):
    a,b = map(int, input().split())
    if a not in job.keys():
        job[a] = [(-b,a)]
    else:
        job[a].append((-b,a))

hq = []

max_income = 0
for i in range(1,m+1):
    if i in job.keys():
        for j in job[i]:
            heapq.heappush(hq,(j))
    b_i, a_i = heapq.heappop(hq)
    max_income += -b_i

print(max_income)

Fixed submission:
import heapq
n,m = map(int, input().split())
job_list = []
for i in range(n):
    a,b = map(int, input().split())
    job_list.append((a,b))
job_list.sort(key=lambda x:x[0])
# print(job_list)

hq = []
max_income = 0
j = 0
for i in range(1,m+1):
    while j < n and job_list[j][0] <= i:
        heapq.heappush(hq, (-job_list[j][1],job_list[j][0]))
        j += 1
    if len(hq) < 1:
        continue
    b_i, a_i = heapq.heappop(hq)
    max_income += -b_i

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

def check(n,y):
    if n == 0 and y == 0:
        return {"truth":True, "a":0, "b":0, "c":0}
    elif n == 0 or y == 0:
        return {"truth":False, "a":-1, "b":-1, "c":-1}
    checkA = check(n-1, y-10000)
    checkB = check(n-1, y-5000)
    checkC = check(n-1, y-1000)
    if  checkA["truth"]:
        checkA["a"] += 1
        return checkA
    elif checkB["truth"]:
        checkB["b"] += 1
        return checkB
    elif checkC["truth"]:
        checkC["c"] += 1
        return checkC
    else:
        return {"truth":False, "a":-1, "b":-1, "c":-1}

print(check(n,y))

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

sum = y
wasFound = False
for i in range(n+1):
    if wasFound:
        break
    for j in range(n+1):
        if i+j > n:
            break
        rest = sum - i*10000 - j*5000
        if rest < 0:
            break
        k = int(rest/1000)
        if rest % 1000 == 0 and (i+j+k==n):
            print(i, j, k)
            wasFound = True
            break
if not wasFound:
    print(-1, -1, -1)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from itertools import accumulate
q = int(stdin.readline().rstrip())
l_r = [list(map(int,stdin.readline().rstrip().split())) for _ in range(q)]
max_n = 0
for s in l_r:
    max_n = max(s[1], max_n)
# print(max_n)
# print(l_r)

a = [i for i in range(max_n+1)]

def isPrime(num):
    if num == 0 or num == 1:
        return False
    ans = True
    for i in range(2,int(num/2)+1):
        if num % i == 0:
            ans = False
            break
    return ans

b = [1 if isPrime(x) else 0 for x in a]
# print(b)
c = [1 if x == 1 and b[int((i+1)/2)] == 1 else 0 for i,x in enumerate(b)] 
# print(c)
s = list(accumulate(c))
# print(len(s))

for i in range(q):
    print(s[l_r[i][1]]-s[l_r[i][0]-1])

Fixed submission:
from sys import stdin
from itertools import accumulate
q = int(stdin.readline().rstrip())
l_r = [list(map(int,stdin.readline().rstrip().split())) for _ in range(q)]
max_n = 0
for s in l_r:
    max_n = max(s[1], max_n)
# print(max_n)
# print(l_r)

a = [i for i in range(max_n+1)]

def isPrime(num):
    if num == 0 or num == 1:
        return False
    ans = True
    for i in range(2,int(num/2)+1):
        if num % i == 0:
            ans = False
            break
    return ans
b = [1] * (max_n+1)
b[0] = 0
b[1] = 0
for i in range(2,max_n+1):
    if b[i]:
        j = i*2
        while j <= max_n:
            b[j] = 0
            j += i
# print(b)
c = [1 if x == 1 and b[int((i+1)/2)] == 1 else 0 for i,x in enumerate(b)] 
# print(c)
s = list(accumulate(c))
# print(len(s))

for i in range(q):
    print(s[l_r[i][1]]-s[l_r[i][0]-1])
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
l = [[i,j,m] for i in range(1,k+1) for j in range(1,k+1) for m in range(1,k+1)]
ans = 0
for i in range(len(l)):
    ans += math.gcd(l[i][2],math.gcd(l[i][0],l[i][1]))
print(ans)

Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
k = int(input())

ans = 0

for x in range(1,k+1):
    for y in range(1,k+1):
        xy = gcd(x,y)
        for z in range(1,k+1):
            ans += gcd(xy,z)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
k = int(input())

ans = 0

for x in range(1,k+1):
    for y in range(1,k+1):
        xy = gcd(x,y)
        for z in range(1,k+1):
            ans += gcd(xy,z)

print(ans)


Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
k = int(input())

ans = 0

for x in range(1,k+1):
    for y in range(1,k+1):
        xy = gcd(x,y)
        for z in range(1,k+1):
            ans += gcd(xy,z)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
p_test = [sum(p[i:i+k]) for i in range(n)]
key = p_test.index(max(p_test))
ans = []
kitaiti = 0
ans_list = p[key:key+k]
for i in ans_list:
    kitaiti += (((1+i)/2)*i)*i**-1
print(kitaiti)


Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p_kitaiti = [(1+p[i])/2 for i in range(n)]
ans = sum(p_kitaiti[:k])
number = sum(p_kitaiti[:k])
for i in range(k,n):
    number = number + p_kitaiti[i] - p_kitaiti[i-k]
    ans = max(ans,number)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
p_test = [sum(p[i:i+k]) for i in range(n)]
key = p_test.index(max(p_test))
ans = []
kitaiti = 0
ans_list = p[key:key+k]
for i in ans_list:
    kitaiti += (((1+i)/2)*i)*i**-1
print(kitaiti)


Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p_kitaiti = [(1+p[i])/2 for i in range(n)]
ans = sum(p_kitaiti[:k])
number = sum(p_kitaiti[:k])
for i in range(k,n):
    number = number + p_kitaiti[i] - p_kitaiti[i-k]
    ans = max(ans,number)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = []
kitaiti = 0
max_key = -1
for i in range(len(p)):
    sum_p = sum(p[i:i+k])
    if max_key <= sum_p:
        max_key = sum_p
        key = i
ans_list = p[key:key+k]
for i in ans_list:
    kitaiti += (((1+i)/2)*i)*i**-1
print(kitaiti)


Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p_kitaiti = [(1+p[i])/2 for i in range(n)]
ans = sum(p_kitaiti[:k])
number = sum(p_kitaiti[:k])
for i in range(k,n):
    number = number + p_kitaiti[i] - p_kitaiti[i-k]
    ans = max(ans,number)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = []
kitaiti = 0
for i in range(len(p)):
    ans.append(sum(p[i:i+k]))
key = ans.index(max(ans))
ans_list = p[key:key+k]
for i in ans_list:
    kitaiti += (((1+i)/2)*i)*i**-1
print(kitaiti)


Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p_kitaiti = [(1+p[i])/2 for i in range(n)]
ans = sum(p_kitaiti[:k])
number = sum(p_kitaiti[:k])
for i in range(k,n):
    number = number + p_kitaiti[i] - p_kitaiti[i-k]
    ans = max(ans,number)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
count = 0
flag = True
for i in range(n):
    key = p[i]
    for j in range(i):
        if key > p[j]:
            flag = False
            break
    if flag == True:
        count += 1
    else:
        flag = True
print(count)


Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 0
flag = True
max_l = p[0]
min_l = p[0]
for i in range(n):
    key = p[i]
    if min_l > key:
        count += 1
        min_l = key
print(count+1)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
ans = a-2*b
if ans <= 0:
  print(0)
else:
  print(ans)

Fixed submission:
a,b = map(int,input().split())
ans = a-2*b
if ans <= 0:
  print(0)
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,inpout())
ans = a-2*b
if ans <= 0:
  print(0)
else:
  print(ans)

Fixed submission:
a,b = map(int,input().split())
ans = a-2*b
if ans <= 0:
  print(0)
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

for i in range(1,n+1):
    if i != n+1:
        print('{} '.format(a.index(i)+1),end="")
    else:
        print(a.index(i)+1)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
dict = {}
for i in range(n):
    dict.setdefault(a[i],i+1)

for i in range(1,n+1):
    if i != n+1:
        print('{} '.format(dict[i]),end="")
    else:
        print(dict[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(str(a.index(i)+1))
b=' '.join(ans)
print(b)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
dict = {}
for i in range(n):
    dict.setdefault(a[i],i+1)

for i in range(1,n+1):
    if i != n+1:
        print('{} '.format(dict[i]),end="")
    else:
        print(dict[i])
Buggy python submission (verdict: Time Limit Exceeded):

a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd/i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if i > max_gcd:
        break
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
print(count+1)


Fixed submission:

a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd//i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if i*i > max_gcd:
        break
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
if max_gcd == 1:
    print(count+1)
else:
    print(count+2)

Buggy python submission (verdict: Time Limit Exceeded):

a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd/i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
print(count+1)


Fixed submission:

a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd//i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if i*i > max_gcd:
        break
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
if max_gcd == 1:
    print(count+1)
else:
    print(count+2)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
min_count = min(a,b)
list_d = [1]
count = 0
flag = True
ans = [1]
for i in range(2,min_count+1):
    if a%i==0 and b%i==0:
        list_d.append(i)
a = list_d[1:]

for i in a:
    flag = True
    for j in list_d[1:list_d.index(i)]:
        if i%j == 0:
            flag = False
            break
    if flag:
        ans.append(i)

print(len(ans))


Fixed submission:

a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd//i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if i*i > max_gcd:
        break
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
if max_gcd == 1:
    print(count+1)
else:
    print(count+2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = [i for i in range(n)]
print(sum(m))


Fixed submission:
n = int(input())
print((n*(n-1))//2)
Buggy python submission (verdict: Runtime Error):
s = input()
s_len = len(s)
count = 0
s = [s[i:i+3] for i in range(0,len(s),3)]
s_new = []
for i in s:
    s_new.append(i[0])
    s_new.append(i[1:3])
if s_new[len(s_new)-1]=='':
    s_new.remove('')
ans = len(s_new)
#print(s_new)
if s_len==2:
    if s_new[0]==s_new[1]:
        print(1)
    else:
        print(ans)
    exit()
for i in range(1,len(s_new),2):
    if i!=len(s_new)-1:
        if s_new[i][0]!=s_new[i][1] and s_new[i][0]!=s_new[i-1] and s_new[i][1]!= s_new[i+1]:
            ans += 1
    else:
        if s_new[i][0]!=s_new[i][1] and s_new[i][0]!=s_new[i-1]:
            ans += 1
print(ans)


Fixed submission:
s = input()
key = s[0]
temp = ''
ans = 1
for i in range(1,len(s)):
    temp += s[i]
    if key != temp:
        ans += 1
        key = temp
        temp = ''


print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
s_len = len(s)
count = 0
s = [s[i:i+3] for i in range(0,len(s),3)]
s_new = []
for i in s:
    s_new.append(i[0])
    s_new.append(i[1:3])
if s_new[len(s_new)-1]=='':
    s_new.remove('')
ans = len(s_new)
#print(s_new)
for i in range(1,len(s_new),2):
    if i!=len(s_new)-1:
        if s_new[i][0]!=s_new[i][1] and s_new[i][0]!=s_new[i-1] and s_new[i][1]!= s_new[i+1]:
            ans += 1
    else:
        if s_new[i][0]!=s_new[i][1] and s_new[i][0]!=s_new[i-1]:
            ans += 1
print(ans)


Fixed submission:
s = input()
key = s[0]
temp = ''
ans = 1
for i in range(1,len(s)):
    temp += s[i]
    if key != temp:
        ans += 1
        key = temp
        temp = ''


print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
s_len = len(s)
count = 0
s = [s[i:i+3] for i in range(0,len(s),3)]
s_new = []
for i in s:
    s_new.append(i[0])
    s_new.append(i[1:3])
ans = len(s_new)
for i in range(1,len(s_new),2):
    if i!=len(s_new)-1:
        if s_new[i][0]!=s_new[i][1] and s_new[i][0]!=s_new[i-1] and s_new[i][1]!= s_new[i+1]:
            ans += 1
    else:
        if s_new[i][0]!=s_new[i][1] and s_new[i][0]!=s_new[i-1]:
            ans += 1
print(ans)


Fixed submission:
s = input()
key = s[0]
temp = ''
ans = 1
for i in range(1,len(s)):
    temp += s[i]
    if key != temp:
        ans += 1
        key = temp
        temp = ''


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]

for i in range(N):
    print(max(A[:i]+A[i+1:]))


Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]
max_a = max(A)
max_count = A.count(max_a)
if max_count == 1:
    ind = A.index(max_a)
    max_b = max(A[:ind]+A[ind+1:])

for i in range(N):
    if max_count > 1:
        print(max_a)
    else:
        if A[i] == max_a:
            print(max_b)
        else:
            print(max_a)