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

Fixed submission:
n=int(input())
s=str(input())

#n = 9
#s = "........."
#print(s)
#print(len(s))

memo = []
countwb=0
now = s[0]
count = 0
if now == "#":
    memo.append(0)
while(count<n):
    if s[count]==now:
        countwb+=1
    else:
        memo.append(countwb)
        countwb = 1
        now = s[count]
    count+=1
memo.append(countwb)
#print(memo)

memo_r=[]
for i in range(len(memo)):
    memo_r.append(memo[-1*(i+1)])
#print(memo_r)

count_w = []
c_w = 0
if len(memo_r)%2==1:
    count_w.append(0)
    for  i in range(0,len(memo_r),2):
            c_w += memo_r[i]
            count_w.append(c_w)
else:
    count_w.append(0)
    count_w.append(0)
    for  i in range(1,len(memo_r),2):
            c_w += memo_r[i]
            count_w.append(c_w)
#print(count_w)

count_b = []
count_b.append(0)
count_b.append(0)
c_b = 0
for  i in range(1,len(memo),2):
        c_b += memo[i]
        count_b.append(c_b)
#print(count_b)

count_list = []
for i in range(len(count_b)):
    temp = count_w[-1*(i+1)]+count_b[i]
    count_list.append(temp)
#print(count_list)

print(min(count_list))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=str(input())
"""n = 8
s = "#.....#."
print(s)
print(len(s))"""

memo = []
countwb=0
now = s[0]
count = 0
if now == "#":
    memo.append(0)
while(count<n):
    if s[count]==now:
        countwb+=1
    else:
        memo.append(countwb)
        countwb = 1
        now = s[count]
    count+=1
memo.append(countwb)
#print(memo)
#print(memo[len(memo)-3])


count_b = []
c_b = 0
for  i in range(1,len(memo),2):
        c_b += memo[i]
        count_b.append(c_b)
#print(count_b)

count_w = []
c_w = 0
for  i in range(0,len(memo),2):
        c_w += memo[i]
        count_w.append(c_w)
#print(count_w)

#白白．．．黒黒にする
w_b = 0
if len(memo)%2==1:
    #最後が白
    w_b += memo[-1]
    if len(count_b)>1:
        w_b += count_b[-2]
else:
    #最後が黒
    if len(count_b)>1:
        w_b += count_b[-2]
#print("w_b",w_b)
#全部白にする
allw = count_b[-1]
#print("allw",allw)
#全部黒にする
allb = count_w[-1]
#print("allb",allb)

print(min(w_b,allb,allw))
Problem p03074 (python)

Fixed submission:
#4
n,k=map(int,input().split())
s=str(input())

import numpy as np
line = np.zeros([2*n,],dtype=np.int)
counter1 = 0
counter0 = 0
ind = 0
for i in range(n):
    c = int(s[i])
    if ind%2 ==0:
        if c == 1:
            counter1 += 1
        else:
            counter0 += 1
            if ind == 0:
                line[ind] = counter1
            else:
                line[ind] = line[ind-1]+counter1
            counter1 = 0
            ind+=1
    elif ind%2 ==1:
        if c == 0:
            counter0 += 1
        else:
            counter1 += 1
            line[ind] = line[ind-1] + counter0
            counter0 = 0
            ind+=1

if ind%2 ==0:
        if ind == 0:
                line[ind] = counter1
        else:
                line[ind] = line[ind-1]+counter1
        ind+=1
elif ind%2 ==1:
        line[ind] = line[ind-1] + counter0
        ind+=1
        
if ind%2 ==0:
        line[ind] = line[ind-1]
        ind+=1
        
line[1:ind+1]  = line[:ind]   
line[0] = 0 
line = line[:ind+1]
#print(line)

