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

for i in range(n):
	count.append(0)
	while True:
		if a[i]%2 == 0 :
			a[i] = a[i]/2
			count[i] += 1
		else:
			break

print(max(count))

Fixed submission:
n = int(input())
a=list(map(int, input().split()))
count = 0
boolean = True

while boolean == True:
	for i in range(n):
		if a[i]%2 == 0 :
			a[i] = a[i]/2
			if i == (n-1):
				count += 1
		else:
			boolean = False
			break

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a=input()
count = []

for i in n:
	count[i] = 0
	while True:
		if a[i]%2=0 :
			a[i] = a[i]/2
			count[i] += 1
		else:
			break

max(count)

Fixed submission:
n = int(input())
a=list(map(int, input().split()))
count = 0
boolean = True

while boolean == True:
	for i in range(n):
		if a[i]%2 == 0 :
			a[i] = a[i]/2
			if i == (n-1):
				count += 1
		else:
			boolean = False
			break

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a=input()
count = []

for i in n:
	while True:
		if a[i]%2=0 :
			a[i] = a[i]/2
			count[i] += 1
		else:
			break

max(count)

Fixed submission:
n = int(input())
a=list(map(int, input().split()))
count = 0
boolean = True

while boolean == True:
	for i in range(n):
		if a[i]%2 == 0 :
			a[i] = a[i]/2
			if i == (n-1):
				count += 1
		else:
			boolean = False
			break

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import re

N = int(input())
S = input()

rex = r'([^_])\1{0,}'
pattern = re.compile(rex)

matchobj = pattern.search(S)
while matchobj:
    S = pattern.sub("_", S, 1)
    matchobj = pattern.search(S)
print(len(S))


Fixed submission:
import re

N = int(input())
S = input()

rex = r'(.)\1{0,}'
pattern = re.compile(rex)
ans = pattern.findall(S)

