Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(input())

arr = [0 for _ in range(N)]
idx = 0
pre = '1'
if S[0] == '0':
    idx += 1
    arr[0] = 0
    pre = '0'

for i in range(N):
    if pre == S[i]:
        arr[idx] += 1
    else:
        idx += 1
        arr[idx] += 1
    pre = S[i]

max_lensum = 0
for i in range(0, idx+1, 2):
    #print("arr", arr)
    #print("arr", arr[i:min(i+2*K+1, idx+1)])
    lensum = sum(arr[i:min(i+2*K+1, idx+1)])
    if lensum > max_lensum:
        max_lensum = lensum
    if i+2*K+1 > idx: break
print(max_lensum)

Fixed submission:
S = input()
cnt = 0
s = S[0]
for i in range(1, len(S)):
    si = int(S[i])
    #print(s, si)
    if int(s) == int(si):
        #print("hit")
        s = 1 - si
        cnt += 1
    else:
        s = si

# reverse first
cnt2 = 1
s = 1 - int(S[0])
for i in range(1, len(S)):
    si = int(S[i])
    #print(s, si)
    if int(s) == int(si):
        #print("hit")
        s = 1 - si
        cnt2 += 1
    else:
        s = si

#print(cnt, cnt2)
print(min(cnt, cnt2))
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for _ in range(Q)]

for lr in LR:
    l, r = lr[0], lr[1]
    s = S[l-1: r]
    i = 0
    I = len(s)
    cnt = 0
    while i < len(s) - 1 :
        if s[i] == "A" and s[i + 1] == "C":
            cnt += 1
            i += 2
        else:
            i += 1
    #cnt = s.count("AC")
    print(cnt)

Fixed submission:
N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for _ in range(Q)]

t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = LR[i][0], LR[i][1]
    cnt = t[r - 1] - t[l -1]
    print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for _ in range(Q)]

for lr in LR:
    l, r = lr[0], lr[1]
    s = S[l-1: r]
    i = s.count("AC")
    print(i)

Fixed submission:
N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for _ in range(Q)]

t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = LR[i][0], LR[i][1]
    cnt = t[r - 1] - t[l -1]
    print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())

"""
max_keta = len(str(bin(B)))-2
ans_str = [0] * max_keta
for x in range(A, B + 1):
    a = format(x, '0%db' % max_keta)
    #print(x, a)
    for i in range(len(a)):
        ans_str[i] += int(a[i])
    #print(ans_str)

j = 1
ans = 0
for aa in reversed(ans_str):
    ans += (int(aa) % 2) * j
    j *= 2
#print(a)
"""

ans = 0
for x in range(A, B+1):
    ans ^= x
print(ans)

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


