Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(a) for a in input().split()]

A_set = list(set(A))
ans = 0
for i in range(len(A_set)):
  nm = A_set[i]
  nm_cnt = A.count(nm)
  if nm > N:
    ans += nm_cnt
    continue
  
  if nm_cnt < nm:
    ans += nm_cnt
  elif nm_cnt > nm:
    ans += nm_cnt - nm
  N -= nm_cnt

print(ans)

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

ans = 0
C = [0] * N # [1の個数, 2の個数, 3の個数, ... , Nの個数]
for i in range(N):
  n = A[i]
  if n <= N:
    C[n-1] += 1
  else: # n > N:
    ans += 1

for i in range(N):
  cnt = C[i]
  if cnt > i+1:
    ans += (cnt - (i+1))
  elif cnt < i+1:
    ans += cnt

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(a) for a in input().split()]

A_set = list(set(A))
ans = 0
for i in range(len(A_set)):
  nm = A_set[i]
  nm_cnt = A.count(nm)
  
  if nm > N:
    ans += nm_cnt
    continue
  
  if nm_cnt < nm:
    ans += nm_cnt
  elif nm_cnt > nm:
    ans += nm_cnt - nm
  else:
    continue

print(ans)

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

ans = 0
C = [0] * N # [1の個数, 2の個数, 3の個数, ... , Nの個数]
for i in range(N):
  n = A[i]
  if n <= N:
    C[n-1] += 1
  else: # n > N:
    ans += 1

for i in range(N):
  cnt = C[i]
  if cnt > i+1:
    ans += (cnt - (i+1))
  elif cnt < i+1:
    ans += cnt

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(a) for a in input().split()]

A_set = list(set(A))
ans = 0
for i in range(len(A_set)):
  nm = A_set[i]
  nm_cnt = A.count(nm)
  if nm_cnt < nm:
    ans += nm_cnt
  elif nm_cnt > nm:
    ans += nm_cnt - nm
  else:
    continue

print(ans)

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

ans = 0
C = [0] * N # [1の個数, 2の個数, 3の個数, ... , Nの個数]
for i in range(N):
  n = A[i]
  if n <= N:
    C[n-1] += 1
  else: # n > N:
    ans += 1

for i in range(N):
  cnt = C[i]
  if cnt > i+1:
    ans += (cnt - (i+1))
  elif cnt < i+1:
    ans += cnt

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(a) for a in input().split()]

A_set = list(set(A))
ans = 0
for i in range(len(A_set)):
  nm = A_set[i]
  nm_cnt = A.count(nm)
  if nm_cnt < nm:
    ans += nm_cnt
  elif nm_cnt > nm:
    ans += nm_cnt - nm
  else:
    continue

print(ans)

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

ans = 0
C = [0] * N # [1の個数, 2の個数, 3の個数, ... , Nの個数]
for i in range(N):
  n = A[i]
  if n <= N:
    C[n-1] += 1
  else: # n > N:
    ans += 1

for i in range(N):
  cnt = C[i]
  if cnt > i+1:
    ans += (cnt - (i+1))
  elif cnt < i+1:
    ans += cnt

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else:
  AA = [A.count(i) for i in A_set]
  AA.sort()
  ans = sum(AA[:-K])
  print(ans)

Fixed submission:
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else: # len(A_set) > K:
  dictionary = {}
  for n in A_set:
    dictionary[n] = 0
  for m in A:
    dictionary[m] += 1
  
  dict_val = list(dictionary.values())
  dict_val.sort(reverse = True)
  ans = N - sum(dict_val[:K])
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else:
  AA = [A.count(i) for i in A_set]
  AA.sort()
  ans = sum(AA[:-K])
  print(ans)

Fixed submission:
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else: # len(A_set) > K:
  dictionary = {}
  for n in A_set:
    dictionary[n] = 0
  for m in A:
    dictionary[m] += 1
  
  dict_val = list(dictionary.values())
  dict_val.sort(reverse = True)
  ans = N - sum(dict_val[:K])
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else:
  AA = [A.count(i) for i in A_set]
  AA.sort(reverse=True)
  ans = sum(AA[K:])
  print(ans)