if (len(line)//2)<=k:
    print(n)
else:
    maxchain = 0
    for i in range(0,len(line)-2*k,2):
        chain = line[i+2*k+1]-line[i]
        #print(chain)
        if chain>maxchain:
            maxchain=chain
    print(maxchain)

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

import numpy as np
line = np.zeros([2*n,],dtype=np.int)
counter1 = 0
counter0 = 0
ind = 0
for i in range(n):
    c = int(s[i])
    if ind%2 ==0:
        if c == 1:
            counter1 += 1
        else:
            counter0 += 1
            if ind == 0:
                line[ind] = counter1
            else:
                line[ind] = line[ind-1]+counter1
            counter1 = 0
            ind+=1
    elif ind%2 ==1:
        if c == 0:
            counter0 += 1
        else:
            counter1 += 1
            line[ind] = line[ind-1] + counter0
            counter0 = 0
            ind+=1

if ind%2 ==0:
        if ind == 0:
                line[ind] = counter1
        else:
                line[ind] = line[ind-1]+counter1
        ind+=1
elif ind%2 ==1:
        line[ind] = line[ind-1] + counter0
        ind+=1
        

line[1:ind+1]  = line[:ind]   
line[0] = 0 
line = line[:ind+1]
#print(line)

if (len(line)//2)<=k:
    print(n)
else:
    maxchain = 0
    for i in range(0,len(line)-(2*k+1)+1,2):
        chain = line[i+2*k+1]-line[i]
        #print(chain)
        if chain>maxchain:
            maxchain=chain
    print(maxchain)
Problem p03078 (python)

Fixed submission:
X,Y,Z,K = map(int,input().split())

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

A.sort(reverse=True)
A = A[0:K]
B.sort(reverse=True)
B = B[0:K]
AB = [a+b for a in A for b in B]

AB.sort(reverse=True)

AB = AB[0:K]

C.sort(reverse=True)
C=C[0:K]
ABC = [ab+c for ab in AB for c in C]

ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])

Buggy submission (verdict: Runtime Error):
x,y,z,k=map(int,input().split())
listx = [int(i) for i in input().split()]
listy = [int(i) for i in input().split()]
listz = [int(i) for i in input().split()]

import numpy as np
listxy = np.zeros([x*y,],dtype=np.int)
c = 0
for i in range(0,x):
    for j in range(0,y):
        listxy[c] = listx[i]+listy[j]
        c+=1

listxy.sort(reverse=True)
#print(listxy)
if x*y>k:
    listxy=listxy[:k]
    listxyz =np.zeros([k*z,],dtype=np.int)
    c = 0
    for i in range(0,k):
        for j in range(0,z):
            listxyz[c] = listxy[i]+listz[j]
            c+=1
else:
    listxyz =np.zeros([x*y*z,],dtype=np.int)
    c = 0
    for i in range(0,x*y):
        for j in range(0,z):
            listxyz[c] = listxy[i]+listz[j]
            c+=1

listxyz.sort(reverse=True)

for i in range(0,k):
    print(listxyz[i])
Problem p03720 (python)

Fixed submission:
n,m=map(int,input().split())
road=[list(map(int,input().split())) for i in range(m)]
 
ans={}
for i in range(m):
  sta,gol = road[i][0],road[i][1]
  if sta not in ans:
    ans[sta] = []
  ans[sta].append(gol)
  
  if gol not in ans:
    ans[gol] = []
  ans[gol].append(sta)
  
for i in range(1,n+1):
  if i in ans:
  	print(len(ans[i]))
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
import numpy as np

n,m=map(int,input().split())
road=[list(map(int,input().split())) for i in range(m)]

ans=np.unique(road,return_counts=True)
for i in range(n):
    print(ans[1,i])

Buggy submission (verdict: Runtime Error):
import numpy as np

n,m=map(int,input().split())
road=[list(map(int,input().split())) for i in range(m)]

ans=np.unique(road,return_counts=True)
for i in range(n):
    print(ans[1,i])

Buggy submission (verdict: Runtime Error):
import numpy as np

n,m=map(int,input().split())
road=[list(map(int,input().split())) for i in range(m)]

ans=np.unique(road,return_counts=True)
for i in range(n):
    print(ans[1][i])

Buggy submission (verdict: Runtime Error):
import numpy as np

n,m=map(int,input().split())
road=[list(map(int,input().split())) for i in range(m)]

ans=np.unique(road,return_counts=True)
for i in range(n):
    print(ans[1][i])
Problem p02882 (python)

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

t = 0
if (A**2)*B/X >= 2:
    t = float((A*(B**2))/(2*X))
else:
    t = float((2*(A**2)*B-2*X)/(A**3))

print(math.atan(t)*180/math.pi)