print(len(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import re

N = int(input())
S = input()

rex = r'([^_])\1{0,}'
pattern = re.compile(rex)

matchobj = pattern.search(S)
while matchobj:
    S = S.replace(matchobj.group(), "_", 1)
    matchobj = pattern.search(S)
print(len(S))


Fixed submission:
import re

N = int(input())
S = input()

rex = r'(.)\1{0,}'
pattern = re.compile(rex)
ans = pattern.findall(S)

print(len(ans))
Buggy python submission (verdict: Runtime Error):
import sys

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

different_index = -1
should_place = -1
for i, p in enumerate(p_list):
    if different_index >= 0 and p != i + 1 and i != should_place:
        print("NO")
        sys.exit(1)

    if different_index == -1 and p != i + 1:
        different_index = i
        should_place = p - 1
        continue
    

if different_index == -1:
    print("YES")
elif p_list[should_place] == different_index + 1:
    print("YES")
else:
    print("NO")

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

counter = 0
for pair in zip(p_list, range(1, len(p_list) + 1)):
    if pair[0] - pair[1] != 0:
        counter += 1

if counter == 0 or counter == 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

now_max = -1
prev_max = 100000000
left_max = -1
right_max = -1
right_max_index = 0

N = int(input())
A_list = [int(input()) for _ in range(N)]
np_A_list = np.array(A_list)
for i, A in enumerate(A_list):
    # 右端
    if i == len(A_list) - 1:
        print(left_max)
        break
    if right_max_index == i:
        slc = np_A_list[i + 1:]
        right_max = slc.max()
        right_max_index = slc.argmax() + i + 1

    if left_max > right_max:
        now_max = left_max
        print(left_max)
    else:
        now_max = right_max
        print(right_max)
    
    if prev_max < now_max:
        left_max = right_max = now_max
        right_max_index = 10000000
    
    prev_max = now_max
    if left_max < A:
        left_max = A


Fixed submission:
import numpy as np

now_max = -1
prev_max = 100000000
left_max = -1
right_max = -1
right_max_index = 0

N = int(input())
A_list = [int(input()) for _ in range(N)]
np_A_list = np.array(A_list)
for i, A in enumerate(A_list):
    # 右端
    if i == len(A_list) - 1:
        print(left_max)
        break
    if right_max_index == i:
        slc = np_A_list[i + 1:]
        right_max = slc.max()
        right_max_index = len(np_A_list) - 1 - slc[::-1].argmax()

    if left_max > right_max:
        now_max = left_max
        print(left_max)
    else:
        now_max = right_max
        print(right_max)
    
    if prev_max < now_max:
        left_max = right_max = now_max
        right_max_index = 10000000
    
    prev_max = now_max
    if left_max < A:
        left_max = A

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

left_max = -1
right_max = -1
right_max_index = 0

N = int(input())
A_list = [int(input()) for _ in range(N)]
np_A_list = np.array(A_list)
for i, A in enumerate(A_list):
    # 右端
    if i == len(A_list) - 1:
        print(left_max)
        break
    if right_max_index == i:
        slc = np_A_list[i + 1:]
        right_max = slc.max()
        right_max_index = slc.argmax() + i + 1

    if left_max > right_max:
        print(left_max)
    else:
        print(right_max)
    
    if left_max < A:
        left_max = A


Fixed submission:
import numpy as np

now_max = -1
prev_max = 100000000
left_max = -1
right_max = -1
right_max_index = 0

N = int(input())
A_list = [int(input()) for _ in range(N)]
np_A_list = np.array(A_list)
for i, A in enumerate(A_list):
    # 右端
    if i == len(A_list) - 1:
        print(left_max)
        break
    if right_max_index == i:
        slc = np_A_list[i + 1:]
        right_max = slc.max()
        right_max_index = len(np_A_list) - 1 - slc[::-1].argmax()

    if left_max > right_max:
        now_max = left_max
        print(left_max)
    else:
        now_max = right_max
        print(right_max)
    
    if prev_max < now_max:
        left_max = right_max = now_max
        right_max_index = 10000000
    
    prev_max = now_max
    if left_max < A:
        left_max = A
Buggy python submission (verdict: Runtime Error):
import numpy as np

# 入力行N，列D
N, D = map(int, input().split())
points = [list(map(int, input().split())) for i in range(N)]

def calc_distance(p1, p2):
    sum = 0
    for i in range(len(p1)):
        sum += (p1[i] - p2[i]) ** 2
    return np.sqrt(sum)

count = 0
for i, point in enumerate(points):
    for point2 in points[i + 1:]:
        outp = calc_distance(point, point2)
        if outp.is_integer():
            count += 1

print(count)

Fixed submission:
import numpy as np

# 入力行N，列D
N, D = map(int, input().split())
points = [list(map(int, input().split())) for i in range(N)]

def calc_distance(p1, p2):
    sum = 0
    for i in range(len(p1)):
        sum += (p1[i] - p2[i]) ** 2
    return np.sqrt(sum)

count = 0
for i, point in enumerate(points):
    for point2 in points[i + 1:]:
        outp = calc_distance(point, point2)
        if outp.is_integer():
            count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
li = input().split()
n = int(li[0])
m = int(li[1])
# IDカードn枚，　ゲートm個
l_r = []
# i番目のゲートはl~rのIDカードを持っていれば通過できる
l_r = [input().split() for i in range(m)]
answer = 0
for i in range(n):
    for lr in l_r:
        l = int(lr[0])
        r = int(lr[1])
        if l <= i + 1 and i + 1 <= r:
            continue
        else:
            break
    else:
        answer += 1
print(answer)

Fixed submission:
li = input().split()
n = int(li[0])
m = int(li[1])
# IDカードn枚，　ゲートm個
# i番目のゲートはl~rのIDカードを持っていれば通過できる
l_r = [input().split() for i in range(m)]
l_r.sort(key=lambda x:int(x[0]))
l_max = int(l_r[-1][0])
l_r.sort(key=lambda x:int(x[1]))
r_min = int(l_r[0][1])
answer = 0
# for i in range(n):
#     if l_max <= i + 1 and i + 1 <= r_min:
#         answer += 1
diff = r_min - l_max + 1
if diff > 0:
    print(diff)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
li = input().split()
n = int(li[0])
m = int(li[1])
# IDカードn枚，　ゲートm個
l_r = []
# i番目のゲートはl~rのIDカードを持っていれば通過できる
for i in range(m):
    l_r.append(input().split())
answer = 0
for i in range(n):
    for lr in l_r:
        l = int(lr[0])
        r = int(lr[1])
        if l <= i + 1 and i + 1 <= r:
            continue
        else:
            break
    else:
        answer += 1
print(answer)

Fixed submission:
li = input().split()
n = int(li[0])
m = int(li[1])
# IDカードn枚，　ゲートm個
# i番目のゲートはl~rのIDカードを持っていれば通過できる
l_r = [input().split() for i in range(m)]
l_r.sort(key=lambda x:int(x[0]))
l_max = int(l_r[-1][0])
l_r.sort(key=lambda x:int(x[1]))
r_min = int(l_r[0][1])
answer = 0
# for i in range(n):
#     if l_max <= i + 1 and i + 1 <= r_min:
#         answer += 1
diff = r_min - l_max + 1
if diff > 0:
    print(diff)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))