Fixed submission:
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else: # len(A_set) > K:
  dictionary = {}
  for n in A_set:
    dictionary[n] = 0
  for m in A:
    dictionary[m] += 1
  
  dict_val = list(dictionary.values())
  dict_val.sort(reverse = True)
  ans = N - sum(dict_val[:K])
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else:
  AA = [A.count(i) for i in A_set]
  AA.sort(reverse=True)
  ans = sum(AA[K:])
  print(ans)

Fixed submission:
N, K = [int(nk) for nk in input().split()]
A = [int(a) for a in input().split()]

A_set = list(set(A))
if len(A_set) <= K:
  print(0)
else: # len(A_set) > K:
  dictionary = {}
  for n in A_set:
    dictionary[n] = 0
  for m in A:
    dictionary[m] += 1
  
  dict_val = list(dictionary.values())
  dict_val.sort(reverse = True)
  ans = N - sum(dict_val[:K])
  print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L_i2 = 2
L_i1 = 1
for n in range(N-1):
  L_i = L_i1 + L_i2
  L_i2 = L_i1
  L_i1 = L_i
print(L_i)

Fixed submission:
N = int(input())
L_i2 = 2
L_i1 = 1
if N == 0:
  L_i = L_i2
elif N == 1:
  L_i = L_i1
else:
  for n in range(N-1):
    L_i = L_i1 + L_i2
    L_i2 = L_i1
    L_i1 = L_i
print(L_i)
Buggy python submission (verdict: Time Limit Exceeded):
x = map(int,raw_input().split())
n=x[0]
k=x[1]
q=x[2]

a=[]

for i in range(q):
    y=int(raw_input())
    a.append(y-1)

for i in range(n):
    if k-q+a.count(i)>0:
        print("Yes")
    else:
        print("No")


Fixed submission:
x = map(int,raw_input().split())
n=x[0]
k=x[1]
q=x[2]

z=[k-q]*n



for i in range(q):
    y=int(raw_input())
    z[y-1]=z[y-1]+1


for i in range(n):
    if z[i]>0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int, raw_input().split())

def minus(n):
    return float(n*(-1))

def plus(n):
    return int(n*(-1))

a=list(map(minus, a))

for i in range(m):
    heapq.heapify(a)
    a[0]=a[0]/2

a=list(map(plus, a))

print(sum(a))


Fixed submission:
import heapq

x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int, raw_input().split())

def minus(n):
    return float(n*(-1))

def plus(n):
    return int(n*(-1))

a=list(map(minus, a))
heapq.heapify(a)

for i in range(m):
    heapq.heappush(a, heapq.heappop(a)/2)

a=list(map(plus, a))

print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int,raw_input().split())
a=list(map(float, a))                                                           

for i in range(m):                                                         
    a[a.index(max(a))]=max(a)/2

a=list(map(int, a))

print(sum(a))

Fixed submission:
import heapq

x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int, raw_input().split())

def minus(n):
    return float(n*(-1))

def plus(n):
    return int(n*(-1))

a=list(map(minus, a))
heapq.heapify(a)

for i in range(m):
    heapq.heappush(a, heapq.heappop(a)/2)

a=list(map(plus, a))

print(sum(a))

Buggy python submission (verdict: Runtime Error):
x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int,raw_input().split())
a.sort(reverse=True)

for i in range(m):
    if a[0]<a[1]:
        a.sort(reverse=True)
    a[0]=float(a[0])/2

a=list(map(int, a))

print(sum(a))


Fixed submission:
import heapq

x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int, raw_input().split())

def minus(n):
    return float(n*(-1))

def plus(n):
    return int(n*(-1))

a=list(map(minus, a))
heapq.heapify(a)

for i in range(m):
    heapq.heappush(a, heapq.heappop(a)/2)

a=list(map(plus, a))

print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int,raw_input().split())

for i in range(m):
    a.sort(reverse=True)
    a[0]=float(a[0])/2

a=list(map(int, a))

print(sum(a))


Fixed submission:
import heapq

x = map(int,raw_input().split())
n=x[0]
m=x[1]
a = map(int, raw_input().split())

def minus(n):
    return float(n*(-1))

def plus(n):
    return int(n*(-1))

a=list(map(minus, a))
heapq.heapify(a)

for i in range(m):
    heapq.heappush(a, heapq.heappop(a)/2)

