Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03962 (python)

Fixed submission:
lst = [x for x in input().split(" ")]
s = set(lst)
print(len(s))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
c_t = 0
c_a = 0
for i in range(n):
    t, a = [int(x) for x in input().split(" ")]
    #print(min(c_t / t, c_a / a))
    init = int(math.floor(max(c_t / t, c_a / a, 1)))
    for j in range(init,10**18):
        if t*j >= c_t and a*j >= c_a:
            c_t = t*j
            c_a = a*j
            #print("->" + str(j))
            break
print(c_t + c_a)
Problem p03962 (python)

Fixed submission:
cans = set(map(int, raw_input().split()))
print len(cans)

Buggy submission (verdict: Runtime Error):
cans = set(map(int, raw_input().split()))
return len(cans)
Problem p03970 (python)

Fixed submission:
s = raw_input()
orig = 'CODEFESTIVAL2016'

result = 0
for i in range(len(s)):
  if orig[i] != s[i]:
    result += 1

print result

Buggy submission (verdict: Runtime Error):
s = raw_input()
orig = 'CODEFESTIVAL2016'

result = 0
for i in len(s):
  if orig[i] != s:
    result += 1

print result
Problem p03992 (python)

Fixed submission:
s = raw_input()

print "%s %s" % (s[:4], s[4:])

Buggy submission (verdict: Runtime Error):
def needed_to_flip(c):
    return ord('z') - ord(c) + 1

s = list(raw_input())
K = int(raw_input())
#s = list('za')
#K = 4


for i, c in enumerate(s):
	if c == 'a':
		continue
	needed = needed_to_flip(c)
	#print "%s: needed: %d, has: %d" % (c, needed, K)
	if K >= needed:
		K -= needed
		s[i] = 'a'
		
	#print "flip: %s needed: %d, has: %d" % (s[i], needed,K) 
	if i == len(s) - 1:
		s[i] = chr(ord(s[i]) + (K % 26))

print ''.join(s)
Problem p03962 (python)

Fixed submission:
l = raw_input().split()
map_ = {}
for data in l:
    map_[l[0]] = 1
    map_[l[1]] = 1
    map_[l[2]] = 1
print len(map_)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
t = [[0,0] for i in range(N)]
for i in range(N):
    l = []
    l = raw_input().split()
    t[i][0] = int(l[0])
    t[i][1] = int(l[1])
min_ = [0,0]
min_[0] = t[0][0]
min_[1]= t[0][1]
for i in range(1,N):
    if min_[0] > min_[1]:
        large_index = 0
    else:
        large_index = 1
    cnt = 1
    while cnt*t[i][large_index]<min_[large_index]:
        cnt = cnt+1
    min_[0] = cnt*t[i][0]
    min_[1] = cnt*t[i][1]
print min_[0]+min_[1]

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
map_ = {}
map_[a] = 1
map_[b] = 1
map_[c] = 1
print len(map_)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

map_ = {}
map_[a] = 1
map_[b] = 1
map_[c] = 1

print len(map_)
Problem p03962 (python)

Fixed submission:
import sys

def input_num():
    num = input().split()
    return num

def num_serch(num):
    penki_num = len(num)
    if num[0] == num[1]:
        penki_num = penki_num - 1
    if num[0] == num[2]:
        penki_num = penki_num - 1
    if num[1] == num[2]:
        penki_num = penki_num - 1

    if penki_num == 0:
        penki_num = penki_num + 1

    print(penki_num)

if __name__ == '__main__':
    num = input_num()
    num_serch(num)

Buggy submission (verdict: Runtime Error):
import sys

def input_num():
    num = input().split()
    return num

def num_serch(num):
    penki_num = len(num)
    for j, i in enumerate(num):
        if i == num[j+1]:
            penki_num = penki_num - 1
        if j == penki_num - 1:
            break

    print(penki_num)

if __name__ == '__main__':
    num = input_num()
    num_serch(num)
Problem p03962 (python)

Fixed submission:
n = list(map(int, input().split()))
i = 3

