Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

c = sum([1 for i in r[:-1] if i != 0])
t = r[-1]

if c == 0:
    print(1, t)
else:
    print(c, c+t)

Fixed submission:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), ans + c[8])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if sum([1 for i in r[:-1] if i != 0]) == 0:
    print(1, r[-1])

else:
    mi = sum([1 for i in r[:-1] if i != 0])
    ma = mi + r[-1]
    print(mi, ma)

Fixed submission:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), ans + c[8])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if sum([1 for i in r[:-1] if i != 0]) == 0:
    print(1, n)
else:
    mi = sum([1 for i in r[:-1] if i != 0])
    print(mi, mi+r[-1])

Fixed submission:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), ans + c[8])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if sum([1 for i in r[:-1] if i != 0]) == 0:
    print(1, min(8, n))
else:
    mi = sum([1 for i in r[:-1] if i != 0])
    res = 8 - mi
    if res == 0:
        print(mi, mi)
    else:
        if res > r[-1]:
            print(mi, mi+r[-1])
        else:
            print(mi, mi+res)

Fixed submission:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), ans + c[8])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
r = [0] * 9
for i in a:
    r[i//400] += 1

if r[-1] == 0:
    cnt = sum([1 for i in r[:-1] if i != 0])
    print(cnt, cnt)
else:
    cnt = sum([1 for i in r[:-1] if i != 0])
    res = 8 - cnt
    print(max(cnt, 1), cnt+min(res, r[-1]))

Fixed submission:
from bisect import bisect_right

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

r = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
c = [0] * 9

for score in a:
	i = bisect_right(r, score)
	c[i] += 1

ans = 8 - c[:-1].count(0)

print(max(1, ans), ans + c[8])
Buggy python submission (verdict: Runtime Error):
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] s = new int[n];
		int sum = 0;
		for (int i = 0; i<n; i++) {
			s[i] = sc.nextInt();
			sum += s[i];
			}
		Arrays.sort(s);

		if (sum%10 != 0) {System.out.println(sum);}
		else {
			for (int i=0; i<n;i++) {
				if (s[i]%10!=0) {
					System.out.println(sum-s[i]);
					return;
				}
			}
		}
		System.out.println(0);


	}
}

Fixed submission:
n = int(input())
s = sorted([int(input()) for i in range(n)])

ans = sum(s)

if ans % 10 != 0:
    print(ans)
    exit()
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(ans-s[i])
            exit()

    print(0)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
d = dict()

for _ in range(m):
  a, b = map(int,input().split())
  d[a] = d.get(a, 0) + 1
  d[b] = d.get(b, 0) + 1

for i in range(1, n+1):
  print(d[i])

Fixed submission:
n, m = map(int, input().split())
c  = [0] * n

for _ in range(m):
  a, b = map(int, input().split())
  c[a-1] += 1
  c[b-1] += 1

for r in c:
  print(r)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
ab = [input().split() for i in range(n)]

ans = ""

for i in ab:
  ans += i[0] * int(i[1])

print(ans[k])

Fixed submission:
n, k = map(int,input().split())
ab = []
for i in range(n):
  (a, b) = map(int, input().split())
  ab.append((a, b))

ab = sorted(ab, key=lambda k:k[0])

b = 0

for i in ab:
  b += i[1]
  if b >= k:
    print(i[0])
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c = map(int, input().split())
ab = abs(a-b)
bc = abs(b-c)

if a == b == c:
  if a % 2 == 0:
    print(-1)
  else:
    print(0)

count = 0

while True:
  if ab % 2 != 0 or bc % 2 != 0:
    break
  else:
    ab = ab // 2
    bc = bc // 2
    count += 1

print(count)

Fixed submission:
a, b, c = map(int, input().split())
ab = abs(a-b)
bc = abs(b-c)

if a == b == c:
  if a % 2 == 0:
    print(-1)
    exit()
  else:
    print(0)
    exit()

count = 0