a=list(map(plus, a))

print(sum(a))
Buggy python submission (verdict: Runtime Error):
File Edit Options Buffers Tools Python YASnippet Help                           
import sys
import collections

l = map(int, raw_input().split())
a=[]
for n in range(l[0]):
    x = map(int, raw_input().split())
    a.extend(x[1:])

c = collections.Counter(a)
values, counts = zip(*c.most_common())
print(counts.count(l[0]))

Fixed submission:
import sys
import collections

a=[]
l = map(int, raw_input().split())
for n in range(l[0]):
    x = map(int, raw_input().split())
    a.extend(x[1:])

c = collections.Counter(a)
values, counts = zip(*c.most_common())
print(counts.count(l[0]))
Buggy python submission (verdict: Runtime Error):
import sys
import collections

b=[]
n = map(int, raw_input().split())
a = map(int, raw_input().split())

while True:
    a.sort()

    if a[0]==a[-1]:
        print(a[0])
        break

    elif:
        for n, x in enumerate(a):
            n=n%a[0]
            if n!=0:
                b.append(n)
        a=[a[0]]
        a.extend(b)


Fixed submission:
import sys
import collections

b=[]
n = map(int, raw_input().split())
a = map(int, raw_input().split())

while True:
    a.sort()
    b=[]
    if a[0]==1:
        print(1)
        break
    elif a[0]==a[-1]:
        print(a[0])
        break
    else:
        for n in a:
            n=n%a[0]
            if n!=0:
                b.append(n)
        a=[a[0]]
        a.extend(b)
Buggy python submission (verdict: Runtime Error):
x=input()
if (x< 1200):
  print("ABC")
elif (x<2800):
  print("ARC")
else:
  print("AGC")

Fixed submission:
x = int(input())
print("ABC" if x < 1200 else ("ARC" if x < 2800 else "AGC"))

Buggy python submission (verdict: Runtime Error):
x=input()
if (x< 1200):
  	print("ABC")
elif (x<2800):
  	print("ARC")
else:
  	print("AGC")

Fixed submission:
x = int(input())
print("ABC" if x < 1200 else ("ARC" if x < 2800 else "AGC"))
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=input()
s=list(x)
 
list=[]
for i in range(n):
    a=0
    l=s[:i]
    a+=l.count("W")
    k=s[i+1:]
    a+=k.count("E")
    list.append(a)
 
f=min(list)

print(f)

Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=input()
s=list(x)
 
list=[]
for i in range(n):
    a=0
    l=s[:i]
    a+=l.count("W")
    k=s[i+1:]
    a+=k.count("E")
    list.append(a)
 
f=min(list)

Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=input()
s=list(x)
list=[]
 
for i in range(n):
    a=0
    moji=[]
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k+i-1]:
                if s[j] not in moji:
                    a+=1
                    moji.append(s[j])
    list.append(a)
 
f=max(list)
print(f)

Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=input()
s=list(x)
list=[]

for i in range(n):
    a=0;
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k+i-1]:
                a+=1
    list.append(a)

f=max(list)
print(f)


Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)

Buggy python submission (verdict: Runtime Error):
n=int(input())
x=input()
s=list(x)
list=[]

for i in range(n):
    a=0;
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k]:
                a+=1
    list.append(a)

f=max(list)
print(f)

Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)

Buggy python submission (verdict: Runtime Error):
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max[c, d, e]

print(f)

Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)

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

c=a+b
d=a-b
e=a*b

print(max[c, d, e])

Fixed submission:
a, b= map(int, input().split())
 
c=a+b
d=a-b
e=a*b
 
f=max([c, d, e])
 
print(f)
Buggy python submission (verdict: Runtime Error):
n=input()
x=input()
s=list(x)
list=[]

for i in range(n):
    a=0;
    for j in range(i):
        for k in range(n-i):
            if s[j]=s[k]:
                a+=1
    list.append(a)

f=max(list)
print(f)

Fixed submission:
n=int(input())
x=input()
s=list(x)
list=[]
 
for i in range(n):
    a=0
    moji=[]
    for j in range(i):
        for k in range(n-i):
            if s[j]==s[k+i]:
                if s[j] not in moji:
                    a+=1
                    moji.append(s[j])
    list.append(a)
 