if n[0] == n[1] :
    i -= 1

if n[0] == n[2] :
    i -= 1

elif n[1] == n[2] :
    i -= 1

print(i)

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

if n[0] == n[1] :
    i -= 1

if n[0] == n[2] :
    i -= 1

elif n[1] == n[2] :
    i -= 1

print(i)
Problem p03970 (python)

Fixed submission:
S = raw_input()
answer = 0
model = "CODEFESTIVAL2016"
for x in range(16):
    if S[x] != model[x]:
        answer += 1
print answer

Buggy submission (verdict: Runtime Error):
S = raw_input()
answer = 0
model = "CODEFESTIVAL2016"
for x range(15):
    if S[x] != model[x]:
        answer += 1
print answer
Problem p03993 (python)

Fixed submission:
N = int(raw_input())
likes = map(int, raw_input().split())
pairs = 0
counter = 0
rabbit = 1
while counter < N:
    if likes[(likes[counter] - 1)] == rabbit:
        pairs += 1
        rabbit += 1
        counter += 1
    else:
        rabbit += 1
        counter += 1
pairs = pairs / 2
print pairs

Buggy submission (verdict: Runtime Error):
N = raw_input()
likes = raw_input()
pairs = 0
counter = 0
rabbit = 1
while counter < (int(N) * 2):
    if int(likes[((int(likes[counter]) -1 ) * 2)]) == rabbit:
        pairs += 1
        rabbit += 1
        counter += 2
    else:
        rabbit += 1
        counter += 2
pairs = pairs / 2
print pairs

Buggy submission (verdict: Runtime Error):
N = raw_input()
likes = raw_input()
pairs = 0
counter = 0
rabbit = 1
while counter < (int(N) * 2):
    if int(likes[((int(likes[counter]) -1 ) * 2)]) == rabbit:
        pairs += 1
        rabbit += 1
        counter += 2
    else:
        rabbit += 1
        counter += 2
pairs = pairs / 2
print pairs
Problem p03997 (python)

Fixed submission:
a = int(raw_input())
b = int(raw_input())
h = int(raw_input())
print (((a + b) * h) / 2)

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
h = int(raw_input())
return ((a + b) / 2) * h
Problem p03963 (python)

Fixed submission:
N, K = map(int, input().split())
result = K
for i in range(N-1) :
    result = result * (K -1)
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
result = K
for i in range(N-1) :
    result = result * (K -1)
print(result)
Problem p04019 (python)

Fixed submission:
import collections
s = input()
C = collections.Counter(list(s))

if ((C['N'] > 0) == (C['S'] > 0)) and ((C['E'] > 0) == (C['W'] > 0)):
    print("Yes")
else:
    print("No")

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

p_max = int(10**(10./3))

marked = [True]*2+[False]*(p_max-2)
ps = []

for n in range(2,p_max):
    if marked[n]:
        continue
    ps.append(n)
    for n2 in range(n, p_max):
        if n2 % n == 0:
            marked[n2] = True

def getexp(n, p):
    ans = 0
    while n > 1 and n % p == 0:
        ans += 1
        n = n // p
    return ans

def getcanon(n):
    canon = []
    for p in ps:
        if n == 1:
            return tuple(canon)
        e = getexp(n, p)
        n = n//(p**e)
        if e % 3 != 0:
            canon.append((p, e % 3))
    sqr = int(math.sqrt(n+0.5))
    if sqr**2 == n:
        canon.append((sqr, 2))
    else:
        canon.append((n,1))
    return tuple(canon)

def getcomp(canon):
    return tuple([(p,3-e) for (p,e) in canon])


N = int(raw_input())
s = [int(raw_input()) for i in range(N)]

ctr = collections.Counter()

for si in s:
    ctr[getcanon(si)] += 1

ans = 0

cans = list(ctr.keys())

for can in cans:
    ct = ctr[can]
    if ct == 0:
        continue
    if can == ():
        ans += 1
        ctr[can] = 0
        continue
    comp = getcomp(can)
    c_ct = ctr[comp]
    if c_ct == 0:
        ans += ct
    else:
        ans += max(ct, c_ct)
        ctr[comp] = 0

