Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
k = 0
A =input().split()
i = 1
k = 0
for a in A:
    if a in A[i:]:
        k = 1
        break
    else:
        i+=1
        pass
if k == 0:
    print("YES")
else:
    print("NO")


Fixed submission:
import numpy as np
n = int(input())
k = 0
A =[int(a) for a in input().split()]
A.sort()
A = np.array(A)
AC = [0]*n
AC = np.array(AC)
AC[1:] =A[:n-1]
AA = A - AC
if 0 in AA:
    print("NO")
elif A[n-2] == A[n-1]:
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0

A = [["".join(sorted(input()))] for _ in range(n)]
A.sort()

for i in range(n-1):
    a = A[i]
    for j in range(n-i-1):
        if a == A[j+i+1]:
            ans += 1
        else:
            break
            
print(ans)


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

A = [["".join(sorted(input()))] for _ in range(n)]
A.sort()

k = 0

for i in range(n-1):
    if k > 1:
        k = k-1
        ans += k
    else:
        k = 0
        a = A[i]
        for j in range(n-i-1):
                if a == A[j+i+1]:
                    ans += 1
                    k += 1
                else:
                    break

print(ans)

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

A = [["".join(sorted(input()))] for _ in range(n)]

for i in range(n-1):
    a = A[i]
    for j in range(n-i-1):
        if a == A[j+i+1]:
            ans += 1

print(ans)


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

A = [["".join(sorted(input()))] for _ in range(n)]
A.sort()

k = 0

for i in range(n-1):
    if k > 1:
        k = k-1
        ans += k
    else:
        k = 0
        a = A[i]
        for j in range(n-i-1):
                if a == A[j+i+1]:
                    ans += 1
                    k += 1
                else:
                    break

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [int(s) for s in input().split()]
cen = n //2
ANS = [0]*(cen)
A_p = A[cen:n]
ANS = ANS + A_p

for i in range(cen):
    part_sum = sum(ANS[cen-i-1::cen-i])
    dot = part_sum % 2
    if dot == A[cen-i-1]:
        pass
    else:
        ANS[cen-i-1] = 1

sum_ans = sum(ANS)
print(sum_ans)
if sum_ans == 0:
    pass
else:
    B=[]
    for i in range(n):
        if ANS[i] != 0:
            B.append(i+1)
        else:
            pass
    B = " ".join(B)
    print(B)


Fixed submission:
n = int(input())
A = [int(s) for s in input().split()]
cen = n //2
ANS = [0]*(cen)
A_p = A[cen:n]
ANS = ANS + A_p

for i in range(cen):
    part_sum = sum(ANS[cen-i-1::cen-i])
    dot = part_sum % 2
    if dot == A[cen-i-1]:
        pass
    else:
        ANS[cen-i-1] = 1

sum_ans = sum(ANS)
print(sum_ans)
if sum_ans == 0:
    pass
else:
    B = []
    for i in range(n):
        if ANS[i] != 0:
            B.append(i+1)
        else:
            pass
    BB = [str(a) for a in B]
    BB =" ".join(BB)
    print(BB)
Buggy python submission (verdict: Runtime Error):
mod = 1e9 + 7
def comb(n, r):
    if n == 0 or r == 0:
        return 1
    elif n < r:
        return 0
    else:
        m = n - r
        u = max(m, r)
        mul_sum = 1
        for j in range(u):
            loc_sum = (m - j) / (j + 1)
            mul_sum = mul_sum * loc_sum
        asr = int(mul_sum % mod)
        return asr



n, k = map(int, input().split())
ans = 0
red = n - k


for i in range(k):
    b_c = comb(k-1, i)
    r_c = comb(red+1, i+1)
    mlt = int(b_c * r_c)
    ans = mlt % mod
    print(int(ans))


Fixed submission:
S = [s for s in input()]

SS = sorted(S)