total = 0

for i in range(d.count()-1):
    for j in range(1,d.count()):
        total += d[i]*d[j]


print(total)

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

total = 0

for i in range(0,len(d)-1):
    for j in range(i+1,len(d)):
        total += d[i]*d[j]
print(total)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())

a = s[0]
for i in range(1,len(s)):
    if a != s[i]:
        a = s[i]
    else:
        del s[i]

print(len(s))


Fixed submission:
n = int(input())
s = list(input())

a = s[0]
ans = list(s[0])
for i in range(1,len(s)):
    if a != s[i]:
        a = s[i]
        ans.append(s[i])

print(len(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int,input().split()))

max_ctn = 0
for i in range(n):
    tmp_ctn = 0
    for j in range(i,len(h)-1):
        if h[j] >= h[j+1]:
            tmp_ctn += 1
            continue
        i = j
        break
    if max_ctn < tmp_ctn:
        max_ctn = tmp_ctn
print(max_ctn)

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

max_ctn = 0
start = 0
for i in range(0,n):
    tmp_ctn = 0
    i +=start
    for j in range(i,len(h)-1):
        if h[j] >= h[j+1]:
            tmp_ctn += 1
            start +=1
            continue
        break
    if max_ctn < tmp_ctn:
        max_ctn = tmp_ctn
print(max_ctn)
Buggy python submission (verdict: Runtime Error):
n = input()
count = 0
start = 1
while start < len(n):
    count += 10**start - 10**(start -1)
    start +=2

if len(n) % 2 == 0:
    print(count)
else:
    print(count + int(n[1:]) + 1)

Fixed submission:
n = int(input())

count = 0
count
for i in range(1,n+1):
    if (len(str(i)) % 2 != 0):
        count+=1

print(count)
Buggy python submission (verdict: Runtime Error):
from dateutil.parser import parse
s = input()
inputDate = parse(s)
heiseiDate = parse('20190430')

if inputDate > heiseiDate:
    print('TBD')
else:
    print('Heisei')

Fixed submission:
from datetime import datetime
s = input()
inputDate = datetime.strptime(s,'%Y/%m/%d')
heiseiDate = datetime.strptime('20190430','%Y%m%d')

if inputDate > heiseiDate:
    print('TBD')
else:
    print('Heisei')

Buggy python submission (verdict: Runtime Error):
s = input()
from dateutil.parser import parse
inputDate = parse(s)
heisei = parse('20190430')

if inputDate > heisei:
    print('TBD')
else:
    print('Heisei')

Fixed submission:
from datetime import datetime
s = input()
inputDate = datetime.strptime(s,'%Y/%m/%d')
heiseiDate = datetime.strptime('20190430','%Y%m%d')

if inputDate > heiseiDate:
    print('TBD')
else:
    print('Heisei')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if n ==1:
    print('Hello World')
if n == 2:
    print(a+b)

Fixed submission:
n = int(input())


if n ==1:
    print('Hello World')
if n == 2:
    a = int(input())
    b = int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1'
        count +=1
print(count)

Fixed submission:
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1':
        count +=1
print(count)

Buggy python submission (verdict: Runtime Error):
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1'
        count +=1
print(count)

Fixed submission:
math = input()
count = 0
for i in range(len(math)):
    if math[i] == '1':
        count +=1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
s = input()
a  = 7
n = len(s)
for i in range(2**(n-1)):
    total = int(s[0])
    ans = [s[0]]
    for j in range(n-1):
        if (i >> j) & 1:
            total += int(s[j+1])
            ans.append('+' + s[j+1])
        else:
            total -= int(s[j+1])
            ans.append('-'+s[j+1])
    if total == 7:
        print(''.jon(ans) + '=7')
        sys.exit()


Fixed submission:
import sys
s = input()
a  = 7
n = len(s)
for i in range(2**(n-1)):
    total = int(s[0])
    ans = [s[0]]
    for j in range(n-1):
        if (i >> j) & 1:
            total += int(s[j+1])
            ans.append('+' + s[j+1])
        else:
            total -= int(s[j+1])
            ans.append('-'+s[j+1])
    if total == 7:
        print(''.join(ans) + '=7')
        sys.exit()
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
print((n-1)*(m-1) if (n-1) > a and (m-1) > 1 else 0)