print ans
Problem p03970 (python)

Fixed submission:
correct_str_array = 'CODEFESTIVAL2016'
mistake_str_array = raw_input()
rewrite_count = 0
for n in range(0, 16):
    if(correct_str_array[n] != mistake_str_array[n]):
        rewrite_count = rewrite_count + 1
print rewrite_count

Buggy submission (verdict: Runtime Error):
NAB = map(int, raw_input().split())
N = NAB[0]
A = NAB[1]
B = NAB[2]
S = raw_input()

passed_student = 0
for n in range(0, N):
    if(A+B > passed_student):
        if(S[n] == 'a'):
            print 'Yes'
            passed_student = passed_student + 1
        elif(S[n] == 'b'):
            if(B >= n):
                print 'Yes'
                passed_student = passed_student + 1
            else: print 'No'    
        else: print 'No'
    else: print 'No'
Problem p03970 (python)

Fixed submission:
import sys


def dump(x):
    print >> sys.stderr, "{0}".format(x)

S = raw_input()
correct = "CODEFESTIVAL2016"
false_count = 0

for i in range(min(len(S), len(correct))):
    if S[i] != correct[i]:
        false_count += 1

print(false_count)

Buggy submission (verdict: Runtime Error):
import os
import sys
import ipdb


def dump(x):
    print >> sys.stderr, "{0}".format(x)

S = raw_input()
correct = "CODEFESTIVAL2016"
false_count = 0
for i, s in enumerate(S):
    if s != correct[i]:
        false_count += 1

print(false_count)
Problem p03970 (python)

Fixed submission:
s=list(raw_input())
c=list("CODEFESTIVAL2016")
t=0
for i in range(16):
    if s[i]!=c[i]:
        t+=1
print(t)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,raw_input().split())
ab=a+b
s=list(raw_input())
p=0
r=[]
ro=0
for i in range(n):
    if s[i]=="a" and p<ab:
        r.append("Yes")
        p+=1
    elif s[i]=="b" and p<ab and ro<b:
        ro+=1
        p+=1
        r.append("Yes")
    elif s[i]=="c":
        r.append("No")
    else:
        r.append("No")
for i in range(n):
    print(r[i])
Problem p03970 (python)

Fixed submission:
# -*- coding: utf-8 -*-
ss = 'CODEFESTIVAL2016'
s = raw_input()
res = 0
for x in xrange(len(ss)):
    if ss[x] != s[x]:
        res += 1

print res

Buggy submission (verdict: Runtime Error):
args = list(map(lambda x: int(x), raw_input().split()))
N = args[0]
A = args[1]
B = args[2]
s = input()

a = 0
b = 0
for i in range(0, len(s)):
    if s[i] == 'a':
        if a + b < A + B:
            a = a + 1
            print('Yes')
        else:
            print('No')
    elif s[i] == 'b':
        if a + b < A + B and b < B:
            b = b + 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')
Problem p03971 (python)

Fixed submission:
args = input().split()
N = int(args[0])
A = int(args[1])
B = int(args[2])
s = input()

a = 0
b = 0
for i in range(0, len(s)):
    if s[i] == 'a':
        if a + b < A + B:
            a = a + 1
            print('Yes')
        else:
            print('No')
    elif s[i] == 'b':
        if a + b < A + B and b < B:
            b = b + 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
args = list(map(lambda x: int(x), raw_input().split()))
N = args[0]
A = args[1]
B = args[2]
s = input()

a = 0
b = 0
for i in range(0, len(s)):
    if s[i] == 'a':
        if a + b < A + B:
            a = a + 1
            print('Yes')
        else:
            print('No')
    elif s[i] == 'b':
        if a + b < A + B and b < B:
            b = b + 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
args = list(map(lambda x: int￼(x), input().split()))
N = args[0]
A = args[1]
B = args[2]
s = input()

