Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):

import sys

N, Y = map(int, input().split())
max1000 = int(Y/1000)
for z in range(max1000, -1, -5):
    max5000 = int((max1000-z) / 5)
    for y in range(0, max5000+1):
        x = N - y - z
        if x*10000 + y*5000 + z*1000 == Y:
            print(str(x) + ' ' + str(y) + ' ' + str(z))
            sys.exit()
print("-1 -1 -1")

Fixed submission:

import sys

N, Y = map(int, input().split())
max1000 = int(Y/1000)
c1000 = [i for i in range(max1000, -1, -5) if i <= N]
for z in c1000:
    max5000 = int((max1000-z) / 5)
    for y in range(0, max5000+1):
        x = N - y - z
        if x*10000 + y*5000 + z*1000 == Y:
            print(str(x) + ' ' + str(y) + ' ' + str(z))
            sys.exit()
print("-1 -1 -1")

Buggy python submission (verdict: Time Limit Exceeded):
import sys

N, Y = map(int, input().split())
max1000 = int(Y/1000)
max5000 = int(max1000 / 5)
max10000 = int(max1000 / 10)
c1000 = [i for i in range(max1000, 0, -5) if i <= N]
c1000.append(0)
c5000 = [i for i in range(max5000, -1, -1) if i <= N]
c10000 = [i for i in range(max10000, -1, -1) if i <= N]
for i in c10000:
    for j in c5000:
        for k in c1000:
            if i+j+k == N:
                if i*10000 + j*5000 + k*1000 == Y:
                    print(str(i) + ' ' + str(j) + ' ' + str(k))
                    sys.exit()
print("-1 -1 -1")

Fixed submission:

import sys

N, Y = map(int, input().split())
max1000 = int(Y/1000)
c1000 = [i for i in range(max1000, -1, -5) if i <= N]
for z in c1000:
    max5000 = int((max1000-z) / 5)
    for y in range(0, max5000+1):
        x = N - y - z
        if x*10000 + y*5000 + z*1000 == Y:
            print(str(x) + ' ' + str(y) + ' ' + str(z))
            sys.exit()
print("-1 -1 -1")
Buggy python submission (verdict: Time Limit Exceeded):
N, C = map(int, input().split())
S = []
for i in range(N):
    S.append(list(map(int, input().split())))
S.sort()
R = [[] for i in range(C)]
for i in range(N):
    c = S[i][2] - 1
    if R[c]:
        if R[c][-1][1] == S[i][0]:
            R[c][-1][1] = S[i][1]
            continue
    R[c].append(S[i][:])
    R[c][-1][0] -= 0.5
maxDup = 0
for r in R:
    for s in r:
        dup1 = 1
        dup2 = 1
        for rr in R:
            if rr == r:
                continue
            for ss in rr:
                if (s[0] >= ss[0] and s[0] < ss[1]):
                    dup1 += 1
                if (s[1] >= ss[0] and s[1] <= ss[1]):
                    dup2 += 1
        if maxDup < max(dup1, dup2):
            maxDup = max(dup1, dup2)
print(maxDup)


Fixed submission:
N, C = map(int, input().split())
S = []
for i in range(N):
    S.append(list(map(int, input().split())))
S.sort()
R = [[] for i in range(C)]
for i in range(N):
    c = S[i][2] - 1
    if R[c]:
        if R[c][-1][1] == S[i][0]:
            R[c][-1][1] = S[i][1]
            continue
    R[c].append(S[i][:])
D = [0]*100001
for r in R:
    for s in r:
        for i in range(s[0], s[1]+1):
            D[i] += 1
print(max(D))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math

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

array1 = list()
for b in B:
    count = 0
    for c in C:
        if b < c:
            count += 1
    array1.append(count)
ans = 0
for i in range(N):
    count = 0
    for a in A:
        if B[i] > a:
            count += 1
    ans += count * array1[i]
print(ans)