while True:
  if ab % 2 != 0 or bc % 2 != 0:
    break
  else:
    ab = ab // 2
    bc = bc // 2
    count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])

bus = []
ans = 0

while len(t) != 0:
	temp = t.pop(0)
	if len(bus) == 0:
		bus.append(temp)
	else:
		if temp < bus[0] + k:
			bus.append(temp)
			if len(bus) == c:
				ans += 1
				bus = []
		else:
			ans += 1
			bus = []

print(ans+1)

Fixed submission:
n, c, k = map(int,input().split())
t = sorted([int(input()) for _ in range(n)])

ans = 0
bus = []

for i in range(n):
	if len(bus) == c:
		ans += 1
		bus = [t[i]]
	elif bus != [] and bus[0] + k < t[i]:
		ans += 1
		bus = [t[i]]
	else:
		bus.append(t[i])

print(ans+1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(range(1, n+1))
mod = (10 ** 9) + 7

x = 1

for i in p:
    x *= i

print(x%mod)

Fixed submission:
n = int(input())

def power(n):
  ans = 1
  for i in range(1, n+1):
    ans = ans * i % (10**9+7) 
  return ans

print(power(n))
Buggy python submission (verdict: Runtime Error):
if c < 2 * s:
  print(c // 2)
else:
  c -= 2 * s
  print(s + c // 4)

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

if c < 2 * s:
  print(c // 2)
else:
  c -= 2 * s
  print(s + c // 4)
Buggy python submission (verdict: Runtime Error):
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)

Fixed submission:
s = input()

while True:
  for i, n in enumerate(s):
    if n == "A":
      inda = i
      break
  break

while True:
  for i, n in enumerate(s[::-1]):
    if n == "Z":
      indz = i
      break
  break

indz = len(s) - indz - 1
print(indz - inda + 1)

Buggy python submission (verdict: Runtime Error):
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)

Fixed submission:
s = input()

while True:
  for i, n in enumerate(s):
    if n == "A":
      inda = i
      break
  break

while True:
  for i, n in enumerate(s[::-1]):
    if n == "Z":
      indz = i
      break
  break

indz = len(s) - indz - 1
print(indz - inda + 1)

Buggy python submission (verdict: Runtime Error):
for i in range(n):
    if s[i] == "A":
        ind_a = i
        break

for i in range(n):
    if s[i] == "Z":
        ind_z = i

print(ind_z - ind_a + 1)

Fixed submission:
s = input()

while True:
  for i, n in enumerate(s):
    if n == "A":
      inda = i
      break
  break

while True:
  for i, n in enumerate(s[::-1]):
    if n == "Z":
      indz = i
      break
  break

indz = len(s) - indz - 1
print(indz - inda + 1)
Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())

ans = 0

for x in range(k+1):
  if x > s:
    break
  for y in range(k+1):
    if sum(x, y) > s:
      break
    for z in range(k+1):
      if sum(x, y, z) > s:
        break
      if sum(x, y, z) == s:
        ans += 1

print(ans)

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

ans = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z <= k:
      ans += 1

print(ans)

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

ans = 0

for x in range(k+1):
  if x > s:
    break
  for y in range(k+1):
    if x + y > s:
      break
    for z in range(k+1):
      if x + y + z > s:
        break
      if x+y+z == s:
        ans += 1

print(ans)

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

ans = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z <= k:
      ans += 1

print(ans)

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

ans = 0

for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z == s:
        ans += 1

print(ans)

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

ans = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z <= k:
      ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()

left = 0
right = 0

count = 0
while True:
  if s[right+1] != s[left]:
    count += 1
    right += 1
    left = right
    if right == len(s) - 1:
      break
  else:
    right += 1
    if right == len(s) - 1:
      break

print(count)

Fixed submission:
s = input()

if len(s) == 1:
  print(0)
  exit()

left = 0
right = 0

count = 0
while True:
  if s[right+1] != s[left]:
    count += 1
    right += 1
    left = right
    if right == len(s) - 1:
      break
  else:
    right += 1
    if right == len(s) - 1:
      break

print(count)
Buggy python submission (verdict: Runtime Error):

import numpy as np

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

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')

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

if (N%2 == 0):
    ans = 0.5
else:
    ans = (N+1)/2/N

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]

for i in range(N-1):
    ans.append(0)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')

Buggy python submission (verdict: Runtime Error):

import numpy as np

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

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), sep=' ', end=' ')

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]