if SS[0] == SS[1] and SS[2] == SS[3] and SS[0] != SS[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import bisect

n = int(input())

a, b = map(int, input().split())
task_lis = [[b, a]]
sum_a = 0
ch_over = 1


for i in range(n-1):
    a, b = map(int, input().split())
    if a > b:
        ch_over = 0
        break
    else:
        pass
    ok2 = bisect.insort_right(task_lis,[b, a])


for i in range(n):
    if chover == 0:
        break
    else:
        pass
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")


Fixed submission:
str = input()
L = [int(s) for s in str]

if L[0] == L[1]:
    ans = "Bad"
elif L[1] == L[2]:
    ans = "Bad"
elif L[2] == L[3]:
    ans = "Bad"
else:
    ans = "Good"

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

A = [int(input().strip()) for _ in range(m)]

a0 = 1
a1 = 1 if A[0] !=1 else 0
mod = 1000000007

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A if a1 !=0 else A[1:]
next = 0
for i in range(2, n+1):
    if next <= len(Next)-1:
        if i == Next[next]:
            ANS[i] = 0
            next += 1
            continue
    ANS[i] = ANS[i-2] + ANS[i-1]

print(ANS[n]%mod)


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

A = [int(input().strip()) for _ in range(m)]

a0 = 1
if len(A) == 0:
  a1 = 1
else:
  a1 = 1 if A[0] !=1 else 0
mod = 1000000007

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A if a1 !=0 else A[1:]
next = 0
for i in range(2, n+1):
    if next <= len(Next)-1:
        if i == Next[next]:
            ANS[i] = 0
            next += 1
            continue
    ANS[i] = ANS[i-2] + ANS[i-1]

print(ANS[n]%mod)

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

A = [int(input()) for _ in range(m)]

a0 = 1
a1 = 1 if A[0] !=1 else 0
mod = 1e9+7

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A if a1 !=0 else A[1:]
next = 0
for i in range(2, n+1):
    if next <= len(Next)-1:
        if i == Next[next]:
            ANS[i] = 0
            next += 1
            continue
    ANS[i] = ANS[i-2] + ANS[i-1]

print(int(ANS[n]%mod))


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

A = [int(input().strip()) for _ in range(m)]

a0 = 1
if len(A) == 0:
  a1 = 1
else:
  a1 = 1 if A[0] !=1 else 0
mod = 1000000007

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A if a1 !=0 else A[1:]
next = 0
for i in range(2, n+1):
    if next <= len(Next)-1:
        if i == Next[next]:
            ANS[i] = 0
            next += 1
            continue
    ANS[i] = ANS[i-2] + ANS[i-1]

print(ANS[n]%mod)

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

A = [int(a) for a in input().strip()]

a0 = 1 
a1 = 1 if A[0] !=1 else 0 

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A[1:] if a1 !=0 else A
next = 0
for i in range(2,n+1) :
  if i == Next[next]:
    A[i] = 0
    next += 1 
  else:
    A[i] = A[i-2] + A[i-1] 
  
print(A[n])

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

A = [int(input().strip()) for _ in range(m)]

a0 = 1
if len(A) == 0:
  a1 = 1
else:
  a1 = 1 if A[0] !=1 else 0
mod = 1000000007

ANS=[0]*(n+1)
ANS[0]=a0
ANS[1]=a1
Next = A if a1 !=0 else A[1:]
next = 0
for i in range(2, n+1):
    if next <= len(Next)-1:
        if i == Next[next]:
            ANS[i] = 0
            next += 1
            continue
    ANS[i] = ANS[i-2] + ANS[i-1]

print(ANS[n]%mod)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

I = input().split()
A = [int(s) for s in(I)]
d = 1

for i in range(m):
    b, c = map(int, input().split())
    if d == 1:
        A.sort()
        d = 0
    else:
        pass
    for j in range(b):
        if A[j] >= c:
            break
        else:
            A[j] = c
            d = 1
ans = sum(A)
print(ans)


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

if a <= 5:
    c = 0
elif a <= 12:
    c = int(b / 2)
else:
    c = b

print(c)
Buggy python submission (verdict: Runtime Error):
n, k =map(int, input().split())
STR = input()
str = STR.lower()

if k == 1:
  sTR = str[0] + STR[1:]
elif k == n:
  stR = STR[:n-2] + str[n-1]
else:
  sTR = STR[:k-2] + str[k-1] + STR[:k]

print(sTR)


Fixed submission:
n, k =map(int, input().split())
STR = input()
str = STR.lower()

if k == 1:
  sTR = str[0] + STR[1:]
elif k == n:
  sTR = STR[:n-1] + str[n-1]
else:
  sTR = STR[:k-1] + str[k-1] + STR[k:]

print(sTR)

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

if k == 1:
  sTR = lower(s[0]) + s[1:]
else:
  sTR = s[:k-2] + lower(s[k-1]) + s[:k]

print(sTR)

Fixed submission:
n, k =map(int, input().split())
STR = input()
str = STR.lower()

if k == 1:
  sTR = str[0] + STR[1:]
elif k == n:
  sTR = STR[:n-1] + str[n-1]
else:
  sTR = STR[:k-1] + str[k-1] + STR[k:]

print(sTR)
Buggy python submission (verdict: Runtime Error):
import bisect

lis = [1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd == 0
elif tp == 1:
    if bt == 1:
        jd == 2
    else:
        jd == 1
else:
    if bt == 1:
        jd == 0
    else:
        jd == 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])