Fixed submission:
import sys
import math

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

A.sort()
B.sort()
C.sort()

array1 = list()
count = 0
f = 0
for j in range(N):
    for i in range(f, N):
        if B[N-1-j] < C[N-1-i]:
            count += 1
            if i == N-1:
                f = N
        else:
            f = i
            break
    array1.append(count)
ans = 0
f = 0
count = 0
for i in range(N):
    for j in range(f, N):
        if B[i] > A[j]:
            count += 1
            if j == N-1:
                f = N
        else:
            f = j
            break
    ans += count * array1[N-1-i]
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split(' ')))
num = 0
for i in range(len(P)):
    if P[i] == i+1:
        P[i],P[i+1] = P[i+1],P[i]
        num += 1
print(num)


Fixed submission:
N = int(input())
P = list(map(int, input().split(' ')))
num = 0
for i in range(len(P)):
    if P[i] == i+1:
        if i+1 == len(P):
            P[i],P[i-1] = P[i-1],P[i]
        else:
            P[i],P[i+1] = P[i+1],P[i]
        num += 1
print(num)
Buggy python submission (verdict: Runtime Error):

import sys

def judgeUpper(ansList, var):
    for a in ansList:
        if int(a) > var:
#             print(a + ':' + str(var) + str(True))
            return True
    return False
def judgeEqual(ansList, var, N):
    count = ansList.count(str(var))
#     print(str(count) + ':' + str(N-1) + str(count < N - 1))
    return count < N - 1 or (count == N and var * 2 > N and var+1 != N)
def judgeLower(ansList, var):
    for a in ansList:
        if int(a) < var - 1:
#             print(a + ':' + str(var-1) + str(True))
            return True
    return False
        
N = input()
ansList = input().split(' ')
for i in range(int(N)):
    var = i + 1
    if judgeUpper(ansList, var):
        continue
    if judgeEqual(ansList, var, int(N)):
        continue
    if judgeLower(ansList, var):
        continue
    print('Yes')
    sys.exit()
print('No')

Fixed submission:

def convertList(strList, c):
    time = 0
    tmpList = list(strList)
    while tmpList.count(c) != len(tmpList):
        newList = []
        for i in range(len(tmpList[:])-1):
            newList.append(c if (tmpList[i] == c or tmpList[i+1] == c) else tmpList[i])
        tmpList = list(newList)
        time += 1
    return time

S = input()
strList = list(S)
strSet = set(strList)
minTime = 1000000 
for c in strSet:
    time = convertList(strList, c)
    if minTime > time:
        minTime = time
print(minTime)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = list(map(int, input().split()))
v = list(map(int, input().split()))

T = sum(t)

def f(l, r, v, x):
	maxv = 0
	if 0 <= x and x < l:
		maxv = v + l - x
	elif l <= x and x <= r:
		maxv = v
	else:
		maxv = v + x - r
	return maxv

def vel(x):
	minv = f(0, 0, 0, x)
	minv = min(minv, f(T, T, 0, x))
	l = 0
	r = 0
	for i in range(len(t)):
		r += t[i]
		minv = min(minv, f(l, r, v[i], x))
		l += t[i]
	return minv

area = 0
for i in range(T):
	area += 0.25 * (vel(i) + 2 * vel(i+0.5) + vel(i+1))

print(area)

Fixed submission:
old = int(input())
new = int(input())
print(2*new-old)
Buggy python submission (verdict: Runtime Error):
from functools import reduce

from math import gcd

x, y = list(map(int, input().split()))


def lcm(*numbers):
    def lcm(a, b):
        return (a * b) // gcd(a, b)

    return reduce(lcm, numbers, 1)


a = lcm(x, y) - x

print(-1 if a == 0 else a)


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


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


def lcm(a, b): return a * b // gcd(a, b)


a = lcm(x, y) - x

print(-1 if a == 0 else a)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split(" "))