Fixed submission:
n,m = map(int,input().split())
print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
print(sum(a) - max(a))


Fixed submission:
a = list(map(int,input().split()))
print(sum(a) - max(a))
Buggy python submission (verdict: Runtime Error):
a,s  = map(int,input().split())

sum = 0
for i in range(0,a+1):
    for j in range(0,a+1):
        if s-i-j <= a:
            sum + = 1
print(sum)



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

sum = 0
for i in range(0,a+1):
    for j in range(0,a+1):
        if 0 <= s-i-j <= a:
            sum += 1
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
a,s  = map(int,input().split())

sum = 0
for i in range(0,a+1):
    for j in range(0,a+1):
        for k in range(0,a+1):
            if i+j+k == s:
                sum += 1
print(sum)
            
    

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

sum = 0
for i in range(0,a+1):
    for j in range(0,a+1):
        if 0 <= s-i-j <= a:
            sum += 1
print(sum)
Buggy python submission (verdict: Runtime Error):
N, K = [int(x) for x in input().split(' ')]
m = 10**9 + 7
import math
def combination(n, r):
  return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  
n = min(K, N-K+1)
for k in range(1, n+1):
  print(combination(N-K+1, k) * combination(K-1, k-1) % m)


Fixed submission:
S = input()
if all([S.count(x) == 2 for x in set(S)]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(set(A))[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

Fixed submission:
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(A)[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

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

A = [0]*N

for r in range(N):
  A[r] = int(input())
Elias_A = copy.copy(A)
A.sort()
Sorted_A = copy.copy(A)
  
for r in range(N):
  if N >= 3:
    if A[r] == Sorted_A[N-1]: print(A[r])
    elif A[r] == Sorted_A[N-2]: print(A[r])
    elif A[r] == sorted_A[N-3]: print(A[r])
    else:
      A.remove(Elias_A[r])
      print(A[N-2])
      A = copy.copy(Sorted_A)
  else:
    A.remove(Elias_A[r])
    print(A[N-2])
    A = copy.copy(Sorted_A)

Fixed submission:
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(A)[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())

A = [0]*N

for r in range(N):
  A[r] = int(input())
Elias_A = copy.copy(A)
A.sort()
Sorted_A = copy.copy(A)
  
for r in range(N):
  A.remove(Elias_A[r])
  print(A[N-2])
  A = copy.copy(Sorted_A)

Fixed submission:
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(A)[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())

A = [0]*N

for r in range(N):
  A[r] = int(input())
Elias_A = copy.copy(A)
A.sort()
Sorted_A = copy.copy(A)

  
for r in range(N):
  A.remove(Elias_A[r])
  print(A[N-2])
  A = copy.copy(Sorted_A)

Fixed submission:
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(A)[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())

A = [0]*N

for r in range(N):
  A[r] = int(input())
  
B = copy.copy(A)
  
for r in range(N):
  A.pop(r)
  print(max(A))
  A = copy.copy(B)

Fixed submission:
N = int(input())
A = [0]*N

for r in range(N): A[r] = int(input())
A_max = max(A)
A_sec = sorted(A)[-2]

for r in range(N):
  if A[r] == A_max: print(A_sec)
  elif A[r] == A_sec: print(A_max)
  else: print(A_max)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

C = [0] * N
D = [0] * (N + 1)
for a in A:
    C[a-1] += 1
    D[C[a-1]] += 1

S = [0] * (N + 1)
for i in range(N):
    S[i+1] = S[i] + D[i+1]

for K in range(1,N+1):
    l = 0
    r = N + 1
    while(r-l>1):
        m = int((l+r)/2)
        if S[m] >= K * m:
            l = m
        else:
            r = m
    print(l)

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

C = [0] * N
D = [0] * (N + 1)
for a in A:
    C[a - 1] += 1
    D[C[a - 1]] += 1

S = [0] * (N + 1)
for i in range(N):
    S[i + 1] = S[i] + D[i + 1]

ans = N
for K in range(1, N + 1):
    while ans > 0 and S[ans] < K * ans:
        ans -= 1
    print(ans)
Buggy python submission (verdict: Runtime Error):
  input=input()
  
  weather={"Sunny":0,"Cloudy":1,"Rainy":2}
  output={0:"Sunny",1:"Cloudy",2:"Rainy"}
  s=weather[input]+1
  if s>=3:
           s=s-3
           print(output[s])
　else:
		　　print(output[s])

Fixed submission:
input=input()
weather={"Sunny":0,"Cloudy":1,"Rainy":2}
output={0:"Sunny",1:"Cloudy",2:"Rainy"}
s=weather[input]+1
if s>=3:
	s=s-3
	print(output[s])
else:
	print(output[s])
Buggy python submission (verdict: Runtime Error):
input=list(input())
if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
　print("Bad")
else:
 print("Good")

Fixed submission:
input=list(input())


if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
	 print("Bad")
else:
	print("Good")

Buggy python submission (verdict: Runtime Error):
 input=list(input())
  
 if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
          print("Bad")
 else:
          print("Good")

Fixed submission:
input=list(input())


if int(input[0])==int(input[1]) or int(input[1])==int(input[2]) or int(input[2])==int(input[3]):
	 print("Bad")
else:
	print("Good")
Buggy python submission (verdict: Runtime Error):
S = str(input())
K = int(input())

L = len(S)
rtn = 0
las = False

if (L == 1):
    rtn = K // 2

else:
    ichi = 0
    mae = S[0]
    i = 1
    while(i < L):
        las = False
        if (S[i] == mae):
            ichi += 1
            i += 1
            las = True
        if (i < L):
            mae = S[i]
        i += 1

    if (las and (i == L+1)): #らすかえた
        rtn = ichi * K

    else: #らすかえてない
        ni = 0
        mae = S[L-1]
        i = 0
        while(i < L):
            las = False
            if (S[i] == mae):
                ni += 1
                i += 1
                las = True
            mae = S[i]
            i += 1

        if (las and (i == L+1)): #らすかえた
            T = K // 2
            rtn = ichi * (K - T) + ni * T
        else:
            rtn = ichi + ni * (K - 1)

print(rtn)

Fixed submission:
S = str(input())
K = int(input())

L = len(S)
rtn = 0
las = False

if (L == 1):
    rtn = K // 2

else:
    ichi = 0
    mae = S[0]
    i = 1
    while(i < L):
        las = False
        if (S[i] == mae):
            ichi += 1
            i += 1
            las = True
        if (i < L):
            mae = S[i]
        i += 1

    if (las and (i == L+1)): #らすかえた
        rtn = ichi * K

    else: #らすかえてない
        ni = 0
        mae = S[L-1]
        i = 0
        while(i < L):
            las = False
            if (S[i] == mae):
                ni += 1
                i += 1
                las = True
            if (i < L):
                mae = S[i]
            i += 1

        if (las and (i == L+1)): #らすかえた
            T = K // 2
            rtn = ichi * (K - T) + ni * T
        else:
            rtn = ichi + ni * (K - 1)

print(rtn)
Buggy python submission (verdict: Runtime Error):
#整数＋リスト
w, h, x, y = list(map(int, input().split()))


xxx = x
yyy = y
if (x/w > y/h):
    xxx = y
    yyy = x
    
############
#print(xxx,yyy)

a = xxx*h
b = yyy*w
c = w*w*(h-yyy)/(w-xxx)/2

mmm = w*h

if (a > mmm/2):
    a = mmm - a

if (b > mmm/2):
    b = mmm - b

if (c > mmm/2):
    c = mmm - c

#############
#print(a,b,c)

rtn = max(a,b,c)
f = -1
if (a == rtn):
    f += 1
if (b == rtn):
    f += 1
if (c == rtn):
    f += 1
if (f == 2):
    f = 1

print('{0:.6f}'.format(rtn), f)


Fixed submission:
#整数＋リスト
w, h, x, y = list(map(int, input().split()))

f = 0
if ((x*2 == w) and (y*2 == h)):
    f = 1

print(w*h/2,f)
Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())

retn = 0

loop = True
while(loop):

    x = s.find("BC")
    if (x == -1):
        break

    if (x != 0):
        bb = s.rfind("B",0,x)
        cc = s.rfind("C",0,x)

        if (cc > bb):
            bb = cc
        retn += x - bb - 1
        s = "A" * (x - bb - 1) + s[x+2:]
    else:
        s = s[x+2:]

print(retn)

Fixed submission:
s = str(input())
s = s.replace("BC","X")

retn = 0
cnt = 0

for i in range(len(s)):

    if (s[i] == "A"):
        cnt += 1
    elif (s[i] == "X"):
        retn += cnt
    else:
        cnt = 0

print(retn)