Buggy submission (verdict: Runtime Error):
import math 
A,B,X = map(int,input().split())

t = 0
if (A**2)*B/X >= 2:
    t = float((A*(B**2))/(2*X))
else:
    t = float((A**3)/(2*(A**2)*B-2*X))

print(math.atan(t)*180/math.pi)
Problem p02911 (python)

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

ans = [0]*N
for a in A:
    ans[a-1] += 1
for i in range(N):
    if K-Q+ans[i] > 0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
N,K,Q = map(int,input().split())
A = [int(input()) for _ in range(Q)]

ans = [0]*N
for a in A:
    ans[a-1] += 1
for i in range(Q):
    if K-Q+ans[i] > 0:
        print("Yes")
    else:
        print("No")
Problem p02972 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
half = n//2

ans = [0]*n
for i in range(half,n):
    if l[i] == 1:
        ans[i] = 1
for i in range(0,half):
    p = half-1-i
    s = 0
    qmax = n //(p+1)
    for j in range(1,qmax+1):
        s += ans[j*(p+1)-1]
    if s%2 != l[p]:
        ans[p] = 1
print(sum(ans))
for i in range(n):
    if ans[i] == 1:
        print(i+1,end=" ")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [[int(input()),i] for i in range(n)]
l.sort(key=lambda x:x[0])
#print(n,l)

for i in range(n):
    if l[-1][1] == i:
        print(l[-2][0])
    else:
        print(l[-1][0])
Problem p02973 (python)

Fixed submission:
import bisect

N = int(input())
A = [10**10 - int(input()) for i in range(N)]
INF = 10**12

dp = [INF for i in range(N+1)]
#print(A,dp)

for a in A:
    i = bisect.bisect_right(dp,a)
    dp[i] = a
#print(dp)
res = bisect.bisect_left(dp,INF)
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for i in range(n)]
#print(n,l)

L = 0
cnt = 0
for i in range(n):
    if l[i] >= l[i+1]:
        cnt += 1
    else:
        cnt = 0
    if L <= cnt:
        L = cnt
print(L)
Problem p02993 (python)

Fixed submission:
s = input()
c = 0

for i in range(0,3):
  if s[i] == s[i+1]:
    c += 1
if c == 0:
  print("Good")
else:
  print("Bad")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
'''for i in range(n):
  x = l[i][1] - l[i][0]
  l[i][2] = x'''
l.sort(key=lambda x: x[1])
#print(l)

check = []
c = 0
for i in range(n):
  if c != l[i][1]:
    check.append(l[i][1])
    c = l[i][1]
#print(check)

sum_t = 0
limit = l[0][1]
ans = 0
for i in range(n):
  if limit != l[i][1]:
    limit = l[i][1]
  sum_t += l[i][0]
  if sum_t > limit:
    ans += 1
#print(ans)
if ans == 0:
  print("Yes")
else:
  print("No")
Problem p03031 (python)

Fixed submission:
n,m = map(int,input().split()) #nがスイッチ、mが電球の数
s = []
sw = []
 
for i in range(m):
  x = list(map(int,input().split()))
  s.append(x)
p = list(map(int,input().split()))
#print(s,p)
 
for i in range(0,2**n): #1は点灯とする
  x = format(i, 'b')
  x = x.zfill(n)
  sw.append(x)

ans = []
for x in sw:
  y = 0 #ａｎｓに加えるかどうかの判定
  for i in range(m):
    z = 0 #あまりの判定
    if y == 0:
      for j in range(s[i][0]):
        if x[s[i][j+1]-1] == "1":
          z += 1
      if z%2 != p[i]:
        y += 1
  if y == 0:
    ans.append(x)
print(len(ans))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split()) #nがスイッチ、mが電球の数
s = []
swi = []

for i in range(m):
  x = list(map(int,input().split()))
  s.append(x)
p = list(map(int,input().split()))
print(s,p)

for i in range(1,2**n):
  x = format(i, 'b')
  x = x.zfill(n)
  swi.append(x)
#print(swi[-1])

for j in range(m):
  for i in range(len(swi)-1):
    x = 0
    for k in range(s[j][0]):
      x += int(swi[i][s[j][k]-1])
    if x % 2 != p[j]:
      del swi[i]
print(swi)
Problem p03035 (python)