if N == 1 and M == 1:
    print(1)

else if N == 1:
    print(M - 2)

else if M == 1:
    print(N - 2)

else:
    print((M - 2)*(N -2))


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

print(abs((N - 2) * (M - 2)))
Buggy python submission (verdict: Runtime Error):
a, b, c = input.split()

print(a[0] + b[1] + c[2])

Fixed submission:
a = input()
b = input()
c = input()
print(a[0] + b[1] + c[2])

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

print(str(a[0]) + str(b[1]) + str(c[2]))

Fixed submission:
a = input()
b = input()
c = input()
print(a[0] + b[1] + c[2])

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

print(str(a[0] + str(b[1]) + str(c[2]))

Fixed submission:
a = input()
b = input()
c = input()
print(a[0] + b[1] + c[2])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())

N %= 500

if N <= a:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
a = int(input())
n%=500

if n<=a:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
X, A, B = map(int, iput().split())

def cake(X, A, B):
  X -= A
  a = X//B
  X -= a*B
  return X

print(cake(X, A, B))


Fixed submission:
import sys

def main():
  input = sys.stdin.readline
  X = int(input())
  A = int(input())
  B = int(input())
  
  print((X-A)%B)
  
if __name__ == '__main__':
  main()

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

def cake(X, A, B):
  X -= A
  a = X//B
  X -= a*B
  return X

print(cake(X))

Fixed submission:
import sys

def main():
  input = sys.stdin.readline
  X = int(input())
  A = int(input())
  B = int(input())
  
  print((X-A)%B)
  
if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == X:
        ans += 1

print(ans)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == x:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
if 50=>A=>0 and 50=>B=>0 and 50=>C=>0 and (A+B+C)=>1 and 50=<X=<20000 and X%50==0:
  for i in range(A+1):
    for j in range(B+1):
      for k in range(C+1):
        if 500*i + 100*j + 50*k == X:
          res += 1
print(res)


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == x:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = int(input())

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 = int(input('a= '))
b = int(input('b= '))

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):
import math
n = input()
a = list(map(int, iput().split()))
ans = float('inf')
for i in a:
  ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
print(round(ans))

Fixed submission:
N = input()
A = list(map(int, input().split()))
cnt = 0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, b = map(int, input().split())
print([str(x // 1000) == str(x % 100)[::-1] for x in range(a, b+1)].count(True))


Fixed submission:
# -*- coding: utf-8 -*-

print(input()[0] + input()[1] + input()[2])

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, b = map(int, input().split())
n = 0

for i in range(a, b+1):
    if i // 10000 == i % 10 and (i // 1000) % 10 == (i % 100) // 10:
        n += 1

print(n)


Fixed submission:
# -*- coding: utf-8 -*-

print(input()[0] + input()[1] + input()[2])

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
cnt=0
for i in range(A, B+1) :
    str_i=str(i)
    rev_i=str_i[::-1]
    t=len(str_i)//2
    if len(str_i)%2==1 and str_i[:t+1] == rev_i[:t+1] :
        cnt=cnt+1
print(cnt)

Fixed submission:
a=input()
b=input()
c=input()
print(a[0]+b[1]+c[2])

Buggy python submission (verdict: Runtime Error):
x = input().split(" ")
n = int(x[0])
k = int(x[1])
count = 0

for b in range(1, n+1):
    p = n/b
    r = n % b
    count += p*max(0, b-k)
    count += max(0, r-k+1)
    
print(count)


Fixed submission:
x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])

Buggy python submission (verdict: Runtime Error):
x = raw_input()
y = raw_input()
z = raw_input()
print(x[0]+y[1]+z[2])

Fixed submission:
x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])

Buggy python submission (verdict: Runtime Error):
x = raw_input()
print(x[0][0]+x[1][1]+x[2][2])

Fixed submission:
x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])

Buggy python submission (verdict: Runtime Error):
x = input()
print(x[0][0]+x[1][1]+x[2][2])