for i in range(N-1):
    ans.append(0)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')

Buggy python submission (verdict: Runtime Error):

Created on Sun Sep 29 22:57:46 2019

@author: hiros
"""
import numpy as np

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

ans = np.zeros(N)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), sep=' ', end=' ')

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]

for i in range(N-1):
    ans.append(0)

for i in range(N):
    ans[A[i]-1] = i+1

for i in range(N):
    print(int(ans[i]), end=' ')
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

import numpy as np

def canbe_solved(positions):
    flg = np.dot(positions[0],np.ones(2,int))%2
    for p in positions:
        flg ^= (np.dot(p,np.ones(2,int)) %2 )
        if flg:
            return False
    return True

def solutions(p,vals):
    u = np.dot(p, np.array([1,1]))
    v = np.dot(p, np.array([1,-1]))
    for val in vals:
        if u >=0:
            if v >= 0:
                print('R',end="")
                u -= val
                v -= val
            else:
                print('U',end="")
                u -= val
                v += val
        else:
            if v >= 0:
                print('D',end="")
                u += val
                v -= val
            else:
                print('L',end="")
                u += val
                v += val
    print()
    
    
def main():
    #input
    n = int(input().rstrip())
    positions = [np.asarray(list(map(int,input().rstrip().split()))) for _ in range(n)]
    vals = [1<<i for i in range(30,-1,-1)]
    if np.dot(positions[0], np.ones(2,int)) % 2 == 0:
        vals.append(1)

    if canbe_solved(positions):
        print(len(vals))
        for i,p in enumerate(vals):
            print(p,end="")
            if i == len(vals)-1:
                print('')
        else:
            print(' ', end="")

        for p in positions:
            solutions(p,vals)
    else:
        print('-1')
        
main()

    

Fixed submission:
import collections

arr_length = int(input().rstrip())
arr = list(map(int,input().rstrip().split()))

arr_odd = arr[0::2]
arr_even = arr[1::2]

def count_strange(arr):
    c = collections.Counter(arr)
    keys, vals = zip(*c.most_common())
    return keys, vals

def proc(arr1, arr2):
    keys1, vals1 = count_strange(arr1)
    keys2, vals2 = count_strange(arr2)
    
    if keys1[0] == keys2[0]:
        if len(keys1) == 1 and len(keys2) == 1:
            print(vals1[0])# n = even number
        elif len(keys1) == 1 and len(keys2) > 1:
            print(len(arr2)-vals2[1])
        elif len(keys1) > 1 and len(keys2) == 1:
            print(len(arr1)-vals1[1])
        else: #>1
            print(
                min(
                    len(arr1)-vals1[1] + len(arr2)-vals2[0],
                    len(arr1)-vals1[0] + len(arr2)-vals2[1]
                    )
                    )
    else:
        print(len(arr1)-vals1[0] + len(arr2)-vals2[0])
    
proc(arr_odd, arr_even)
Buggy python submission (verdict: Runtime Error):
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]
seconds = set(seconds)

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
def lcm(a,b):
    g = gcd(a,b)
    if a > b:
        return int(a/g*b)
    else:
        return int(a*b/g)
ans = 1
for num in seconds:
    ans = lcm(ans,num)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
n = int(input().rstrip())
seconds = [int(input().rstrip()) for _ in range(n)]
#seconds = list(set(seconds))

def gcd(a,b):
    if int(b) == 0:
        return int(a)
    return gcd((b),(a%b))
def lcm(a,b):
    g = gcd(a,b)
    if a<b:
        return int(a/g)*b
    else:
        return int(b/g)*a

ans = 1
for num in seconds:
    ans = int(lcm(ans,num))
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


S=input()
K=input()


if(len(K)>=S):
    print(K[0:S]+"...")

else:
    print(K)


Fixed submission:
# -*- coding: utf-8 -*-


S=int(input())
K=input()


if(len(K)>S):
    print(K[0:S]+"...")

else:
    print(K)
Buggy python submission (verdict: Time Limit Exceeded):
A, B,C,D=map(int,input().split())

while(True):
    C=C-B
    if(C==0):
        print("Yes")
        break
    A=A-D
    if(A==0):
        print("No")
        break


Fixed submission:
a,b,c,d = (int(x) for x in input().split())
 
while(True):
    c-=b
    if(c <= 0):
        print("Yes")
        break
    a-=d
    if(a <= 0):
        print("No")
        break
Buggy python submission (verdict: Time Limit Exceeded):
q, n = map(int, input().split())
s = input()
lr = [[int(i) for i in input().split()] for i in range(n)]

# s = 'ACACTACG'
# lr = [
#     [3, 7],
#     [2, 3],
#     [1, 8],
# ]

wa = []
for index, val in enumerate(s):
    if "AC" == s[index - 1:index + 1]:
        wa.append(1)
    else:
        wa.append(0)

for row in lr:
    start = row[0]
    end = row[1]

    sss = sum(wa[start:end])
    print(sss)


Fixed submission:
q, n = map(int, input().split())
s = input()
lr = [[int(i) for i in input().split()] for i in range(n)]

# s = 'ACACTACG'
# lr = [
#     [3, 7],
#     [2, 3],
#     [1, 8],
# ]

wa = [0]

for index in range(1, len(s)):

    if s[index - 1] == 'A' and s[index] == 'C':
        wa.append(wa[index - 1] + 1)
    else:
        wa.append(wa[index - 1])

for row in lr:
    start = row[0] - 1
    end = row[1] - 1

    diff = wa[end] - wa[start]
    print(diff)

Buggy python submission (verdict: Time Limit Exceeded):
q, n = map(int, input().split())
s = input()
lr = [[int(i) for i in input().split()] for i in range(n)]

# lr = [
#     [3, 7],
#     [2, 3],
#     [1, 8],
# ]

for row in lr:
    cnt = s.count('AC', row[0] - 1, row[1])
    print(cnt)


Fixed submission:
q, n = map(int, input().split())
s = input()
lr = [[int(i) for i in input().split()] for i in range(n)]

# s = 'ACACTACG'
# lr = [
#     [3, 7],
#     [2, 3],
#     [1, 8],
# ]

wa = [0]

for index in range(1, len(s)):

    if s[index - 1] == 'A' and s[index] == 'C':
        wa.append(wa[index - 1] + 1)
    else:
        wa.append(wa[index - 1])

for row in lr:
    start = row[0] - 1
    end = row[1] - 1

    diff = wa[end] - wa[start]
    print(diff)
Buggy python submission (verdict: Runtime Error):
# S = '0011'
# S = '11011010001011'
# S = '0'
S = input()

cnt = 0


def www(s):
    global cnt

    if len(s) <= 1:
        return

    index = 0
    tmp = []
    c = 0

    while True:
        if len(s) < index + 1:
            break
        if s[index] == '0' and s[index + 1] == '1':
            index += 1
            c += 2
        else:
            tmp.append(S[index])
        index += 1
    cnt += c

    if 0 < c:
        www(tmp)


www(S)
print(cnt)


Fixed submission:
# S = '0011'
# S = '11011010001011'
# S = '0'
S = input()

red = 0
blue = 0

for i in S:
    if i == '0':
        red += 1
    else:
        blue += 1

print(min(red,blue) * 2)
Buggy python submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
if (a % 10 == 3):
   print('bon')
elif (a % 10 == 0) or (a % 10 == 1) or (a % 10 == 6) or (a % 10 == 8):
   print('pon')
else:
   print('hon')

Fixed submission:
import sys
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
if a % 10 == 3:
   print('bon')
elif a % 10 == 0 or a % 10 == 1 or a % 10 == 6 or a % 10 == 8:
   print('pon')
else:
   print('hon')
Buggy python submission (verdict: Runtime Error):
import sys
#a = []
#for l in sys.stdin:
#    a.append(int(l))
k = input()
s = input()
if len(s) <= len(k):
   print(s)
else:
   print(k)
   while i in range(len(k)-len(s)):
      print('.')

Fixed submission:
import sys
#a = []
#for l in sys.stdin:
#    a.append(int(l))
k = int(input())
s = input()
if len(s) <= k:
   print(s)
else:
   for i in range(k):
      print(s[i], end="")
   for i in range(3):
      print('.', end="")
Buggy python submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h = int(input())
m = int(input())

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))

Fixed submission:
import sys
import math

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

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))

Buggy python submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h = int(input())
m = int(input())

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.pow(result,0.5))

Fixed submission:
import sys
import math

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

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))

Buggy python submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h = int(input())
m = int(input())

kak1 = 0 if h == 0 else h * 30
kak2 = 0 if m == 0 else m * 6
#print(kak1,kak2)

kaku = kak1 -kak2
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.pow(result,0.5))

Fixed submission:
import sys
import math

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

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))

Buggy python submission (verdict: Runtime Error):
import sys
import math
#a = []
#for l in sys.stdin:
#    a.append(int(l))
a = int(input())
b = int(input())
h= int(input())
m = int(input())

kak1 = 0 if h == 0 else 360 / h
kak2 = 0 if m == 0 else 360/m

kaku = abs(kak1 -kak2)
result = a * a + b * b - 2 * a * b * math.cos(kaku)

Fixed submission:
import sys
import math

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

kak1 = float(h * 30 + m * 0.5)
kak2 = m * 6

kaku = kak1 -kak2 if kak1 < kak2 else kak2 - kak1
result = a * a + b * b - 2 * a * b * math.cos(kaku * math.pi / 180)
print(math.sqrt(result))
Buggy python submission (verdict: Runtime Error):
N = input()
n1 = N % 10

if n1 in (2,4,5,7,9):
  print('hon')
elif n1 in (0,1,6,8):
  print('pon')
else:
  print('bon')


Fixed submission:
N = input()
num = int(N) % 10

if num in (2,4,5,7,9):
  print('hon')
elif num in (0,1,6,8):
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
N = input() % 10

if N in (2,4,5,7,9):
  print('hon')
elif N in (0,1,6,8):
  print('pon')
else:
  print('bon')


Fixed submission:
N = input()
num = int(N) % 10

if num in (2,4,5,7,9):
  print('hon')
elif num in (0,1,6,8):
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,a,b,c,d = f()
    s = input()

    has_2_consecu = 0
    for i in range(a+1, max(c,d)-1):
        if s[i]=='#' and s[i+1] == '#':
            has_2_consecu = 1
            break



    if has_2_consecu:
        print('No')
        return

    if d>c:
        print('Yes')
        return
    else:
        has_3_consecu = 0
        for i in range(b+1, d):
            if s[i]=='.' and s[i+1] == '.' and s[i+2]=='.':
                has_3_consecu = 1
                break
        
        if has_3_consecu:
            print('Yes')
            return
    
    print('No')




solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,a,b,c,d = f()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = input()

    has_2_consecu = 0
    for i in range(a+1, max(c,d)-1):
        if s[i]=='#' and s[i+1] == '#':
            has_2_consecu = 1
            break



    if has_2_consecu:
        print('No')
        return

    if d>c:
        print('Yes')
        return
    else:
        has_3_consecu = 0
        for i in range(b-1, d):
            if s[i]=='.' and s[i+1] == '.' and s[i+2]=='.':
                has_3_consecu = 1
                break
        
        if has_3_consecu:
            print('Yes')
            return
        
        if a+1 == b and s[b+1] == '.':
            print('Yes')
            return
    
    print('No')




solve()