a = 0
b = 0
for i in range(0, len￼(s)):
    if s[i] == 'a':
        if a + b < A + B:
            a = a + 1
            print('Yes')
        else:
            print('No')
    elif s[i] == 'b':
        if a + b < A + B and b < B:
            b = b + 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
args = list(map(lambda x: int(x)￼, input().split()))
N = args[0]
A = args[1]
B = args[2]
s = input()

a = 0
b = 0
for i in range(0, len￼(s)):
    if s[i] == 'a':
        if a + b < A + B:
            a = a + 1
            print('Yes')
        else:
            print('No')
    elif s[i] == 'b':
        if a + b < A + B and b < B:
            b = b + 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')
Problem p03970 (python)

Fixed submission:
correct = "CODEFESTIVAL2016"
wrong = raw_input()
count = 0

for i in range(16):
  if correct[i] != wrong[i]:
    count += 1

print count

Buggy submission (verdict: Runtime Error):
correct_str = "CODEFESTIVAL2016"
wrong_str = raw_input()
count = 0
for i in range(16):
  if wrong_str[i] != correct_str[i]:
    count count += 1

print str(count)
Problem p03970 (python)

Fixed submission:
dst = 'CODEFESTIVAL2016'
src = raw_input()
print sum(1 for i in range(len(dst)) if dst[i] != src[i])

Buggy submission (verdict: Runtime Error):
dst = 'CODEFESTIVAL2016'
src = raw_input()
print sum(1 for i in range(len(dst))) if dst[i] != src[i] )
Problem p03970 (python)

Fixed submission:
 # -*- coding: utf-8 -*-
correct = 'CODEFESTIVAL2016'
wrong = raw_input()
sum = 0
for index in xrange(0, len(wrong)):
    if correct[index] != wrong[index]:
        sum += 1
print sum

Buggy submission (verdict: Runtime Error):
 # -*- coding: utf-8 -*-
correct = 'CODEFESTIVAL2016'
wrong = str(raw_input())
sum = 0
for index in xrange(0, len(wrong)):
    if correct[i] != wrong[i]:
        sum += 1
print sum
Problem p03971 (python)

Fixed submission:
# -*- coding: utf-8 -*-
input_line_1 = raw_input()
fields = input_line_1.split()
N = int(fields[0])
A = int(fields[1])
B = int(fields[2])
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	elif every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
input_line_1 = raw_input()
fields = input_line_1.split()
N = fields[0]
A = fields[1]
B = fields[2]
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	elif every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
input_line_1 = raw_input()
fields = input_line_1.split()
N = fields[0]
A = fields[1]
B = fields[2]
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	else if every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'
Problem p03975 (python)

Fixed submission:
N, A, B = map(int, raw_input().split())
#t_li = []
cnt = 0
for i in range(N):
    if A <= int(raw_input()) < B:
        cnt +=1
#    t_li.append(raw_input())

print N-cnt

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, raw_input().split())
#t_li = []
cnt = 0
for i in range(len(N)):
    if A <= int(raw_input()) < B:
        cnt +=1
#    t_li.append(raw_input())

print N-cnt
Problem p03992 (python)

Fixed submission:
# -*- coding: utf-8 -*-
raw = raw_input()

ans =  raw[:4]+' '+raw[4:]

print ans

Buggy submission (verdict: Runtime Error):
input()
K = int(raw_input())
s_list = list(s)
for i in range(len(s_list)):
    # how long does it take to force a
    lag = ord('z') - ord(s_list[i]) + 1
    if s_list[i] != 'a' and K >= lag and i < len(s_list) - 1:
        # not a and can conv
        s_list[i] = 'a'
        K -= lag
    elif i == len(s_list) - 1:
        s_list[i] = chr(ord('a') + ((ord(s_list[i]) - ord('a') + K) % 26))
print "".join(s_list)

Buggy submission (verdict: Runtime Error):
s=raw_input()
K=int(raw_input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)+K >= 123:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print"".join(s)

Buggy submission (verdict: Runtime Error):
s=raw_input()
K=int(raw_input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)+K >= 123:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print("".join(s))

