Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

A, B, C = map(int, read().split())

if A == B == C:
    if A % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        A, B, C = (B + C) / 2, (A + C) / 2, (A + B) / 2
        if max([A, B, C]) - min([A, B, C]) == 1:
            break

        cnt += 1

    print(cnt)


Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

A, B, C = map(int, read().split())

if A == B == C:
    if A % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        if (A % 2 + B % 2 + C % 2) >= 1:
            break
        cnt += 1
        A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2

    print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

A, B, C = map(int, read().split())

if A == B == C:
    if A % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        A, B, C = (B + C) / 2, (A + C) / 2, (A + B) / 2
        cnt += 1

        if max([A % 2, B % 2, C % 2]) == 1:
            break

    print(cnt)


Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

A, B, C = map(int, read().split())

if A == B == C:
    if A % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    cnt = 0
    while True:
        if (A % 2 + B % 2 + C % 2) >= 1:
            break
        cnt += 1
        A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2

    print(cnt)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, *A =  map(int, read().split())

A = sorted(A)
A = A[N:-N]

print(sum(A))


Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, *A = map(int, read().split())

A = sorted(A)[::-1]
A = A[1:-N:2]

print(sum(A))
Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())

m = map(int, read().split())
A, B = zip(*zip(m, m))
A = np.array(A[::-1])
B = np.array(B[::-1])

cnt = 0
for i in range(N):
    while A[i] % B[i] != 0:
        A[i:] += 1
        cnt += 1

print(cnt)


Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())

m = map(int, read().split())
A, B = zip(*zip(m, m))
A = np.array(A[::-1])
B = np.array(B[::-1])

cnt = 0
for i in range(N):
    acc = B[i] - A[i] % B[i] if A[i] % B[i] != 0 else 0
    A[i:] += acc
    cnt += acc

print(cnt)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

A, B, C = map(int, readline().split())

if (A % 2 == 0) or (B % 2 == 0) or (C % 2 == 0):
    print(0)
else:
    tmp = [A, B, C]
    tmp = sorted(tmp)
    print(tmp[0] * tmp[1])


Fixed submission:
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

A, B, C = map(int, readline().split())

if (A % 2 == 0) or (B % 2 == 0) or (C % 2 == 0):
    print(0)
else:
    tmp = [A, B, C]
    tmp = sorted(tmp)
    print(tmp[0] * tmp[1])
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

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

for c in list(combinations(A, 2)):
    tmp = 1
    for e in c:
        tmp *= e
    ans += tmp % (10**9 + 7)

print(ans % (10**9 + 7))

Fixed submission:
import sys

input = sys.stdin.readline

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

A_sum_s = sum(A) ** 2

for e in A:
    A_sum_s -= e ** 2
print(A_sum_s // 2 % (10**9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
scores = list(map(int, input().split()))

ns = list()
first = 1
for i in range(K):
    first *= scores[i]
ns.append(first)
for i in range(0, N-K):
    ns.append(ns[i] * scores[i+K] // scores[i])
    if ns[i] < ns[i+1]:
        print('Yes')
    else:
        print('No')

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

for i in range(K, N):
    if scores[i] > scores[i-K]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
scores = list(map(int, input().split()))

ns = list()
c = 0

for i in range(K-1, N):
    tmp = 1
    for j in range(i-K+1, i+1):
        tmp *= scores[j]
    ns.append(tmp)
    if c >= 1 and ns[c-1] < ns[c]:
        print('Yes')
    elif c >= 1 and ns[c-1] >= ns[c]:
        print('No')
    c += 1
    

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

for i in range(K, N):
    if scores[i] > scores[i-K]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())

d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for _ in range(n):
    s = str(input())
    d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))

Fixed submission:
pay = int(input())

print(0 if pay % 1000 == 0 and pay != 0 else 1000 - (pay % 1000))
Buggy python submission (verdict: Runtime Error):
n = int(input())

d = {}

for _ in range(n):
    s = str(input())
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))

Fixed submission:
n = int(input())

d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for _ in range(n):
    s = str(input())
    d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))
Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())

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

a_, b_ = [0], [0]

for i in range(n):
    a_.append(a_[i] + a[i])
for j in range(m):
    b_.append(b_[j] + b[j])

ans = 0
j = m

for i in range(n+1):
    
    if a_[i] > k:
        break
    while b_[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

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

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])

ans, j = 0, m

for i in range(n + 1):
    if a_[i] > k:
        break
    while b_[j] > k - a_[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

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

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

a_, b_ = [0], [0]

for i in range(n):
    a_.append(a_[i] + a[i])
for j in range(m):
    b_.append(b_[j] + b[j])

ans = 0
for i in range(n+1):
    
    idx2 = m
    while a_[i] + b_[idx2] > k:
        idx2 -= 1
    
    ans = max(ans, i + idx2)
print(ans)

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

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])

