Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
zero_flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
for a in A:
    if a == 0:
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = -1
if flag == 1 and result != 0:
    print(-1)
else:
    print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
zero_flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
result = 1
for a in A:
    result = result * a
    if result > pow(10, 18):
        result = -1
else:
    print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
zero_flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
result = 1
for a in A:
    result = result * a
if result > pow(10,18):
    print(-1)
else:
    print (result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
zero_flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)
Buggy python submission (verdict: Runtime Error):
import numpy
n = int(input())
a = [int(x) for x in input().split()]
MOD = 10**9 +7
x = numpy.array(a)
result = ((x.sum()**2 - x.dot(x)) // 2)%MOD
        
print(result)
# print(s%MOD)

Fixed submission:
def findProductSum(A, n): 
      
    # calculating array sum (a1 + a2 ... + an) 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum += A[i]
  
    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = (array_sum * array_sum )
  
    # calcualting a1^2 + a2^2 + ... + an^2 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += (A[i] * A[i]) 
  
    # required sum is (array_sum_square - 
    # individual_square_sum) / 2 
    return (array_sum_square - individual_square_sum) // 2 
n = int(input())
a = [int(x) for x in input().split()]
MOD = 10**9 +7

print(int(findProductSum(a,n))%MOD)

# print(s%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]
MOD = 10**9 +7
s = 0
for i in range(n):
    for j in range(i + 1, n):
        s += (a[i]%MOD * a[j]%MOD)%MOD
print(s%MOD)

Fixed submission:
def findProductSum(A, n): 
      
    # calculating array sum (a1 + a2 ... + an) 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum += A[i]
  
    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = (array_sum * array_sum )
  
    # calcualting a1^2 + a2^2 + ... + an^2 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += (A[i] * A[i]) 
  
    # required sum is (array_sum_square - 
    # individual_square_sum) / 2 
    return (array_sum_square - individual_square_sum) // 2 
n = int(input())
a = [int(x) for x in input().split()]
MOD = 10**9 +7

print(int(findProductSum(a,n))%MOD)

# print(s%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]
MOD = 10**9 +7
s = 0
for i in range(n):
    for j in range(i + 1, n):
        s += (a[i]%MOD * a[j]%MOD)%MOD
print(s%MOD)

Fixed submission:
def findProductSum(A, n): 
      
    # calculating array sum (a1 + a2 ... + an) 
    array_sum = 0
    for i in range(0, n, 1): 
        array_sum += A[i]
  
    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = (array_sum * array_sum )
  
    # calcualting a1^2 + a2^2 + ... + an^2 
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += (A[i] * A[i]) 
  
    # required sum is (array_sum_square - 
    # individual_square_sum) / 2 
    return (array_sum_square - individual_square_sum) // 2 
n = int(input())
a = [int(x) for x in input().split()]
MOD = 10**9 +7

print(int(findProductSum(a,n))%MOD)

# print(s%MOD)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

s = [0] * (n + 1)
s[-1] = 1
for _ in range(m):
    a = int(input())
    s[a] = None

if s[0] is None and s[1] is None:
    print(0)
    exit()

for i in range(n - 1, -1, -1):
    if s[i] is None:
        continue
    if i + 1 < len(s) and s[i + 1] is not None:
        s[i] += s[i + 1]
    if i + 2 < len(s) and s[i + 2] is not None:
        s[i] += s[i + 2]

print(s[0] % 1_000_000_007)


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

s = [0] * (n + 1)
s[-1] = 1
for _ in range(m):
    a = int(input())
    s[a] = None

if s[0] is None and s[1] is None:
    print(0)
    exit()

for i in range(n - 1, -1, -1):
    if s[i] is None:
        continue
    if i + 1 < len(s) and s[i + 1] is not None:
        s[i] += s[i + 1]
    if i + 2 < len(s) and s[i + 2] is not None:
        s[i] += s[i + 2]

print(s[0] % 1000000007)
Buggy python submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input()))
C = list(map(int, input()))

ans = 0
for v, c in zip(V, C):
  vr = v - c
  if vr >= 0:
    ans += vr

print(ans)


Fixed submission:
input()
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for v, c in zip(V, C):
    vr = v - c
    if vr >= 0:
        ans += vr

print(ans)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)


Fixed submission:
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)


Fixed submission:
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    g = gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)


Fixed submission:
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

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

sumOtoshidama = 0
for _ in range(N):
    amountStr, unit = input().split()
    amount = int(amountStr)
    if unit == "BTC":
        amount *= 380000
    sumOtoshidama += amount