Buggy submission (verdict: Runtime Error):
s=input()
K=int(input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)+K >= 123:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print("".join(s))

Buggy submission (verdict: Runtime Error):
s=input()
K=int(input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)+K >= 123:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print("".join(s))

Buggy submission (verdict: Runtime Error):
s=input()
K=int(input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)+K >= 123:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print ("".join(s))

Buggy submission (verdict: Runtime Error):
s=input()
K=int(input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)-K <= 97:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print ("".join(s))

Buggy submission (verdict: Runtime Error):
s=input()
K=int(input())
s=list(s)
#a-z 97-122
for i in range(len(s)):
    if s[i]!='a':
        if ord(s[i])+K < 123:
            continue
        else:
            K-=(123-ord(s[i]))
            s[i]='a'
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print ("".join(s))
Problem p03993 (python)

Fixed submission:
size = int(input())
rabbits = list(map(int, input().split()))
count = 0
for i in range(size):
    if (rabbits[i] - 1) > i and (rabbits[rabbits[i]-1] - 1) == i:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
size = int(raw_input())
rabbit_list = raw_input().split()
rabbits = [int(x) for x in rabbits_input]
count = 0
for i in range(size):
    if (rabbits[i] - 1) > i and (rabbits[rabbits[i]-1] - 1) == i:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
size = int(input())
rabbit_list = input().split()
rabbits = [int(x) for x in rabbits_input]
count = 0
for i in range(size):
    if (rabbits[i] - 1) > i and (rabbits[rabbits[i]-1] - 1) == i:
        count += 1
print(count)
Problem p03992 (python)

Fixed submission:
txt = raw_input()
print txt[:4], txt[4:]

Buggy submission (verdict: Runtime Error):
s = bytearray(raw_input())
N = int(raw_input())
dis = [ord('z')-c for c in s]

for idx, d in enumerate(dis[:-1]):
    if d+1 <= N:
        s[idx] = 'a'
        N -= (d+1)
if N > 0:
    N %= 26
    t = (dis[-1]-N) % 26
    s[-1] = chr(ord('z') - t)
print s

Buggy submission (verdict: Runtime Error):
s = raw_input()
N = int(raw_input())
dis = [ord('z')-ord(c) for c in s]
for idx, d in enumerate(dis[:-1]):
    if d <= N:
        s[idx] = 'a'
        N -= d
if N > 0:
    N %= 27
    t = (dis[-1]-N) % 27
    s[-1] = chr(ord('z') - t)
print s
Problem p03994 (python)

Fixed submission:
s = bytearray(raw_input())
N = int(raw_input())
dis = [ord('z')-c for c in s]

for idx, d in enumerate(dis[:-1]):
    if d!=25 and d+1 <= N:
        s[idx] = 'a'
        N -= (d+1)

if N > 0:
    N %= 26
    t = (dis[-1]-N) % 26
    s[-1] = chr(ord('z') - t)
print s

Buggy submission (verdict: Runtime Error):
s = raw_input()
N = int(raw_input())
dis = [ord('z')-ord(c) for c in s]
for idx, d in enumerate(dis[:-1]):
    if d <= N:
        s[idx] = 'a'
        N -= d
if N > 0:
    N %= 27
    t = (dis[-1]-N) % 27
    s[-1] = chr(ord('z') - t)
print s

Buggy submission (verdict: Runtime Error):
s = raw_input()
N = int(raw_input())
dis = [ord('z')-ord(c) for c in s]
for idx, d in enumerate(dis[:-1]):
    if d <= N:
        s[idx] = 'a'
        N -= d
if N > 0:
    N %= 27
    t = (dis[-1]-N) % 27
    s[-1] = chr(ord('z') - t)
Problem p03993 (python)

Fixed submission:
n = int(input())
a = map(int, input().split())
 
d = {i+1: j for (i,j) in enumerate(a)}
 
sum = 0
for x in range(n):
    if( x+1 == d[d[x+1]]):
        sum += 1
 