ans, j = 0, m

for i in range(n + 1):
    if a_[i] > k:
        break
    while b_[j] > k - a_[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_, b_ = [0], [0]

for i in range(n):
    a_.append(a_[i] + a[i])
for i in range(n):
    b_.append(b_[i] + b[i])

ans, j = 0, m - 1

for i in range(n + 1):
    if a_[i] > k:
        break
    while b_[j] > k - a_[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

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

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])

ans, j = 0, m

for i in range(n + 1):
    if a_[i] > k:
        break
    while b_[j] > k - a_[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0

for i in range(1, n+1):
    for j in range(1, n // i + 1):
        ans += i * j
print(ans)

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

for i in range(1, n + 1):
    y = n // i
    ans += y * (y+1) * i // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1, n + 1):
    ans += int(n // i) * int(n // i + 1) * i // 2
print(ans)

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

for i in range(1, n + 1):
    y = n // i
    ans += y * (y+1) * i // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0

for j in range(1, n + 1):
    for i in range(1, int(n // j) +1):
        ans += j * i
print(ans)

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

for i in range(1, n + 1):
    y = n // i
    ans += y * (y+1) * i // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0

for j in range(1, n+1):
    if j == 1:
        ans += 1
    else:
        dnum = 2
        s = int(j ** 0.5)
        for i in range(2, s+1):
            if j % i == 0:
                if i == j // i:
                    dnum += 1
                else:
                    dnum += 2
        ans += j * dnum
print(ans)

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

for i in range(1, n + 1):
    y = n // i
    ans += y * (y+1) * i // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    for j in range(len(a)):
        if a[j] == b:
            a[j] = c
    print(sum(a))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
nums = [0] * (10 ** 5 + 1)
for i in a:
    nums[i] += 1
nsum = sum(a)
for _ in range(q):
    b, c = map(int, map(int, input().split()))
    nsum = nsum + (c - b) * nums[b]
    print(nsum)
    nums[c] += nums[b]
    nums[b] = 0
Buggy python submission (verdict: Runtime Error):
D,T,S=map(int,input().split())
if D/S <= T:
    print("Yes")
else:
    prnit("No")


Fixed submission:
D,T,S=map(int,input().split())
if D/S <= T:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = [int(x) for x in input().split()]
S=[]
for i in range(N):
    s=sum(A[i+1:])*A[i]
    S.append(s)
print(sum(S)%(10**9+7))
        


Fixed submission:
N=int(input())
A = [int(x) for x in input().split()]
s=sum(A)
x=0
for i in range(N):
    s=s-A[i]
    x+=s*A[i]    
print(x%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = [int(x) for x in input().split()]
S=[]
for i in range(N):
    for j in range(i+1,N):
        s=A[i]*A[j]
        S.append(s)
print(sum(S)%(10**9+7))
        


Fixed submission:
N=int(input())
A = [int(x) for x in input().split()]
s=sum(A)
x=0
for i in range(N):
    s=s-A[i]
    x+=s*A[i]    
print(x%(10**9+7))
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%1000==0:
print(0)
else
print(N%1000)


Fixed submission:
N = int(input())
if N%1000==0:
    print(0)
else:
    print(1000-N%1000)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
A,B = input().split()
b = Decimal(B)
print(int(A*b))


Fixed submission:
from decimal import Decimal
A,B = input().split()
b = Decimal(B)
print(int(int(A)*b))

Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int, input().split())
c = A*B
print(math.floor(c))


Fixed submission:
from decimal import Decimal
A,B = input().split()
b = Decimal(B)
print(int(int(A)*b))
Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int, input().split())
a = 360*H/12+30*M/60
b = 360*M/60
c = abs(a-b)
if c < 90:
    sin(c) = math.sin(math.radians(c))
    cos(c) = math.sin(math.radians(c))
    d = B-A*cos(c)
    e = (d**2+(A*sin(c))**2)**0.5
    print(e)
elif c == 90:
    e = (A**2+B**2)**0.5
    print(e)
elif c > 90:
    sin(c) = math.sin(math.radians(180-c))
    cos(c) = math.sin(math.radians(180-c))
    d = B+A*cos(c)
    e = (d**2+(A*sin(c)**2)**0.5
    print(e)

Fixed submission:
import math
A,B,H,M = map(int, input().split())
a = 360*H/12+30*M/60
b = 360*M/60
c = abs(a-b)
d = A**2+B**2-2*A*B*math.cos(math.radians(c))
print(math.sqrt(d))
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and k*i <= B:
        p = 1
        break
if p == 1:
    print("OK")
else:
    print("NG")
    


Fixed submission:
K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and K*i <= B:
        p = 1
        break
if p == 1:
    print("OK")
else:
    print("NG")

Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and k*i <= B:
        p = 1
        break
if p = 1:
    print("OK")
else:
    print("NG")
    


Fixed submission:
K = int(input())
A,B = map(int, input().split())
p = 0
for i in range(1000):
    if A <= K*i and K*i <= B:
        p = 1
        break
if p == 1:
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N = map(int, input().split())

x = 0
for i in range(N+1):
    D = math.floor(x/B)
    if D != 0:
        break
    x += 1
print(math.floor(A*(x-1)/B)-math.floor((x-1)/B)*A)
    


Fixed submission:
import math
A,B,N = map(int, input().split())
if (B-1)<=N:
    print(math.floor(A*(B-1)/B)-math.floor((B-1)/B)*A)
else:
    print(math.floor(A*N/B)-math.floor(N/B)*A)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N = map(int, input().split())
d = [0]
x = 0
for i in range(N+1):
    C = math.floor(A*x/B)
    D = math.floor(x/B)
    if D != 0:
        break
    ans = C-A*D
    d.append(ans)
    x += 1
print(max(d))
    


Fixed submission:
import math
A,B,N = map(int, input().split())
if (B-1)<=N:
    print(math.floor(A*(B-1)/B)-math.floor((B-1)/B)*A)
else:
    print(math.floor(A*N/B)-math.floor(N/B)*A)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N = map(int, input().split())
d = []
x = 0
for i in range(N+1):
    C = math.floor(A*x/B)
    D = math.floor(x/B)
    ans = C-A*D
    d.append(ans)
    x += 1
print(max(d))
    


Fixed submission:
import math
A,B,N = map(int, input().split())
if (B-1)<=N:
    print(math.floor(A*(B-1)/B)-math.floor((B-1)/B)*A)
else:
    print(math.floor(A*N/B)-math.floor(N/B)*A)
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
a = [list(input() for i in range(n))]
b = collections.Counter(a)
print(len(b))


Fixed submission:
import collections

n = int(input())
a = [input() for i in range(n)]
b = collections.Counter(a)
print(len(b))
Buggy python submission (verdict: Runtime Error):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index()] = 0
if al[0] + al[1] + al[2] == 0 or al[3] + al[4] + al[5] == 0 or al[6] + al[7] + al[8] == 0 or al[0] + al[3] + al[6] == 0 or al[1] + al[4] + al[7] == 0 or al[2] + al[5] + al[8] == 0 or al[0] + al[4] + al[8] == 0 or al[2] + al[4] + al[6] == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index(b)] = 0
if al[0] + al[1] + al[2] == 0 or al[3] + al[4] + al[5] == 0 or al[6] + al[7] + al[8] == 0 or al[0] + al[3] + al[6] == 0 or al[1] + al[4] + al[7] == 0 or al[2] + al[5] + al[8] == 0 or al[0] + al[4] + al[8] == 0 or al[2] + al[4] + al[6] == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index()] = 0
if a1[0] + a1[1] + a1[2] == 0 or a2[0] + a2[1] + a2[2] == 0 or a3[0] + a3[1] + a3[2] == 0 or a1[0] + a2[0] + a3[0] == 0 or a1[1] + a2[1] + a3[1] == 0 or a1[2] + a2[2] + a3[2] == 0 or a1[0] + a2[1] + a3[2] == 0 or a1[2] + a2[1] + a3[0] == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index(b)] = 0
if al[0] + al[1] + al[2] == 0 or al[3] + al[4] + al[5] == 0 or al[6] + al[7] + al[8] == 0 or al[0] + al[3] + al[6] == 0 or al[1] + al[4] + al[7] == 0 or al[2] + al[5] + al[8] == 0 or al[0] + al[4] + al[8] == 0 or al[2] + al[4] + al[6] == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
for i in range(0, 10**n):
    if len(str(i)) == n and all(str(i)[s-1] == str(c) for j in sc):
        print(i)
        break
else:
    print(-1)

Fixed submission:
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
for i in range(0, 10**n):
    if len(str(i)) == n and all(str(i)[s-1] == str(c) for s,c in sc):
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
N,R = map(int, input().split())
if N >= 10:
    k = R
    print(k)
else:
    k = 100*(10-N)+R
    orint(k)

Fixed submission:
N,R = map(int, input().split())
if N >= 10:
    k = R
    print(k)
else:
    k = 100*(10-N)+R
    print(k)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
s = []
for i in range(1,101):
    b = sum((a[j]-i-1)**2 for j in range(N))
    s.append(b) 
print(min(b))


Fixed submission:
N = int(input())
a = list(map(int,input().split()))
s = []
for i in range(1,101):
    b = sum((a[j]-i)**2 for j in range(N))
    s.append(b) 
print(min(s))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
dic = {}
b = []
for i in range(n):
    a = input()
    b.append(a)
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
M = max(dic.values())
for j, k in sorted(dic.items):
    if k == M:
        print(j)


Fixed submission:

n = int(input())
dic = {}
b = []
for i in range(n):
    a = input()
    b.append(a)
for o in b:
    if o in dic:
        dic[o] += 1
    else:
        dic[o] = 1
M = max(dic.values())
for j,k in sorted(dic.items()):
    if k == M:
        print(j)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
dic = {}
b = []
for i in range(n):
    a = input()
    b.append(a)
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1

for j, k in sorted(dic.items):
    if k == max(dic):
        print(j)


Fixed submission:

n = int(input())
dic = {}
b = []
for i in range(n):
    a = input()
    b.append(a)
for o in b:
    if o in dic:
        dic[o] += 1
    else:
        dic[o] = 1
M = max(dic.values())
for j,k in sorted(dic.items()):
    if k == M:
        print(j)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]