print(sumOtoshidama)

Fixed submission:
N = int(input())

sumOtoshidama = 0
for _ in range(N):
    amountStr, unit = input().split()
    amount = float(amountStr)
    if unit == "BTC":
        amount *= 380000
    sumOtoshidama += amount

print(sumOtoshidama)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

N = int(input())

even = collections.defaultdict(lambda: 0)
odd = collections.defaultdict(lambda: 0)

for i, a in enumerate(map(int, input().split())):
    if i % 2 == 0:
        even[a] += 1
    else:
        odd[a] += 1

if len(even.keys()) == 1 and len(odd.keys()) == 1 and list(even.keys())[0] == list(odd.keys())[0]:
    print(N // 2)
else:
    m = 0
    for e_k, e_v in even.items():
        for o_k, o_v in odd.items():
            if e_k == o_k:
                continue
            m = max(m, e_v + o_v)

    print(N - m)


Fixed submission:
import collections

N = int(input())

even = collections.defaultdict(lambda: 0)
odd = collections.defaultdict(lambda: 0)

for i, a in enumerate(map(int, input().split())):
    if i % 2 == 0:
        even[a] += 1
    else:
        odd[a] += 1

if len(even.keys()) == 1 and len(odd.keys()) == 1 and list(even.keys())[0] == list(odd.keys())[0]:
    print(N // 2)
else:
    m = 0
    for e_k, e_v in sorted(even.items(), key=lambda x: x[1], reverse=True)[:2]:
        for o_k, o_v in sorted(odd.items(), key=lambda x: x[1], reverse=True)[:2]:
            if e_k == o_k:
                continue
            m = max(m, e_v + o_v)

    print(N - m)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(lambda x: 1 if x == "W" else 0, input()))

N -= 1

min_turn = min(N - sum(S[1:]), sum(S[:N - 2]))
for i in range(1, N - 1):
    to_east = sum(S[:i])
    to_west = N - i - sum(S[i + 1:])
    min_turn = min(to_east + to_west, min_turn)

print(min_turn)


Fixed submission:
N = int(input())
S = input()

# import random
# N = 3 * 10 ** 5
# S = "".join(["WE"[random.randint(0, 1)] for _ in range(N)])

to_east = 0
to_west = S[1:].count("E")

min_turn = to_east + to_west
for i in range(1, N):
    if min_turn == 0:
        break
    if S[i - 1] == "W":
        to_east += 1
    if S[i] == "E":
        to_west -= 1
    min_turn = min(to_east + to_west, min_turn)

print(min_turn)

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

min_turn = N + 1
for i in range(N + 1):
    min_turn = min(S[:i].count("W") + S[i:].count("E"), min_turn)

print(min_turn)


Fixed submission:
N = int(input())
S = input()

# import random
# N = 3 * 10 ** 5
# S = "".join(["WE"[random.randint(0, 1)] for _ in range(N)])

to_east = 0
to_west = S[1:].count("E")

min_turn = to_east + to_west
for i in range(1, N):
    if min_turn == 0:
        break
    if S[i - 1] == "W":
        to_east += 1
    if S[i] == "E":
        to_west -= 1
    min_turn = min(to_east + to_west, min_turn)

print(min_turn)
Buggy python submission (verdict: Runtime Error):
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)


Fixed submission:
import math

x = int(input())