f=max(list)
print(f)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split(" ")
a = [int(i) for i in a]

m = max(a)
r = -1

for i in range(len(a)):
  t = i + 1
  try:
    idx = a.index(t)
    a = a[(idx+1):]
    a = [i for i in a if i != t]
    r = t
  except:
    break

if r < 0:
  print(r)
else:
  print(n - r)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
target = 1
ans = 0
 
for i in range(N):
    if a[i] == target:
        target += 1
    else:
        ans += 1
 
if ans == N:
    ans = -1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split(" ")
a = [int(i) for i in a]

#m = max(a)
r = -1

for i in range(len(a)):
  t = i + 1
  try:
    idx = a.index(t)
    a = a[(idx+1):]
    r = t
  except:
    break

if r < 0:
  print(r)
else:
  print(n - r)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
target = 1
ans = 0
 
for i in range(N):
    if a[i] == target:
        target += 1
    else:
        ans += 1
 
if ans == N:
    ans = -1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split(" ")
a = [int(i) for i in a]

#m = max(a)
r = -1
c = 1
b = []

while 1:
  
  tmp = a
  a = [a[i] for i in range(len(a)) if a[i] <= i+1]
  
  if len(tmp) == len(a):
    break  
  elif c > 1000000:
    print("finite loop")
    break
  else:
    c = c + 1

#print(a)

if len(a) == 0:
  r = -1
else:
  b = [a[0]]
  for i in range(len(a) - 1):
    if a[i+1] == a[i]:
      pass
    elif a[i+1] > a[i] + 1:
      b.append(-1)
    else:
      b.append(a[i+1])

  #print(b)

  for i in range(len(b)):
    t = i + 1
    if t in b:
      idx = b.index(t)
      b = b[(idx+1):]
      r = t
    else:
      break

if r < 0:
  print(r)
else:
  print(n - r)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
target = 1
ans = 0
 
for i in range(N):
    if a[i] == target:
        target += 1
    else:
        ans += 1
 
if ans == N:
    ans = -1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split(" ")
a = [int(i) for i in a]

m = max(a)
r = -1

for i in range(m):
  t = i + 1
  if t in a:
    pass
  else:
    break

  idx = a.index(t)
  a = a[(idx+1):]
  r = t

if r < 0:
  print(r)
else:
  print(n - r)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
target = 1
ans = 0
 
for i in range(N):
    if a[i] == target:
        target += 1
    else:
        ans += 1
 
if ans == N:
    ans = -1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
print(n ** 3)

Fixed submission:
n = input()
print(int(n) ** 3)
Buggy python submission (verdict: Runtime Error):
n = input()
h = input().split()

hl = [int(int(h[i+1]) - int(h[i]) <= 0) for i in range(len(h) - 1)]
res = []
ct = 0

for i in range(len(hl) - 1):
  if hl[i] == 1:
    ct = ct + 1
  else:
    res.append(ct)
    ct = 0
    
if hl[len(hl) - 1] == 1:
  ct = ct + 1
else:
  pass

res.append(ct)
    
if len(res) == 0:
  print(0)
elif len(res) == 1:
  print(res[0])
else:
  print(max(res))


Fixed submission:
n = input()
h = input().split()
res = []
ct = 0

for i in range(len(h) - 1):
  if int(h[i]) >= int(h[i+1]):
    ct = ct + 1
  else:
    res.append(ct)
    ct = 0

res.append(ct)

print(max(res))

Buggy python submission (verdict: Runtime Error):
n = input()
h = input().split()

hl = [int(int(h[i+1]) - int(h[i]) <= 0) for i in range(len(h) - 1)]
res = []
ct = 0

for i in range(len(hl) - 1):
  if hl[i] == 1:
    ct = ct + 1
  else:
    res.append(ct)
    ct = 0
    
if hl[len(hl) - 1] == 1:
  ct = ct + 1
else:
  pass

res.append(ct)
    
if len(res) == 0:
  print(0)
elif len(res) == 1:
  print(res[0])
else:
  print(max(res))

Fixed submission:
n = input()
h = input().split()
res = []
ct = 0

for i in range(len(h) - 1):
  if int(h[i]) >= int(h[i+1]):
    ct = ct + 1
  else:
    res.append(ct)
    ct = 0