print(sum//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
 
d = {i+1: j for (i,j) in enumerate(a)}
 
sum = 0
for x in range(n):
    if( x == d[d[x]]):
        sum += 1
 
print(sum//2)

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

d = {i+1: j for (i,j) in enumerate(a)}

sum = 0
for x in range(n):
    if( x == d[d[x]]):
        sum += 1

print sum//2
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*(h//2))

Buggy submission (verdict: Runtime Error):
a = int(input)
b = int(input)
h = int(input)
print((a+b)*(h/2))
Problem p04047 (python)

Fixed submission:
N = int(input())
L = [int(x) for x in input().split()]
list.sort(L)
sum = 0
for i in range(0,len(L),2):
	sum += L[i]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
sort(L)
sum = 0
for i in range(0,len(L),2):
	sum += L[i]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
sort(L)
sum = 0
for i in range(0,N):
    sum += L[i*2]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
sort(L)
sum = 0
for i in range(0,len(L),2):
    sum += L[i]
print(sum)
Problem p03992 (python)

Fixed submission:
mystring = raw_input()
print mystring[0:4] + " " + mystring[4:]

Buggy submission (verdict: Runtime Error):
mystring = raw_input()
string_arr = []
q = int(raw_input())
for char in mystring:
	string_arr.append(char)
for i in range(0,len(string_arr)):
	val = ord('z') - ord(string_arr[i]) + 1
	if val <= q:
		string_arr[i] = 'a'
		q = q-val
if q!=0:
	q=q%26
	string_arr[len(string_arr)-1] = chr(ord('a')+(ord(string_arr[i])+q)%ord('a'))
print "".join(string_arr)
Problem p03992 (python)

Fixed submission:
s=input()
print(s[:4]+ " "+s[4:])

Buggy submission (verdict: Runtime Error):
s = raw_input()
print s[0:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
       S="CODEFESTIVAL"
	print (S[:4].upper() + " " + S[4:].upper())
       S="POSTGRADUATE"
	print (S[:4].upper() + " " + S[4:].upper())
       S="ABCDEFGHIJKL"
        print (S[:4].upper() + " " + S[4:].upper())

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
	print (S[:4].upper() + " " + S[4:].upper())

Buggy submission (verdict: Runtime Error):
import sys
if __name__ == "__main__":
	S = sys.argv[1]
	print (S[:4] + " " + S[4:])

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
	S = S[0:4] + " " + S[4:]
Problem p04029 (python)

Fixed submission:
A = 0
S = input()
for n in range(1,int(S)+1):
 A = A + n
print(A)

Buggy submission (verdict: Runtime Error):
A = 0
S = input()
fot n in range(1,int(S)+1):
 A = A + n
print(A)

Buggy submission (verdict: Runtime Error):
A = 0
S = input()
fot n in range(1,int(S)+1):
 A = A + n

Buggy submission (verdict: Runtime Error):
A = 0
S = input()
fot n in tange(1,int(S)+1):
 A = A + n
Problem p03993 (python)

Fixed submission:
s1 = input()
s2 = input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
    if str(s2[int(b)-1]) == str(a+1):
        f = f+1
print (int(f/2))

Buggy submission (verdict: Runtime Error):
s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
    if str(s2[int(b)-1]) == str(a+1):
        f = f+1
print f/2

Buggy submission (verdict: Runtime Error):
s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
    if str(s2[int(b)-1]) == str(a+1):
        f = f+1
print str(f/2)

Buggy submission (verdict: Runtime Error):
s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
    if str(s2[int(b)-1]) == str(a+1):
        f = f+1
print f/2

Buggy submission (verdict: Runtime Error):
s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
print s2
for a,b in enumerate(s2):
    if str(s2[int(b)-1]) == str(a+1):
        f = f+1
print f/2

Buggy submission (verdict: Runtime Error):
s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
    if s2[int(b)] == str(a):
        f++
print f

Buggy submission (verdict: Runtime Error):
s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
    if s2[b] == str(a):
        f++
print f