Fixed submission:
import bisect

lis = [1, 13]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tplo == 1:
    if btlo == 1:
        jd = 2
    else:
        jd = 1
else:
    if btlo == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]

print(judge[jd])

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

lis[1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd == 0
elif tp == 1:
    if bt == 1:
        jd == 2
    else:
        jd == 1
else:
    if bt == 1:
        jd == 0
    else:
        jd == 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])


Fixed submission:
import bisect

lis = [1, 13]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tplo == 1:
    if btlo == 1:
        jd = 2
    else:
        jd = 1
else:
    if btlo == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]

print(judge[jd])

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

lis[1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])
if

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd == 0
elif tp == 1:
    if bt == 1:
        jd == 2
    else:
        jd == 1
else:
    if bt == 1:
        jd == 0
    else:
        jd == 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])


Fixed submission:
import bisect

lis = [1, 13]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tplo == 1:
    if btlo == 1:
        jd = 2
    else:
        jd = 1
else:
    if btlo == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]

print(judge[jd])
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

m = 0
g = 0
ps = p
for i in range(n):
    g = i+1
    while g < k:
        g = g * 2
        m = m + 1
    p = double(0.5**m) / n 
    ps = ps + p

print(ps)


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

g = 0
ps = 0
for i in range(n):
    g = i+1
    m = 0
    while g < k:
        g = g * 2
        m = m + 1
    p = float(0.5**m / n)
    ps = ps + p

print(ps)

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

m = 0

while g < k:
    g = n * 2
    m = m + 1

double(p) = 0.5**m
print(p)


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

g = 0
ps = 0
for i in range(n):
    g = i+1
    m = 0
    while g < k:
        g = g * 2
        m = m + 1
    p = float(0.5**m / n)
    ps = ps + p

print(ps)
Buggy python submission (verdict: Runtime Error):
n = int(input())
in_num = input().split()
lis_num = [int(s) for s in in_num]
m = max(lis_num)

x = [lis_num[i] % m for i in range(n)]
sx = max(x.remove(max(x)))
m2 = max(lis_num.remove(m))
y = [lis_num[i] % m2 for i in range(n)]
sy = max(y.remove(max(y)))
if sx == 0:
  ans = m
elif sy == 0:
  ans = m2