Fixed submission:
x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])
Buggy python submission (verdict: Runtime Error):
x = input()
y = input()
count = 0
for i in range(int(x), int(y)):
    if(str(i) == str(i)[::-1]):
        count += 1

print(count)

Fixed submission:
x = input().split(" ")
count = 0
for i in range(int(x[0]), int(x[1])+1):
    if(str(i) == str(i)[::-1]):
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
x = input()
y = input()
count = 0
for i in range(int(x), int(y)):
    if(str(i) == str(i[::-1])):
        count += 1

print(count)

Fixed submission:
x = input().split(" ")
count = 0
for i in range(int(x[0]), int(x[1])+1):
    if(str(i) == str(i)[::-1]):
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
x = int(input().split(" "))
if x[0] == 1 and x[1] == 1:
    count =1
elif x[0] == 1 or x[1] == 1:
    count = max(x[0], x[1])-2
else:
    count = (x[0]-2)*(x[1]-2)
print(count)

Fixed submission:
list = input().split(" ")
x = [int(y) for y in list]
if x[0] == 1 and x[1] == 1:
    count =1
elif x[0] == 1 or x[1] == 1:
    count = max(x[0], x[1])-2
else:
    count = (x[0]-2)*(x[1]-2)
print(count)
Buggy python submission (verdict: Runtime Error):
a = []
for i in range(3):
   	a.append(input())
o = a[0,0] + a[1,1] + a[2,2]
print(o)

Fixed submission:
a = []
for i in range(3):
   	a.append(input())
o = a[0][0] + a[1][1] + a[2][2]
print(o)

Buggy python submission (verdict: Runtime Error):
a = []
for i in range(3):
  	a.append(Input())
o = a[0,0] + a[1,1] + a[2,2]
print(o)

Fixed submission:
a = []
for i in range(3):
   	a.append(input())
o = a[0][0] + a[1][1] + a[2][2]
print(o)

Buggy python submission (verdict: Runtime Error):
a = []
for i in range(3)
	a.append(Input())
o = a[0,0] + a[1,1] + a[2,2]
print(o)

Fixed submission:
a = []
for i in range(3):
   	a.append(input())
o = a[0][0] + a[1][1] + a[2][2]
print(o)

Buggy python submission (verdict: Runtime Error):
ans = ""
for i in range(3):
 s = raw_input().split(" ")
 ans += s[i]
print ans

Fixed submission:
ans = ""
for i in range(3):
 s = raw_input()
 ans += s[i]
print ans
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int,input().split()))

count = 0

for i in range(a, b + 1):
    work_i = i
    n = 1
    while work_i >= 10:
        n++ 
        work_i = int(work_i / 10)

    flag = True
    for j in range(int(n/2)):
        if int(i / 10**j) % 10 != int(i / 10**(n-j-1)) % 10:
            flag = False

    if flag:
        count++

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

count = 0

for i in range(a, b + 1):
    work_i = i
    n = 1
    while work_i >= 10:
        n += 1
        work_i = int(work_i / 10)

    flag = True
    for j in range(int(n/2)):
        if int(i / 10**j) % 10 != int(i / 10**(n-j-1)) % 10:
            flag = False

    if flag:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split(' '))
cards = N * M

if N > 1 and M > 1:
    front = (N-1)*2 + (M-1)*2
    print(cards - front)
elif N == 1 and M == 1:
    print(1)
else:
    print(max(N, M) - 2)


Fixed submission:
c = [input(), input(), input()]
print(c[0][0] + c[1][1] + c[2][2])

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

c = []
for i in range(3):
    c.append(input().split())

for i in range(3):
    print(c[i][i], end='')

Fixed submission:
# -*- coding: utf-8 -*-

c = []
for i in range(3):
    c.append(list(input()))

for i in range(3):
    print(c[i][i], end='')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n,y = map(int,input().split())