res.append(ct)

print(max(res))

Buggy python submission (verdict: Runtime Error):
n = input()
h = input().split()

hl = [int(int(h[i+1]) - int(h[i]) <= 0) for i in range(len(h) - 1)]
res = []
ct = 0

for i in range(len(hl) - 1):
  if hl[i] == 1:
    ct = ct + 1
  else:
    res.append(ct)
    ct = 0
    
if hl[len(hl) - 1] == 1:
  ct = ct + 1
else:
  pass

res.append(ct)
    
if len(res) == 0:
  print(0)
elif len(res) == 1:
  print(res[0])
else:
  print(max(res))

Fixed submission:
n = input()
h = input().split()
res = []
ct = 0

for i in range(len(h) - 1):
  if int(h[i]) >= int(h[i+1]):
    ct = ct + 1
  else:
    res.append(ct)
    ct = 0

res.append(ct)

print(max(res))
Buggy python submission (verdict: Runtime Error):
i = input()
i = i.split(" ")
n = int(i[0])
y = int(i[1])
y = y / 1000

for c in range(int(((y-n) // 9))+1):
  if (int((y-n-9*c)) % 4) == 0:
    cn = [int((y-n-9*c) / 4), c]
    break
  else:
    pass
  
if(len(cn) == 0):
  rs = [-1, -1, -1]
else:
  a = n - cn[0] - cn[1]
  if a >= 0:
    rs = [a, cn[0], cn[1]]
  else:
    rs = [-1, -1, -1]

print(str(rs[2]) + " " + str(rs[1]) + " " + str(rs[0]))

Fixed submission:
i = input()
i = i.split(" ")
n = int(i[0])
y = int(i[1])
y = y / 1000
cn = []

for c in range(int(((y-n) // 9))+1):
  if (int((y-n-9*c)) % 4) == 0:
    cn.append([int((y-n-9*c) / 4), c])
  else:
    pass

if(len(cn) == 0):
  rs = [-1, -1, -1]
else:
  rs = []
  for j in cn:
    a = n - j[0] - j[1]
    if a >= 0:
      rs = [a, j[0], j[1]]
      break
    else:
      pass
  
  if len(rs) != 3:
    rs = [-1, -1, -1]
  else:
    pass
    
print(str(rs[2]) + " " + str(rs[1]) + " " + str(rs[0]))

Buggy python submission (verdict: Runtime Error):
i = input()
i = i.split(" ")
n = int(i[0])
y = int(i[1])
y = y / 1000

for c in range(int(((y-n) // 9))+1):
  if (int((y-n-9*c)) % 4) == 0:
    cn = [int((y-n-9*c) / 4), c]
    break
  else:
    pass
  
if(len(cn) == 0):
  rs = [-1, -1, -1]
else:
  a = n - cn[0] - cn[1]
  if a >= 0:
    rs = [a, cn[0], cn[1]]
  else:
    rs = [-1, -1, -1]

print(str(rs[2]) + " " + str(rs[1]) + " " + str(rs[0]))

Fixed submission:
i = input()
i = i.split(" ")
n = int(i[0])
y = int(i[1])
y = y / 1000
cn = []

for c in range(int(((y-n) // 9))+1):
  if (int((y-n-9*c)) % 4) == 0:
    cn.append([int((y-n-9*c) / 4), c])
  else:
    pass

if(len(cn) == 0):
  rs = [-1, -1, -1]
else:
  rs = []
  for j in cn:
    a = n - j[0] - j[1]
    if a >= 0:
      rs = [a, j[0], j[1]]
      break
    else:
      pass
  
  if len(rs) != 3:
    rs = [-1, -1, -1]
  else:
    pass
    
print(str(rs[2]) + " " + str(rs[1]) + " " + str(rs[0]))
Buggy python submission (verdict: Runtime Error):
a=input()
print(a*a)

Fixed submission:
a=int(input())

print(a*a)
Buggy python submission (verdict: Time Limit Exceeded):
temp = input().split(" ")
a = min(int(temp[0]), int(temp[1]))
b = max(int(temp[0]), int(temp[1]))

def divisors(n):
  i = 2
  ret = [1]
  while True:
    while n % i == 0:
      if not i in ret:
        ret.append(i)
      n = n // i
    if i == n or n == 1:
      break
    i += 1
  return ret

# a < b
def gcd(a, b):
  if b % a == 0:
    return a
  else:
    return gcd(b % a, a)


print(len(divisors(gcd(a, b))))

Fixed submission:
temp = input().split(" ")
a = min(int(temp[0]), int(temp[1]))
b = max(int(temp[0]), int(temp[1]))

def divisors(n):
  i = 2
  ret = [1]
  while True:
    while n % i == 0:
      if not i in ret:
        ret.append(i)
      n = n // i
    if n == 1 : break
    if i * i > n:
      ret.append(n)
      break
    i += 1
  return ret

# a < b
def gcd(a, b):
  if b % a == 0:
    return a
  else:
    return gcd(b % a, a)

print(len(divisors(gcd(a, b))))

Buggy python submission (verdict: Time Limit Exceeded):
temp = input().split(" ")
a = min(int(temp[0]), int(temp[1]))
b = max(int(temp[0]), int(temp[1]))

def divisors(n):
  i = 2
  ret = [1]
  while True:
    while n % i == 0:
      if not i in ret:
        ret.append(i)
      n = n // i
    if i == n or n == 1:
      break
    i += 1
  return ret

ans = 0
ad = divisors(a)
bd = divisors(b)
for d in ad:
  if d in bd:
    ans += 1

print(ans)

Fixed submission:
temp = input().split(" ")
a = min(int(temp[0]), int(temp[1]))
b = max(int(temp[0]), int(temp[1]))

def divisors(n):
  i = 2
  ret = [1]
  while True:
    while n % i == 0:
      if not i in ret:
        ret.append(i)
      n = n // i
    if n == 1 : break
    if i * i > n:
      ret.append(n)
      break
    i += 1
  return ret

# a < b
def gcd(a, b):
  if b % a == 0:
    return a
  else:
    return gcd(b % a, a)

print(len(divisors(gcd(a, b))))
Buggy python submission (verdict: Runtime Error):
weather = ["Sunny", "Cloudy", "Rainy"]
now = input()
print(weather[(now.find()+1) % 3]

Fixed submission:
now = input()
weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[(weather.index(now) + 1) % 3])
Buggy python submission (verdict: Runtime Error):
dance = input()
judge = True

for i in dance:
  if i % 2 == 0 and dance[i] == "R":
    judge = False
    break
  if i % 2 == 1 and dance[i] == "L":
    judge = False
    break

if judge:
  print("Yes")
else:
  print("No")

Fixed submission:
dance = input()
judge = True

for i in range(len(dance)):
    if i % 2 == 1 and dance[i] == "R":
        judge = False
        break
    if i % 2 == 0 and dance[i] == "L":
        judge = False
        break

if judge:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
tmp = input().split(" ")
person = int(tmp[0])
init_pt = int(tmp[1])
questions = int(tmp[2])

ans = ""
for i in range(questions):
  ans = ans + input()

for i in range(1, len(person) + 1):
  if ans.count(str(i)) > questions - init_pt:
    print("Yes")
  else:
    print("No")

Fixed submission:
tmp = input().split(" ")
person = int(tmp[0])
init_pt = int(tmp[1])
questions = int(tmp[2])
points = [0] * (person + 1)
  
for i in range(questions):
  points[int(input())] += 1
  
for i in range(1, person + 1):
  if points[i] > questions - init_pt:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sympy
l = int(input())

x = sympy.Symbol('x')
y = sympy.Symbol('y')

f = l*x*y - y*x**2 - x*y**2

dfdx = sympy.diff(f, x)
#dfdx = sympy.diff(dfdx, y)

dfdy = sympy.diff(f, y)
#dfdy = sympy.diff(dfdy, x)

#print(f)
#print(dfdx)
#print(dfdy)
ans = sympy.solve([dfdx, dfdy])
#print(ans[0][x])

length = len(ans)
res = 0
for i in range(length):
    x1 = ans[i][x]
    y1 = ans[i][y]
    z1 = l - x1 - y1
    su = x1 * y1 * z1
    if res < su:
        res = su
        
print(float(res))

Fixed submission:
l = int(input())
a = l / 3
print(a**3)