ans = 1
for b in range(2, int(math.sqrt(x)) + 1):
  for p in range(1, int(math.sqrt(x)) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
	else:
      break
      
print(ans)


Fixed submission:
import math

x = int(input())

ans = 1
for b in range(2, int(math.sqrt(x)) + 1):
  for p in range(1, int(math.sqrt(x)) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
K = int(input())

substr_set = set()

for i in range(0, len(s)):
    for slen in range(0, len(s) - i):
        substring = s[i:i + slen + 1]
        substr_set.add(substring)

print(sorted(substr_set)[K - 1])


Fixed submission:
s = input()
K = int(input())

substr_set = set()

for i in range(0, len(s)):
    for slen in range(0, K):
        substring = s[i:i + slen + 1]
        substr_set.add(substring)

print(sorted(substr_set)[K - 1])
Buggy python submission (verdict: Runtime Error):
N = int(input())

U = map(int, input())
for i in range(1, N):
    U[i] += U[i-1]

D = map(int, input())
for i in range(N-2, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)

Fixed submission:
N = int(input())

U = list(map(int, input().split()))
for i in range(1, N):
    U[i] += U[i-1]

D = list(map(int, input().split()))
for i in range(N-2, -1, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)

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

U = [int(input())]
for i in range(1, N):
    U.append(int(input())+U[-1])

D = map(int, input())
for i in range(N-2, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)

Fixed submission:
N = int(input())

U = list(map(int, input().split()))
for i in range(1, N):
    U[i] += U[i-1]

D = list(map(int, input().split()))
for i in range(N-2, -1, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
n = int(a + b)

if math.sqrt(n) ** 2 == n:
    print("Yes")
else:
    print("No")



Fixed submission:
import math

a, b = input().split()
n = int(a + b)

if math.floor(math.sqrt(n)) ** 2 == n:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math

a, b = input().split()
n = int(a + b)

if sqrt(n) ** 2 == n:
    print("Yes")
else:
    print("No")


Fixed submission:
import math

a, b = input().split()
n = int(a + b)

if math.floor(math.sqrt(n)) ** 2 == n:
    print("Yes")
else:
    print("No")

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

if sqrt(n) ** 2 == n:
    print("Yes")
else:
    print("No")



Fixed submission:
import math

a, b = input().split()
n = int(a + b)

if math.floor(math.sqrt(n)) ** 2 == n:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
words = ("dream", "erase", "eraser", "dreamer")

s = input()

while len(s) > 0:
    match = False
    for w in words:
        if s.endwith(w):
            s = s[:-len(w)]
            match = True
            break
    if match is False:
        print("NO")
        exit()
print("YES")


Fixed submission:
words = ("dream", "erase", "eraser", "dreamer")

s = input()

while len(s) > 0:
    match = False
    for w in words:
        if s.endswith(w):
            s = s[:-len(w)]
            match = True
            break
    if match is False:
        print("NO")
        exit()
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
words = ("dreamer", "eraser", "dream", "erase")

s = input()

pos = 0
while pos < len(s):
    for w in words:
        if s.startswith(w, pos):
            pos += len(w)
            break
if pos == len(s):
    print("YES")
else:
    print("NO")


Fixed submission:
words = ("dream", "erase", "eraser", "dreamer")

s = input()

while len(s) > 0:
    match = False
    for w in words:
        if s.endswith(w):
            s = s[:-len(w)]
            match = True
            break
    if match is False:
        print("NO")
        exit()
print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
import re
words = (re.compile("^dreamer"), re.compile("^eraser"), re.compile("^dream"), re.compile("^erase"))

s = input()

while s != "":
    for w in words:
        if w.match(s) is not None:
            s = w.sub("", s)
            break
    if s == "":
        print("YES")
        exit()
print("NO")


Fixed submission:
words = ("dream", "erase", "eraser", "dreamer")

s = input()

while len(s) > 0:
    match = False
    for w in words:
        if s.endswith(w):
            s = s[:-len(w)]
            match = True
            break
    if match is False:
        print("NO")
        exit()
print("YES")
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
colect_quest = [0]*N
WA_quest = [0]*N
for i in range(M):
    pi,si = list(map(str,input().split()))
    pi = int(pi)
    if si == "AC":
        colect_quest[pi] = 1
    if si == "WA" and colect_quest[pi] != 1:
        WA_quest[pi] += 1
    
print(sum(colect_quest),sum(WA_quest))

Fixed submission:
N,M = list(map(int,input().split()))
colect_quest = [0]*N
WA_quest = [0]*N
for i in range(M):
    pi,si = list(map(str,input().split()))
    pi = int(pi)
    if si == "AC":
        colect_quest[pi-1] = 1
    if si == "WA" and colect_quest[pi-1] != 1:
        WA_quest[pi-1] += 1
WA_count = 0
for i in range(len(WA_quest)):
    if colect_quest[i] == 1 :
        WA_count += WA_quest[i] 
print(sum(colect_quest),WA_count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

data = input().split()

data = [int(s) for s in data]

num = 0
ans = 0

for i in range(N) :
  num += data[i]
  ans += (sum(data) - num) * data[i]

print(ans % 1000000007)

Fixed submission:
N = int(input())

data = input().split()

data = [int(s) for s in data]

num = 0
ans = 0
sum = sum(data)

for i in range(N) :
  num += data[i]
  ans += (sum - num) * data[i]

print(ans % 1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

sum = 0

while N >= 1 :
    sum += N % 10
    N = N // 10
    if(sum > 100) :
      sum = sum % 9

if(sum % 9 == 0) :
    print("Yes")
else :
    print("No")


Fixed submission:
N = int(input())

if N % 9 == 0 :
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
X, K, D = map(int, input().split())

i = 0
nokori = 0

if X > 0 :
    while X > 0 and i < K:
        X -= D
        i += 1
    
    nokori = K - i
    if nokori % 2 == 1 :
        X += D

else :
    while X <= 0 and i < K:
        X += D
        i += 1
    nokori = K - i
    if nokori % 2 == 1 :
        X -= D

print(abs(X))

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

X = abs(X)
aa = X // D

if K < aa :
    X -= K * D
else :
    if (K - aa) % 2 == 1 :
        X -= (aa+1) * D
    else :
        X -= aa * D

print(abs(X))

Buggy python submission (verdict: Time Limit Exceeded):
X, K, D = map(int, input().split())

for i in range(K) :
    if X > 0 :
        X -= D
    else :
        X += D

print(abs(X))

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

X = abs(X)
aa = X // D

if K < aa :
    X -= K * D
else :
    if (K - aa) % 2 == 1 :
        X -= (aa+1) * D
    else :
        X -= aa * D

print(abs(X))
Buggy python submission (verdict: Runtime Error):
point = int(input())

if 400 <= point <=599 :
    print("8")
elif 600<= point <= 799 :
    print("7")
elif 800 <= point <= 999 :
    print("6")
elif 1000 <= point <= 1199 :
    print("5")
elif 1200 <= point <= 1399 :
    print("4")
elif 1400 <= point <= 1599 :
    print("3")
elif 1600 <= point <= 1799 :
    prin("2")
elif 1800 <= point <= 1999 :
    print("1")

Fixed submission:
point = int(input())

if 400 <= point <=599 :
    print("8")
elif 600<= point <= 799 :
    print("7")
elif 800 <= point <= 999 :
    print("6")
elif 1000 <= point <= 1199 :
    print("5")
elif 1200 <= point <= 1399 :
    print("4")
elif 1400 <= point <= 1599 :
    print("3")
elif 1600 <= point <= 1799 :
    print("2")
elif 1800 <= point <= 1999 :
    print("1")
Buggy python submission (verdict: Time Limit Exceeded):
semester, K = map(int, input().split())

score = input().split()

result1 = 1
result2 = 1

for i in range(semester - K + 1) :
    if i == 0 :
        for j in range(K) :
            result1 = result1 * int(score[K - 1 - j])
        continue
    
    result2 = result1 // int(score[K - K + i - 1]) * int(score[K - 1 + i])
    

    if result1 < result2 :
        print("Yes")
    else :
        print("No")

    result1 = result2
    result2 = 1




Fixed submission:
semester, K = map(int, input().split())

score = input().split()

for i in range(semester - K + 1) :
    if i == 0 :
        continue    

    if int(score[K - K + i - 1]) < int(score[K - 1 + i]) :
        print("Yes")
    else :
        print("No")

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

score = input().split()

result1 = 1
result2 = 1

for i in range(semester - K + 1) :
    if i == 0 :
        for j in range(K) :
            result1 = result1 * int(score[K - 1 - j])
        loopCount = K
        continue
    
    result2 = result1 / int(score[K - loopCount]) * int(score[K - 1 + i])
    result2 = int(result2)
    loopCount -= 1

    if result1 < result2 :
        print("Yes")
    else :
        print("No")
    
    result1 = result2
    result2 = 1




Fixed submission:
semester, K = map(int, input().split())

score = input().split()

for i in range(semester - K + 1) :
    if i == 0 :
        continue    

    if int(score[K - K + i - 1]) < int(score[K - 1 + i]) :
        print("Yes")
    else :
        print("No")

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

score = input().split()

result1 = 1
result2 = 1

for i in range(semester - K + 1) :
    if i == 0 :
        for j in range(K) :
            result1 = result1 * int(score[K - 1 - j])
        continue
    
    for l in range(K) :
        result2 = result2 * int(score[K - l - 1 + i])
    
    if result1 < result2 :
        print("Yes")
    else :
        print("No")
 
    result1 = result2
    result2 = 1


Fixed submission:
semester, K = map(int, input().split())

score = input().split()

for i in range(semester - K + 1) :
    if i == 0 :
        continue    

    if int(score[K - K + i - 1]) < int(score[K - 1 + i]) :
        print("Yes")
    else :
        print("No")
Buggy python submission (verdict: Runtime Error):
hamkei = input()
print(int(hankei)**2)

Fixed submission:
hankei = input()
print(int(hankei)**2)