for i in xrange(n+1):
    for j in xrange(n-i+1):
        k = n-i-j
        if y == 10000*i + 5000*j + 1000*(k):
            print('{0} {1} {2}'.format(i,j,k))
            exit()
print('-1 -1 -1')

Fixed submission:
# -*- coding: utf-8 -*-

year, mon, day = input().split('/')
if year != 2018:
    year = 2018
print('{0}/{1}/{2}'.format(year,mon,day))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n,y = map(int,input().split())
for i in range(n+1):
    for j in range(n-i+1):
        k = n-i-j
        if y == 10000*i + 5000*j + 1000*(k):
            print('{0} {1} {2}'.format(i,j,k))
            exit()
print('-1 -1 -1')

Fixed submission:
# -*- coding: utf-8 -*-

year, mon, day = input().split('/')
if year != 2018:
    year = 2018
print('{0}/{1}/{2}'.format(year,mon,day))
Buggy python submission (verdict: Runtime Error):
def main():
    a1 = input().split()[0]
    a2 = input().split()[1]
    a3 = input().split()[2]

    print (a1+a2+a3)


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



Fixed submission:

def main():
    a1 = input()[0]
    a2 = input()[1]
    a3 = input()[2]

    print (a1+a2+a3)


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()
Buggy python submission (verdict: Runtime Error):
import itertools
import pandas as pd
import math 
from collections import defaultdict as dd
import numpy as np
import pandas as pd
def main():
	a = int(input())
	b = int(input())
	c = int(input())
	x = int(input())

	count = 0
	for i in range(a+1):
		y = x- 500*i
		if y == 0:
			count += 1
			continue
		if y > 0:
			for j in range(b+1):
				z = y - j*100
				if z == 0:
					count += 1
					continue
				if z > 0:
					for k in range(c+1):
						if int(z-50*k) == 0:
							count += 1
							break

	print (count)

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



Fixed submission:
def main():
	a, b, c, x = (int(input()), int(input()), int(input()), int(input()))

	count = 0
	for i in range(a+1):
		y = x- 500*i
		if y == 0:
			count += 1
			continue
		if y > 0:
			for j in range(b+1):
				z = y - j*100
				if z == 0:
					count += 1
					continue
				if z > 0:
					for k in range(c+1):
						if int(z-50*k) == 0:
							count += 1
							break

	print (count)

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Buggy python submission (verdict: Runtime Error):
from test import set_stdin_sandbox
set_stdin_sandbox("at87")

from pydoc import help# {{{
import re
from scipy import integrate
from operator import itemgetter
from collections import Counter
from collections import deque
import fractions
from heapq import heappop, heappush, heapify
import sys
import array
from copy import deepcopy as dcopy
from scipy.special import factorial
import sympy
import time
# }}}

from bisect import bisect_left, bisect_right, insort_left, insort_right

import numpy as np

import itertools
import pandas as pd
import math 
from collections import defaultdict as dd
import numpy as np
import pandas as pd
def main():
	a = int(input())
	b = int(input())
	c = int(input())
	x = int(input())

	count = 0
	for i in range(a+1):
		y = x- 500*i
		if y == 0:
			count += 1
			continue
		if y > 0:
			for j in range(b+1):
				z = y - j*100
				if z == 0:
					count += 1
					continue
				if z > 0:
					for k in range(c+1):
						if int(z-50*k) == 0:
							count += 1
							break

	print (count)

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



Fixed submission:
def main():
	a, b, c, x = (int(input()), int(input()), int(input()), int(input()))

	count = 0
	for i in range(a+1):
		y = x- 500*i
		if y == 0:
			count += 1
			continue
		if y > 0:
			for j in range(b+1):
				z = y - j*100
				if z == 0:
					count += 1
					continue
				if z > 0:
					for k in range(c+1):
						if int(z-50*k) == 0:
							count += 1
							break

	print (count)

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()
Buggy python submission (verdict: Runtime Error):
import numpy as np