d = []
p = 0
for i in range(N):
    if A[i] in d:
        p = 1
        break
    d.append(A[i])
if p == 0:
    print("YES")
else:
    print("NO")


Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
A.sort()
p = 0
for i in range(N-1):
    if A[i] == A[i+1]:
        p = 1
        break
if p == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
A = [(1+int(x))/2 for x in input().split()]
wa = []
w = 0
for i in range(0,K):
    w = w+A[i]
wa.append(w)
for j in range(N-k):
    w = w + wa[j+K] - wa[j]
    wa.append(w)
print(max(wa))

Fixed submission:
N,K = map(int, input().split())
A = [(1+int(x))/2 for x in input().split()]
wa = []
w = 0
for i in range(0,K):
    w = w+A[i]
wa.append(w)
for j in range(N-K):
    w = w + A[j+K] - A[j]
    wa.append(w)
print(max(wa))
Buggy python submission (verdict: Runtime Error):
S,T = list(map(int, input().split()))
print(T+S)


Fixed submission:
S,T = map(str, input().split())
print(T+S)

Buggy python submission (verdict: Runtime Error):
S,T = list(map(int, input().split()))
print(T+S)


Fixed submission:
S,T = map(str, input().split())
print(T+S)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split(" ")
s = 1
for i in range(N):
  s = s*int(A[i])