Fixed submission:
a, b = map(int,input().split())
if a > 12:
  print(b)
elif a < 13 and a > 5:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split()) #nがカードの数、mがBの数
a = list(map(int, input().split()))
b = [list(map(int,input().split())) for i in range(m)]

print(a,b)
'''for i in range(m):
  a.extend([b[i][1]]*b[i][0])
a.sort(reverse=True)
ans = 0
for i in range(n):
  ans += a[i]
print(ans)'''

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split()) #nがカードの数、mがBの数
a = list(map(int, input().split()))
b = [list(map(int,input().split())) for i in range(m)]
 
for i in range(m):
  a.extend([b[i][1]]*b[i][0])
a.sort(reverse=True)
ans = 0
for i in range(n):
  ans += a[i]
print(ans)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 2:
    a = int(input())
    b = int(input())


if n == 1:
    print("Hello World")
else:
    print(a+b)

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


if n == 1:
    print("Hello World")
else:
    print(a+b)

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

if n == 1:
    print("Hello World")
else:
    print(a+b)
Problem p03273 (python)

Fixed submission:
H,W = map(int,input().split())
l = [list(input()) for i in range(H)]
#print(H,W,l)


wlist = []
hlist = []
harray = []
for i in range(H):
    flag = 0
    for j in range(W):
        if l[i][j] == "#":
            flag = 1
    if flag == 1:
        hlist.append(i)
for i in hlist:
    harray.append(l[i])
H = len(harray)

for i in range(W):
    flag = 0
    for j in range(H):
        if harray[j][i] == "#":
            flag = 1
    if flag == 0:
        wlist.append(i)
for i in wlist:
    for j in range(H):
        harray[j][i] = "n"

for i in harray:
    for x in i:
        if x != "n":
            print(x,end="")
    print()

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
l = [list(input()) for i in range(H)]
#print(H,W,l)

w_del = []
h_del = []
for i in range(W):
    flag = 0
    for j in range(H):
        if l[j][i] == "#":
            flag = 1
    if flag == 0:
        w_del.append(i)
for x in w_del:
    for i in range(H):
        del l[i][x]

W = len(l[0])
for i in range(H):
    flag = 0
    for j in range(W):
        if l[i][j] == "#":
            flag = 1
    if flag == 0:
        h_del.append(i)
for x in h_del:
    del l[x]

for i in l:
    for x in i:
        print(x,end="")
    print()
Problem p03280 (python)