import itertools

import math 
from collections import defaultdict as dd
def main():
    N, Y = map(int, input().split())
    a = int(Y/10000)

    if a*10000 == Y:
        print (a,0,0)
        return

    s = -1
    for k in range(a+1):
        b = N-k
        if b >= 0:
            for j in range(b+1):
                s = 10000*k+5000*j+1000*(b-j)
                if s == Y:
                    print (k,j,(b-j))
                    return

    if s != Y:
        print ('-1 -1 -1')



if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()


Fixed submission:
s  = input()
print ('2018'+s[4:])
Buggy python submission (verdict: Time Limit Exceeded):

def main():
    N, K = map(int, input().split())
    A = sorted(list(map(int, input().split())))

    count = 1
    num = 0
    dic = {}
    for a in A:
        if num == a:
            count += 1

        elif num > 0:
            dic.update({num:count})
            count = 1

        num = a

    dic.update({num:count})

    count = 0
    for i in range(len(dic.keys())-K):
        count += (sorted(dic.items(), key= lambda x:x[1])[i][1])

    print (count)


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



Fixed submission:

def main():
    N, K = map(int, input().split())
    A = sorted(list(map(int, input().split())))

    count = 1
    num = 0
    dic = {}
    for a in A:
        if num == a:
            count += 1

        elif num > 0:
            dic.update({num:count})
            count = 1

        num = a

    dic.update({num:count})

    sort_dic = sorted(dic.items(), key= lambda x:x[1])

    count = 0
    keys = len(dic.keys())
    for i in range(keys-K):
        count += sort_dic[i][1]

    print (count)


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import DataFrame

k = raw_input()
n = raw_input()
a = [int(i) for i in n.split()]
a.sort()

sum1 = 0
for i in range(int(k)):
    sum1 += min(a[2*i], a[2*i+1])
    print sum1

Fixed submission:
k = raw_input()
n = raw_input()
a = [int(i) for i in n.split()]
a.sort()

sum1 = 0
for i in range(int(k)):
    sum1 += min(a[2*i], a[2*i+1])
print sum1
Buggy python submission (verdict: Runtime Error):
print(len(set(input.split())))

Fixed submission:
print(len(set([x for x in input().split()])))
Buggy python submission (verdict: Runtime Error):
S_a, S_b, S_c = [input() for _ in range(3)]
trun = 'a'
relation = {'a': S_a, 'b': S_b, 'c': S_c}
while True:
  card = relaton[turn].pop(0)
  turn = card
  
  if len(S_a) == 0:
    print('A')
    exit()
  if len(S_b) == 0:
    print('B')
    exit()
  if len(S_c) == 0:
    print('C')
    exit()

Fixed submission:
S_a, S_b, S_c = map(list, [input() for _ in range(3)])
turn = 'a'
relation = {'a': S_a, 'b': S_b, 'c': S_c}
while True: 
  if turn == 'a' and len(S_a) == 0:
    print('A')
    exit()
  if turn == 'b' and len(S_b) == 0:
    print('B')
    exit()
  if turn == 'c' and len(S_c) == 0:
    print('C')
    exit()
  
  card = relation[turn].pop(0)
  turn = card
Buggy python submission (verdict: Runtime Error):
S = input()
print("Yes" if all([S.count(e) % 2 == 0 for e in set(S)] else "No"))

Fixed submission:
S = input()
S_elements = set(S)
for e in S_elements:
  if S.count(e) % 2 != 0:
    print("No")
    exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
S = input()
S_elements = set(s)
for e in S_elements:
  if S.count(e) % 2 != 0:
    print("No")
    exit()
print("Yes")

Fixed submission:
S = input()
S_elements = set(S)
for e in S_elements:
  if S.count(e) % 2 != 0:
    print("No")
    exit()
print("Yes")