else:
  for i in range((m+1)//2, 0, -1):
    x = [lis_num[j] % i for j in range(n)]
    sx = max(x.remove(max(x)))
    if sx == 0:
      ans = i
      break
    else:
      continue
print(ans)


Fixed submission:
a, b, t = map(int, input().split())
 
hmb = b * (t // a)
print(hmb)
Buggy python submission (verdict: Runtime Error):
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = map(input().split())
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Fixed submission:
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy python submission (verdict: Runtime Error):
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = map(str, input().split())
  amo.append(a)
  ybt.append(y)
  
float sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Fixed submission:
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy python submission (verdict: Runtime Error):
amo = []
ybt = []
 
n = int(input())
for in range(n):
  a, y = map(str, input().split())
  amo.append(a)
  ybt.append(y)
  
float sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Fixed submission:
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy python submission (verdict: Runtime Error):
amo = []
ybt = []

n = int(input())
for in range(n):
  a, y = map(str, input().split())
  amo.append(a)
  ybt.append(y)

sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)


Fixed submission:
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
 
if a * b % 2 == 0:
  print("Even")
else:
  print(Odd)

Fixed submission:
a, b = map(int, input().split())
 
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")

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

if a * b % ==0:
  print("Even")
else:
  print(Odd)

Fixed submission:
a, b = map(int, input().split())
 
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
str = input()
t = 0
 
for s in str
  t = t + int(str[s])
  
print(t)

Fixed submission:
str = input()

a = int(str[0])
b = int(str[1])
c = int(str[2])

print(a+b+c)

Buggy python submission (verdict: Runtime Error):
str = input()
t = 0

for s in str:
  t = t + int(str[s])
  
print(t)

Fixed submission:
str = input()

a = int(str[0])
b = int(str[1])
c = int(str[2])

print(a+b+c)

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

for s in str:
  a[s] = int(str[s])
print(sum(a))


Fixed submission:
str = input()

a = int(str[0])
b = int(str[1])
c = int(str[2])

print(a+b+c)
Buggy python submission (verdict: Runtime Error):
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in range(x):
  if x[i] is 0:
    print(i+1)

Fixed submission:
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in range(5):
  if x[i] is 0:
    print(i+1)

Buggy python submission (verdict: Runtime Error):
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in 5:
  if x[i] is 0:
    print(i+1)

Fixed submission:
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in range(5):
  if x[i] is 0:
    print(i+1)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

flag = True
for i in range(s):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")
    

Fixed submission:
s = input()
t = input()
 
flag = True
for i in range(len(s)):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

c = A / K
b = c * K
flag = False

if b == B:
  flag = True
b += K
  if b <= B:
    flag = True

if flag == True:
  print("OK")
else:
  print("NG")


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

flag = False

if a <= int(b / k) * k:
  print("OK")
else:
  print("NG")

Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

c = A / K
b = c * K
flag = False

if b == B:
  flag = True
while b <= B:
  b += K
  elif b <= B:
    flag = True

if flag == True:
  print("OK")
else:
  print("NG")


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

flag = False

if a <= int(b / k) * k:
  print("OK")
else:
  print("NG")
Buggy python submission (verdict: Runtime Error):
D,T,S=map(int,input().split)
if D/S<=T:
  print("Yes")
else:
  print("No")

Fixed submission:
D,T,S=map(int,input().split())
if D/S<=T:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
string = input()
result = string.count("R")
if(result == 2 and string[1] = "S"):
  print("1")
else:
  print(result)
  

Fixed submission:
string = input()
result = string.count("R")
if(result == 2 and string[1] == "S"):
  print("1")
else:
  print(result)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
print("Yes" if s in t else: "No")

Fixed submission:
s = input()
t = input()
if((c.islower() for c in s) and (d.islower() for d in t) and (s == t[0:len(s)]) and len(s) + 1 == len(t)):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
all_number = input().split()
count = 0
for i in range(n):
  check = True
  for j in range(i):
    if(int(all_number[i]) > int(all_number[j])):
      check = False
      break
  if(check):
    count = count + 1
print(count)

Fixed submission:
n = int(input())
all_number = input().split()
count = 0
lowest = int(all_number[0])
for i in range(n):
  if(int(all_number[i]) <= lowest):
    count = count + 1
    lowest = int(all_number[i])
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = 0
r = 26
count = 1
result = ""
moji = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while a == 0:
    if r <= n:
        n -= r
        r *= 26
        count += 1
    else:
        a = 1
zenbu = 26**count

def kaidan(zenbu,n):
    global moji
    for i in range(26):
        #print(i)
        if (zenbu/26)*i < n <= (zenbu/26)*(i+1):
            return(moji[i],i)

for l in range(count):
    kotae,s = kaidan(zenbu/(26**l),n)
    result += kotae
    n -= 26**(count-l-1)*s
print(result)

Fixed submission:
n = int(input())
a = 0
r = 26
count = 1
result = ""
moji = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while a == 0:
    if r < n:
        n -= r
        r *= 26
        count += 1
    else:
        a = 1
zenbu = 26**count

def kaidan(zenbu,n):
    global moji
    for i in range(26):
        #print(i)
        if (zenbu/26)*i < n <= (zenbu/26)*(i+1):
            return(moji[i],i)

for l in range(count):
    kotae,s = kaidan(zenbu/(26**l),n)
    result += kotae
    n -= 26**(count-l-1)*s
print(result)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = 0
r = 26
count = 1
result = ""
moji = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while a == 0:
    if r <= n:
        n -= r
        r *= 26
        count += 1
    else:
        a = 1
zenbu = 26**count

def kaidan(zenbu,n):
    global moji
    for i in range(26):
        #print(i)
        if zenbu/26*i < n <= zenbu/26*(i+1):
            return(moji[i],i)

for l in range(count):
    kotae,s = kaidan(zenbu/(26**l),n)
    result += kotae
    n -= 26**(count-l-1)*s
print(result)

Fixed submission:
n = int(input())
a = 0
r = 26
count = 1
result = ""
moji = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
while a == 0:
    if r < n:
        n -= r
        r *= 26
        count += 1
    else:
        a = 1
zenbu = 26**count

def kaidan(zenbu,n):
    global moji
    for i in range(26):
        #print(i)
        if (zenbu/26)*i < n <= (zenbu/26)*(i+1):
            return(moji[i],i)

for l in range(count):
    kotae,s = kaidan(zenbu/(26**l),n)
    result += kotae
    n -= 26**(count-l-1)*s
print(result)
Buggy python submission (verdict: Runtime Error):
(N,M) = input().split()
N = int(N)
M = int(M)
h = list(map(int,input().split()))
y = [0] * N
for i in range (M):
    A,B = map(int,input().split())
    if h[A -1] >= h[B -1]:
        y[B -1] += 1
    if h[B -1] >= h[a -1]:
        y[A -1] += 1
print(y.count(0))

Fixed submission:
N,M = map(int,input().split())
H = list(map(int,input().split()))
c = [0] * N
for i in range(M):
    A,B = map(int,input().split())
    if H[A -1] >= H[B -1]:
        c[B - 1] += 1
    if H[B - 1] >= H[A - 1]:
        c[A - 1] += 1
print(c.count(0))

Buggy python submission (verdict: Runtime Error):
(N,M) = input().split()
N = int(N)
M = int(M)
h = list(map(int,input().split()))
y = [0] * N
for i in range (M):
    A,B = map(int,input().split())
    if h[A -1] >= h[B -1]:
        y[B -1] += 1
    if h[B -1] >= h[a -1]:
        y[A -1] += 1
print(y.count(0))

Fixed submission:
N,M = map(int,input().split())
H = list(map(int,input().split()))
c = [0] * N
for i in range(M):
    A,B = map(int,input().split())
    if H[A -1] >= H[B -1]:
        c[B - 1] += 1
    if H[B - 1] >= H[A - 1]:
        c[A - 1] += 1
print(c.count(0))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
sum=0
while N!=0:
    sum=(sum+N%10)%9
    N//=10
if sum%9==0:
    print("Yes")
else:
    print("No")


Fixed submission:
N=list(str(input()))
sum=0
for i in range(len(N)):
    sum=(sum+int(N[i]))%9
if sum%9==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
sum=0
while N:
    sum=(sum+N%10)%9
    N//=10
if sum%9==0:
    print("Yes")
else:
    print("No")


Fixed submission:
N=list(str(input()))
sum=0
for i in range(len(N)):
    sum=(sum+int(N[i]))%9
if sum%9==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
sum=0
while N:
    sum+=N%10
    N//=10
    sum%=9
if sum%9==0:
    print("Yes")
else:
    print("No")


Fixed submission:
N=list(str(input()))
sum=0
for i in range(len(N)):
    sum=(sum+int(N[i]))%9
if sum%9==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
sum=0
while N:
    sum+=N%10
    N//=10
if sum%9==0:
    print("Yes")
else:
    print("No")


Fixed submission:
N=list(str(input()))
sum=0
for i in range(len(N)):
    sum=(sum+int(N[i]))%9
if sum%9==0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
X,K,D = (int(x) for x in input().split())
X=abs(X)
count=K
for i in range(K):
    if X<0:
        break
    X-=D
    count-=1
if X<0:
    if count%2==0:
        print(abs(X))
    else:
        print(X+D)
else:
    print(X)

Fixed submission:
X,K,D = (int(x) for x in input().split())
X=abs(X)
if X>K*D:
    print(X-K*D)
else:
    s=X//D
    X-=s*D
    K-=s
    if K%2==0:
        print(X)
    else:
        print(abs(X-D))