Fixed submission:
a,b = map(int,input().split())
print(a*b - (a+b-1))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(a*b - (a+b-1)
Problem p03309 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [A[i]-i for i in range(N)]
S = sorted(B)

res = 0
if N%2 == 1:
    b = S[(N-1)//2]#中央値
    for i in range(N):
        res += abs(B[i]-b)
else:
    medint1 = N//2
    medint2 = N//2-1
    med1 = S[medint1]
    med2 = S[medint2]
    t1 = 0
    t2 = 0
    for i in range(N):
        t1 += abs(B[i]-med1)
        t2 += abs(B[i]-med2)
    res = min(t1,t2)
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = [A[i]-i for i in range(N)]
S = sorted(B)

res = 0
if N%2 == 1:
    b = S[(N-1)//2]#中央値
    for i in range(N):
        res += abs(B[i]-b)
else:
    medint1 = N//2
    medint2 = N//2-1
    med1 = S[medint1]
    med2 = S[medint2]
    for i in range(N):
        t1 += abs(B[i]-med1)
        t2 += abs(B[i]-med2)
    res = min(t1,t2)
print(res)
Problem p03353 (python)

Fixed submission:
S = input()
K = int(input())
N = len(S)

l = []
for i in range(N):
    for j in range(i+1,min(i+K+1,N+1)):
        s = S[i:j]
        l.append(s)
l = list(set(l))
l.sort()
print(l[K-1])

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
N = len(S)

l = []
for i in range(N):
    for j in range(i+1,min(i+K+1,N)):
        s = S[i:j]
        l.append(s)
l = list(set(l))
l.sort()
print(l[K-1])
Problem p03359 (python)

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

res = 0
if A>B:
    res = A-1
else:
    res = A
print(res)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input())

res = 0
if A>B:
    res = A-1
else:
    res = A
print(res)
Problem p03417 (python)

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

if N == 1 and M == 1:
    print(1)
elif N ==1 or M == 1:
    print(max(M-2,N-2))
else:
    print((N-2)*(M-2))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())

#表を0とする　カードの設定
G = [[0]*N for _ in range(M)]

#めくる
def turn(x,y):
    G[y][x] = (G[y][x]+1)%2
    if x > 0:
        G[y][x-1] = (G[y][x-1]+1)%2
        if y > 0:
            G[y-1][x-1] = (G[y-1][x-1]+1)%2
        if y < M-1:
            G[y+1][x-1] = (G[y+1][x-1]+1)%2
    if x < N-1:
        G[y][x+1] = (G[y][x+1]+1)%2
        if y > 0:
            G[y-1][x+1] = (G[y-1][x+1]+1)%2
        if y < M-1:
            G[y+1][x+1] = (G[y+1][x+1]+1)%2
    if y > 0:
        G[y-1][x] = (G[y-1][x]+1)%2
    if y < M-1:
        G[y+1][x] = (G[y+1][x]+1)%2
    return G

for i in range(N):
    for j in range(M):
        x = i
        y = j
        turn(x,y)

res = 0
for g in G:
    res += sum(g)
print(res)
Problem p03423 (python)

Fixed submission:
N = int(input())
print(N//3)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
S = list(map(str,input().split()))
counter = Counter(S)

res = 0
for s in counter.values():
    res += s
if s == 3:
    print("Three")
else:
    print("Four")
Problem p03486 (python)

Fixed submission:
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)

if s < t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s.sort()
t.sort()

sf1 = s[0]
sf2 = s[1]
tf1 = t[-1]
tf2 = t[-2]
sres1 = 0
sres2 = 0
tres1 = 0
tres2 = 0
A = "abcdefghijklmnopqrstuvwxyz"
for i,x in enumerate(A):
    if sf1 == x:
        sres1 = i
    if sf2 == x:
        sres2 = i
    if tf1 == x:
        tres1 = i
    if tf2 == x:
        tres2 = i
if sres1 < tres1:
    print("Yes")
elif sres1 == tres1:
    if sres2 < tres2:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Problem p03493 (python)

Fixed submission:
S = input()

res = 0
for s in S:
    if s == "1":
        res += 1
print(res)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

num = []
cnt = []

for a in A:
    if a not in num:
        num.append(a)
        cnt.append(1)
    else:
        cnt[-1] += 1
cnt.sort()
#print(num,cnt)

res = 0
M = len(cnt)
if M <= K:
    res = 0
else:
    for i in range(M-K):
        res += cnt[i]
print(res)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

num = []
cnt = []

for a in A:
    if a not in num:
        num.append(a)
        cnt.append(1)
    else:
        cnt[-1] += 1
cnt.sort()
#print(num,cnt)

res = 0
M = len(cnt)
if M <= K:
    res = 0
else:
    for i in range(M-K):
        res += cnt[i]
print(res)

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

a=[]#種類の記憶

for i in range(n):
  if a.count(lst[i]) == 0:
    a.append(lst[i])
c=[]#カウント用
for j in a:
  c.append(lst.count(j))
ans = 0
while k < len(c):
  i = c.index(min(c)) #最小の個数のインデックス
  ans += min(c)
  del c[i]
print(ans)
Problem p03495 (python)

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

num = []
cnt = []

for i in range(N):
    if i == 0:
        num.append(A[i])
        cnt.append(1)
    else:
        if A[i-1] != A[i]:
            num.append(A[i])
            cnt.append(1)
        else:
            cnt[-1] += 1
cnt.sort()
#print(num,cnt)

res = 0
M = len(cnt)
if M <= K:
    res = 0
else:
    for i in range(M-K):
        res += cnt[i]
print(res)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

num = []
cnt = []

for a in A:
    if a not in num:
        num.append(a)
        cnt.append(1)
    else:
        cnt[-1] += 1
cnt.sort()
#print(num,cnt)

res = 0
M = len(cnt)
if M <= K:
    res = 0
else:
    for i in range(M-K):
        res += cnt[i]
print(res)
Problem p02947 (python)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
from collections import Counter

c = Counter(s)
print(sum((x * (x - 1)) // 2 for x in c.values()))

Buggy submission (verdict: Runtime Error):
    N=int(input())
    s = [''.join(sorted(input())) for _ in range(N)]
    from collections import Counter
    c = Counter(s)
    print(sum((x*(x-1))//2 for x in c.values()))
Problem p03085 (python)

Fixed submission:
b = raw_input()
if b == "A":
    print "T"
elif b == "T":
    print "A"
if b == "C":
    print "G"
elif b == "G":
    print "C"

Buggy submission (verdict: Runtime Error):
b = input()
if b == "A":
    print "T"
elif b == "T":
    print "A"
if b == "C":
    print "G"
else:
    print "C"
Problem p03238 (python)

Fixed submission:
N = input()
if N == 1:
    print "Hello World"
else:
    A = input()
    B = input()
    print A+B

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
if n == 1:
    print("Hello World")
elif n == 2:
	a = int(raw_input())
    b = int(raw_input())
    print a + b

Buggy submission (verdict: Runtime Error):
n = input()
if n == 1:
    print("Hello World")
elif n == 2:
	a = input()
    b = input()
    print a + b

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, raw_input().split())
if n == 1:
    print("Hello World")
elif n == 2:
    print a + b
Problem p03338 (python)

Fixed submission:
a = input()
b = raw_input()
x = 0
for i in range(1,a):
    z = b[0:i]
    y = b[i:a]
    arr = []
    for l in y:
        for m in z:
            if l == m and l not in arr:
                arr.append(l)
    if len(arr) > x:
        x = len(arr)
print x

Buggy submission (verdict: Runtime Error):
a = input()
b = raw_input()
x = 0
for i in range(1,n):
    z = s[0:i]
    y = s[i:n]
    arr = []
    for l in y:
        for m in z:
            if l == m and l not in arr:
                arr.append(l)
    if len(arr) > x:
        x = len(arr)
print x
Problem p03385 (python)

Fixed submission:
s = raw_input()
if s[0] == s[1]:
    print"No"
elif s[0] == s[2]:
    print"No"
elif s[2] == s[1]:
    print"No"
else:
    print"Yes"

Buggy submission (verdict: Runtime Error):
s = raw_input()
if s[1] == s[2]:
    print"No"
elif s[1] == s[3]:
    print"No"
elif s[3] == s[2]:
    print"No" 
else:
    print"Yes"
Problem p03433 (python)

Fixed submission:
n = input()
c = input()
if n % 500 <= c:
    print "Yes"
else:
    print"No"

Buggy submission (verdict: Runtime Error):
n = raw_input()
c = raw_input()
if n % 500 <= c:
    print "Yes"
else:
    print"No"
Problem p03852 (python)

Fixed submission:
s = raw_input()
if s == "a":
    print "vowel"
elif s == "e":
    print "vowel"
elif s == "i":
    print "vowel"
elif s == "o":
    print "vowel"
elif s == "u":
    print "vowel"
else:
    print "consonant"

Buggy submission (verdict: Runtime Error):
s = input()
if s == "a":
    print "vowel"
elif s == "e":
    print "vowel"
elif s == "i":
    print "vowel"
elif s == "0":
    print "vowel"
elif s == "u":
    print "vowel"
else:
    print "consonant"
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

List = []
for i in range(H):
    l = []
    for j in range(W):
        l.append(0)
    List.append(l)

for i in range(h):
    for j in range(W):
        List[i][j] = 1
for i in range(H):
    for j in range(w):
        List[i][j] = 1

count = 0
for i in range(H):
    count += List[i].count(0)

print(count)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = map(int, input().split())

List = []
for i in range(H):
    l = []
    for j in range(W):
        l.append(1)
    List.append(l)

for i in range(h):
    del List[i]

for j in range(w):
    for i in range(len(List)):
        del List[i][j]

count = 0
for i in range(len(List)):
    count = count + len(List[i])

print(count)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = map(int, input().split())

List = []
for i in range(H):
    l = []
    for j in range(W):
        l.append(1)
    List.append(l)

for i in range(h):
    del List[0]

for j in range(w):
    for i in range(len(List)):
        del List[i][j]

count = 0
for i in range(len(List)):
    count = count + len(List[i])

print(count)