if s > 10**18:
  print(-1)
else:
  print(s)

Fixed submission:
N = int(input())
A = input().split(" ")
s = 1

for i in range(N):
  if int(A[i]) == 0:
    s = 0

for i in range(N):
  if s ==0:
    break
  if s > 10**18:
    break
  s = s*int(A[i])


if s > 10**18:
  print(-1)
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
import math
q = input().split(" ")
A = int(q[0])
B = q[1].split(".")
b0 = B[0]
b1 = B[1]
if b1[0]=="0":
  b1 = b1[1]


print(A*int(b0) + math.floor(((A*int(b1))/100)

Fixed submission:
q = input().split(" ")
A = int(q[0])
B = q[1].split(".")
#print(B)
b0 = B[0]
b1 = B[1]
if b1[0]=="0":
  b1 = b1[1]

s = str(A*int(b1)//100)
#print(s)
print(A*int(b0) + int(s))
Buggy python submission (verdict: Runtime Error):
import math

N = input().split(" ")
A = int(N[0])
B = int(N[1])
H = int(N[2])
M = int(N[3])

naga = (30 * H) + (M / 2)
mizi = 6 * M

if naga < mizi:
  deg = mizi - naga
elif naga > mizi:
  deg = naga - mizi
if deg > 180:
  deg = 360 - deg

s = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(deg)))

s = s**(1/2)
print('{:.20f}'.format(s))

Fixed submission:
import math

N = input().split(" ")
A = int(N[0])
B = int(N[1])
H = int(N[2])
M = int(N[3])

naga = (30 * H) + (M / 2)
mizi = 6 * M

if naga < mizi:
  deg = mizi - naga
elif naga >= mizi:
  deg = naga - mizi
if deg >= 180:
  deg = 360 - deg

s = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(deg)))

s = s**(1/2)
print('{:.20f}'.format(s))