def f(x):
    if x % 2 == 1:
        return x ^ ((x//2) % 2) ^ (x-1)
    else:
        return x ^ ((x//2) % 2)


ans = f(A-1) ^ f(B)
print(ans)

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

max_keta = len(str(bin(B)))-2
ans_str = [0] * max_keta
for x in range(A, B + 1):
    a = format(x, '0%db' % max_keta)
    #print(x, a)
    for i in range(len(a)):
        ans_str[i] += int(a[i])
    #print(ans_str)

j = 1
ans = 0
for aa in reversed(ans_str):
    ans += (int(aa) % 2) * j
    j *= 2
#print(a)
print(ans)

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


def f(x):
    if x % 2 == 1:
        return x ^ ((x//2) % 2) ^ (x-1)
    else:
        return x ^ ((x//2) % 2)


ans = f(A-1) ^ f(B)
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()

def is_keyence(S):
    keyence_str = "keyence"
    i = 0
    is_change = False
    change_num = 0
    for j in range(len(S)):
        if S[j] != keyence_str[i]:
            if is_change: change_num += 1
            else:
                if change_num > 0:
                    return False
                is_change = True
                change_num += 1
        else:
            if is_change: is_change = False
            i += 1
    if i == len(keyence_str):
        return True
    else: return False


if is_keyence(S):
    print("YES")
else:
    print("NO")

Fixed submission:
S = input()

def is_keyence(S):
    key = "keyence"
    for i in range(len(key)):
        #print(key[:i], key[i:])
        if (S.startswith(key[:i]) and S.endswith(key[i:])):
            return True
    return False


if is_keyence(S):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
S = input()

def is_keyence(S):
    keyence_str = "keyence"
    i = 0
    is_change = False
    change_num = 0
    for j in range(len(S)):
        print(i, j, S[j],keyence_str[i])
        if S[j] != keyence_str[i]:
            if is_change: change_num += 1
            else:
                if change_num > 0:
                    # 二回以上修正箇所がある
                    return False
                is_change = True
                change_num += 1
        else:
            if is_change: is_change = False
            i += 1
    if i == len(keyence_str):
        return True
    else: return False


if is_keyence(S):
    print("YES")
else:
    print("NO")

Fixed submission:
S = input()

def is_keyence(S):
    key = "keyence"
    for i in range(len(key)):
        #print(key[:i], key[i:])
        if (S.startswith(key[:i]) and S.endswith(key[i:])):
            return True
    return False


if is_keyence(S):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
S = input()

keyence_str = "keyence"

def is_keyence(S):
    i = 0
    is_change = False
    change_num = 0
    for j in range(len(S)):
        print(i, j, S[j],keyence_str[i])
        if S[j] != keyence_str[i]:
            if is_change: change_num += 1
            else:
                if change_num > 0:
                    # 二回以上修正箇所がある
                    return False
                is_change = True
                change_num += 1
        else:
            if is_change: is_change = False
            i += 1
    if i == len(keyence_str):
        return True
    else: return False


if is_keyence(S):
    print("YES")
else:
    print("NO")

Fixed submission:
S = input()

def is_keyence(S):
    key = "keyence"
    for i in range(len(key)):
        #print(key[:i], key[i:])
        if (S.startswith(key[:i]) and S.endswith(key[i:])):
            return True
    return False


if is_keyence(S):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

PY_list = defaultdict(list)
for i in range(len(PY)):
    PY_list[PY[i][0]].append([i, PY[i][1]])
#print(PY_list)

for pyl in PY_list.values():
    #print(pyl)
    pyl.sort(key = lambda x: x[1])
#print(N, M, PY)
#print(PY_list)
#print(PY[0][0])
for i in range(len(PY)):
    n = PY_list[PY[i][0]].index([i, PY[i][1]])
    print("{:06d}{:06d}".format(PY[i][0], n + 1))

Fixed submission:
from collections import defaultdict
N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

PY_list = defaultdict(list)
for i in range(len(PY)):
    PY_list[PY[i][0]].append([i, PY[i][1]])
#print(PY_list)

py_opt = dict()
for pyl in PY_list.values():
    pyl.sort(key = lambda x: x[1])
    for i in range(len(pyl)):
        #print(i)
        py_opt[pyl[i][0]] = i

#print(py_opt)
#print(PY_list)
for i in range(len(PY)):
    #n = PY_list[PY[i][0]].index([i, PY[i][1]])
    n = py_opt[i]
    print("{:06d}{:06d}".format(PY[i][0], n + 1))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())


def make_divisor_list(num, N):

    if num < 1:
        return 0
    elif num == 1:
        return 1
    else:
        max_num = 1
        for i in range(2, num // N + 1):
            if num % i == 0:
                # 割り切れる=約数
                if num / i >= N:
                    max_num = i
                else:
                    break
        return max_num

print(make_divisor_list(M, N))

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

def make_divisor_list(num, N):

    if num < 1:
        return 0
    elif num == 1:
        return 1
    else:
        max_num = 1
        for i in reversed(range(2, num // N + 1)):
            if num % i == 0:
                # 割り切れる=約数
                if num / i >= N:
                    max_num = i
                    break
                #else:
                #    break
        return max_num

print(make_divisor_list(M, N))

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


def make_divisor_list(num, N):

    if num < 1:
        return 0
    elif num == 1:
        return 1
    else:
        max_num = 1
        for i in range(2, num // N + 1):
            if num % i == 0:
                # 割り切れる=約数
                if num / i >= N:
                    max_num = i
        return max_num

print(make_divisor_list(M, N))

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

def make_divisor_list(num, N):

    if num < 1:
        return 0
    elif num == 1:
        return 1
    else:
        max_num = 1
        for i in reversed(range(2, num // N + 1)):
            if num % i == 0:
                # 割り切れる=約数
                if num / i >= N:
                    max_num = i
                    break
                #else:
                #    break
        return max_num

print(make_divisor_list(M, N))
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
import sys
n = int(input())
v = list(map(int, input().split()))

dd_even = defaultdict(int)
dd_odd  = defaultdict(int)

# 偶数番目のヒストグラムを作る
for i in range(0, n, 2):
    dd_even[v[i]] += 1

l_even = list(dd_even.items())
l_even.sort(key= lambda x:x[1])
top_even = l_even[-1][0]
#print(l_even)

# 奇数番目のヒストグラムを作る
for i in range(1, n, 2):
    dd_odd[v[i]] += 1

l_odd = list(dd_odd.items())
l_odd.sort(key= lambda x:x[1])
#print(l_odd)
top_odd = l_odd[-1][0]

if top_even == top_odd:
    if len(l_odd) == 1: # つまり全部同じ数字のとき
        res = int(n / 2)
        print(res)
        sys.exit()
    else:
        # 2パターン試す
        l_odd_1 = [l for l in l_odd if l[0] != l_odd[-2][0]]
        sum_odd_1 = sum(l[1] for l in l_odd_1)
        l_even_1 = [l for l in l_even if l[0] != top_even]
        sum_even_1 = sum(l[1] for l in l_even1)
        sum_1 = sum_odd_1 + sum_even_1

        l_odd_2 = [l for l in l_odd if l[0] != top_odd]
        sum_odd_2 = sum(l[1] for l in l_odd_2)
        l_even_2 = [l for l in l_even if l[0] != l_even[-2][0]]
        sum_even_1 = sum(l[1] for l in l_even_2)
        sum_2 = sum_odd_2 + sum_even_2
        
        if sum1 < sum2:
            print(sum1)
        else:
            print(sum2)
        sys.exit()
else:
    l_odd = [l for l in l_odd if l[0] != top_odd]

sum_odd = sum(l[1] for l in l_odd)
#print(l_odd, sum_odd)

l_even = [l for l in l_even if l[0] != top_even]
sum_even = sum(l[1] for l in l_even)
#print(l_even, sum_even)

res = sum_odd + sum_even
print(res)

Fixed submission:
from collections import defaultdict
import sys
n = int(input())
v = list(map(int, input().split()))

dd_even = defaultdict(int)
dd_odd  = defaultdict(int)

# 偶数番目のヒストグラムを作る
for i in range(0, n, 2):
    dd_even[v[i]] += 1

l_even = list(dd_even.items())
l_even.sort(key= lambda x:x[1])
top_even = l_even[-1][0]
#print(l_even)

# 奇数番目のヒストグラムを作る
for i in range(1, n, 2):
    dd_odd[v[i]] += 1

l_odd = list(dd_odd.items())
l_odd.sort(key= lambda x:x[1])
#print(l_odd)
top_odd = l_odd[-1][0]

if top_even == top_odd:
    if len(l_odd) == 1: # つまり全部同じ数字のとき
        res = int(n / 2)
        print(res)
        sys.exit()
    else:
        # 2パターン試す
        l_odd_1 = [l for l in l_odd if l[0] != l_odd[-2][0]]
        sum_odd_1 = sum(l[1] for l in l_odd_1)
        l_even_1 = [l for l in l_even if l[0] != top_even]
        sum_even_1 = sum(l[1] for l in l_even_1)
        sum_1 = sum_odd_1 + sum_even_1

        l_odd_2 = [l for l in l_odd if l[0] != top_odd]
        sum_odd_2 = sum(l[1] for l in l_odd_2)
        l_even_2 = [l for l in l_even if l[0] != l_even[-2][0]]
        sum_even_2 = sum(l[1] for l in l_even_2)
        sum_2 = sum_odd_2 + sum_even_2

        if sum_1 < sum_2:
            print(sum_1)
        else:
            print(sum_2)
        sys.exit()
else:
    l_odd = [l for l in l_odd if l[0] != top_odd]

sum_odd = sum(l[1] for l in l_odd)
#print(l_odd, sum_odd)

l_even = [l for l in l_even if l[0] != top_even]
sum_even = sum(l[1] for l in l_even)
#print(l_even, sum_even)

res = sum_odd + sum_even
print(res)
Buggy python submission (verdict: Runtime Error):
import math
N, X = map(int, input().split())
x = list(map(int, input().split()))

xx = [abs(xxx - X) for xxx in x]

l = xx[0]
if len(xx) > 1:
    for i in xx[1:]:
        l = math.gcd(l, i)


print(l)

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

xx = [abs(xxx - X) for xxx in x]

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

l = xx[0]
if len(xx) > 1:
    for i in xx[1:]:
        l = gcd(l, i)


print(l)

Buggy python submission (verdict: Runtime Error):
import math
N, X = map(int, input().split())
x = list(map(int, input().split()))

xx = [abs(xxx - X) for xxx in x]

l = xx[0]
for i in xx[1:]:
    l = math.gcd(l, i)


print(l)

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

xx = [abs(xxx - X) for xxx in x]

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

l = xx[0]
if len(xx) > 1:
    for i in xx[1:]:
        l = gcd(l, i)


print(l)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

min_ans = pow(10,15)
for b in reversed(range(-max(A), 0)):
    ans = 0
    for i in range(len(A)):
        #print(A[i], b, i, abs(A[i] - (b + i + 1)))
        ans += abs(A[i] - (b + i + 1))
    #print("ans", b, ans)
    if min_ans >= ans: min_ans = ans
    else: break


min_ans_b = pow(10,15)
for b in range(0, max(A)):
    ans = 0
    for i in range(len(A)):
        ans += abs(A[i] - (b + i + 1))
    #print("ans", b, ans)
    if min_ans_b >= ans: min_ans_b = ans
    else: break


if min_ans_b < min_ans:
    min_ans = min_ans_b

print(min_ans)

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

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

A = sorted(A)
b = A[N//2]
sad = 0
for i in A:
    sad += abs(i - b)

print(sad)

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

min_ans = pow(10,15)
for b in range(-max(A), max(A)):
    ans = 0
    for i in range(len(A)):
        #print(A[i], b, i, abs(A[i] - (b + i + 1)))
        ans += abs(A[i] - (b + i + 1))
    #print("ans", b, ans)
    if min_ans >= ans: min_ans = ans
    else: break


"""min_ans_b = pow(10,15)
for b in range(0, max(A)):
    ans = 0
    for i in range(len(A)):
        ans += abs(A[i] - (b + i + 1))
    #print("ans", b, ans)
    if min_ans_b >= ans: min_ans_b = ans
    else: break


if min_ans_b < min_ans:
    min_ans = min_ans_b
"""
print(min_ans)

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

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

A = sorted(A)
b = A[N//2]
sad = 0
for i in A:
    sad += abs(i - b)

print(sad)

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

min_ans = 100000000
for b in range(-max(A), max(A)):
    ans = 0
    for i in range(len(A)):
        #print(A[i], b, i, abs(A[i] - (b + i + 1)))
        ans += abs(A[i] - (b + i + 1))
    #print("ans", b, ans)
    if min_ans >= ans: min_ans = ans
    #else: break

"""b = -1
min_ans_b = 10000000
while True:
    ans = 0
    for i in range(len(A)):
        #print(A[i], b, i, abs(A[i] - (b + i + 1)))
        ans += abs(A[i] - (b + i + 1))
    #print("ans", b, ans)
    if min_ans_b >= ans: min_ans_b = ans
    else: break
    b -= 1


if min_ans_b < min_ans:
    min_ans = min_ans_b
"""
print(min_ans)

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

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

A = sorted(A)
b = A[N//2]
sad = 0
for i in A:
    sad += abs(i - b)

print(sad)
Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
nl=list(map(int, input().split(" ")))

for i in range(n):
 if nl[i]%2==0 :
　　if  nl[i]%6!=0 or nl[i]%10!=0:
          print("DENIED")
           sys.exit()
 

print("APPROVED")


Fixed submission:
import sys
n=int(input())
nl=list(map(int, input().split(" ")))

for i in range(n):
 if nl[i]%2==0:
  #print(nl[i]%6,nl[i]%10)
  if nl[i]%6 !=0 and nl[i]%10!=0:
   print("DENIED")
   sys.exit()
print("APPROVED")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
#N=int(input())
A, B=input().split()
A=int(A)
B=int(B)
print(int((A*B)/math.gcd(A, B)))


Fixed submission:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)
i=0
#N=int(input())
A, B=input().split()
A=int(A)
B=int(B)
print(lcm(A, B))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
N=int(input())
#N, L=input().split()
#S=input()
#T=input()
#S_list=list(S)
a_list=  list(map(int, input().split(" ")))
j=0
times=0
for i in range(N):
# print(i,j,times, a_list)

 if a_list[j]==j+1:
     j=j+1
     if j==len(a_list):
         print(times)
         sys.exit()

 #if a_list[i]==i+1:
 #i=j
 #print(i, a_list)
 #if i+1==len(a_list):
#    print(times)
#    sys.exit()
 if a_list[j]!=j+1:
     a_list.pop(j)
     #j=i
     #i=j
     times+=1
     if len(a_list)==0:
      print(-1)
      sys.exit()
     #elif j+1==len(a_list):
     #print(times)
    #     sys.exit()

#     elif
print(times)


Fixed submission:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
N=int(input())
#N, L=input().split()
#S=input()
#T=input()
#S_list=list(S)
a_list=  list(map(int, input().split(" ")))
j=0
times=0

for i  in range(N):
    if a_list[i]==i-times+1:
       pass
    else:
       times=times+1

if times==len(a_list):
    print(-1)
    sys.exit()
print(times)



#for i in range(N):
# print(i,j,times, a_list)

 #if a_list[j]==j+1:
#     j=j+1
#     if j==len(a_list):
#         print(times)
#         sys.exit()

 #if a_list[i]==i+1:
 #i=j
 #print(i, a_list)
 #if i+1==len(a_list):
#    print(times)
#    sys.exit()
# if a_list[j]!=j+1:
#     a_list.pop(j)
     #j=i
     #i=j
#     times+=1
#     if len(a_list)==0:
#      print(-1)
#      sys.exit()
     #elif j+1==len(a_list):
     #print(times)
    #     sys.exit()

#     elif
#print(times)
#
Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta
import datetime
#import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#print(0)
N =2
month, date = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する


for i in range(N):
  month[i], date[i] = map(int, input().split())

if date[1]==1:
    print(1)
else:
    print(0)
#print(datetime.date(2019, month[0], date[0]))
#today =datetime.date(2019, month[0], date[0])
#print(today+relativedelta(days=+1))
#nextday=today+relativedelta(days=+1)


Fixed submission:
# -*- Coding: utf-8 -*-
#from dateutil.relativedelta import relativedelta
#import datetime
#import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#print(0)
N =2
month, date = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する


for i in range(N):
  month[i], date[i] = map(int, input().split())

if date[1]==1:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
guzai_valu = list(map(int, input().split()))
heikin=0
i=1
while i <= n-1:
   guzai_valu_sort = sorted(guzai_valu)
   #print(guzai_valu_sort)
   heikin=(guzai_valu_sort.pop(0)+guzai_valu_sort.pop(0))/2
   #自動で成分がずれるのでリストの成分の内最初のものを2回選ぶことが最小のもの
   #を2つ選ぶことと等価になるんや
   #print(heikin)
   guzai_valu_sort.append(heikin)
   guzai_valu = guzai_valu_sort
   i=i+1


print(heikin)


Fixed submission:
x = int(input())
y = input()

if x >= 3200 :
     print(y)

else:
     print('red')

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

if x >= 3200 :
     print(y)

else:
print('red')


Fixed submission:
x = int(input())
y = input()

if x >= 3200 :
     print(y)

else:
     print('red')

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

if x >= 3200 :
     print(y)

else:
print('red')


Fixed submission:
x = int(input())
y = input()

if x >= 3200 :
     print(y)

else:
     print('red')
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
li = list(map(int,input().split()))
road = []
while True:
    try:
        road.append(list(map(int,input().split())))

    except:
        break;
        #または、quit(),os.exit()をして止める。

#print(road)
cnt = 0
for i in range(len(li)):
    t = 0
    for j in range(len(road)):
        if road[j][0]==i+1:
            if li[road[j][1]-1]>=li[i]:
                t=1
        elif road[j][1]==i+1:
            if li[road[j][0]-1]>=li[i]:
                t=1
    #print(t)
    if t == 0:
        cnt += 1
print(cnt)

Fixed submission:
n,m = map(int,input().split())
li = list(map(int,input().split()))
road = []
while True:
    try:
        road.append(list(map(int,input().split())))
 
    except:
        break;
        #または、quit(),os.exit()をして止める。
 
#print(road)

x = [0]*n
for i in range(m):
    if li[road[i][1]-1]>=x[road[i][0]-1]:
        x[road[i][0]-1]=li[road[i][1]-1]
    if li[road[i][0]-1]>=x[road[i][1]-1]:
        x[road[i][1]-1]=li[road[i][0]-1]
    
cnt = 0    
for i in range(n):
    if li[i]>x[i]:
        cnt += 1
#print(x)
#print(li)
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x= list(range(-10000, 10000, 1))
#print(x)
a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()

Fixed submission:
n=int(input())
x= list(range(-1000, 1000, 1))
#print(x)
a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()
Buggy python submission (verdict: Runtime Error):
import math

a=int(input())
#li = list(map(int,input().split()))
print(math.ceil(li[0]/a)*a)
if li[1]<math.ceil(li[0]/a)*a:
    print("NG")
else:
    print("OK")

Fixed submission:
import math
 
a=int(input())
li = list(map(int,input().split()))
#print(math.ceil(li[0]/a)*a)
if li[1]<math.ceil(li[0]/a)*a:
    print("NG")
else:
    print("OK")
Buggy python submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
cnt = 0
t = 0
if n<=b:
    #print(math.floor(a*n/b))
    exit()
for i in range(math.floor(n/b)):
    t = math.floor(a*(b(i+1))/b)-a*i
    #print("a")
    if cnt <= t:
        cnt=t
            
print(cnt)

Fixed submission:
import math
 
a,b,n = map(int,input().split())
cnt = 0
t = 0
if n<=b-1:
    print(math.floor(a*n/b))
#    exit()
else:
    print(math.floor(a*(b-1)/b))

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

a,b,n = map(int,input().split())
cnt = 0
t = 0
if n<=b:
    print(math.floor(a*n/b))
    exit()
for i in range(math.floor(n/b)):
    t = math.floor(a*(b(i+1))/b)-a*i
    print("a")
    if cnt <= t:
        cnt=t
            
print(cnt)

Fixed submission:
import math
 
a,b,n = map(int,input().split())
cnt = 0
t = 0
if n<=b-1:
    print(math.floor(a*n/b))
#    exit()
else:
    print(math.floor(a*(b-1)/b))