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

Fixed submission:
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(len(char_list))]

flag = False

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score = 0
for x in range(5):
    for y in range(x + 1, 5):
        for z in range(y + 1, 5):
            score += count_list[x] * count_list[y] * count_list[z]

print(score)

Buggy submission (verdict: Runtime Error):
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

flag = False

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score=0
for x in range(5):
    for y in range(x+1,5):
        for z in range(y+1,5):
            try:
                score+=count_list[x]*count_list[y]*count_list[z]
            except:
                print("0")
                exit()



print(score)

Buggy submission (verdict: Runtime Error):
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score=0
for x in range(5):
    for y in range(x+1,5):
        for z in range(y+1,5):
            score+=count_list[x]*count_list[y]*count_list[z]

print(score)

Buggy submission (verdict: Runtime Error):
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score=0
for x in range(len(count_list)):
    for y in range(x+1,len(count_list)):
        for z in range(y+1,len(count_list)):
            score+=count_list[x]*count_list[y]*count_list[z]

print(score)

Buggy submission (verdict: Runtime Error):
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score = 1
flag= False
for x in count_list:
    if x != 0:
        flag = True
        score *= x
if flag is True:
    print(score)
else:
    print("0")

Buggy submission (verdict: Runtime Error):
N = int(input())
name_list = [input() for name in range(N)]
char_list = ['M', 'A', 'R', 'C', 'H']
count_list = [0 for _ in range(N)]

for name in name_list:
    if name[0] in char_list:
        count_list[char_list.index(name[0])] += 1
score = 1

for x in count_list:
    if x != 0:
        score *= x

print(score)
Problem p03102 (python)

Fixed submission:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
r=0
for _ in range(n):
  a=list(map(int,input().split()))
  s=0
  for i in range(m):
    s+=a[i]*b[i]
  if s > -c:
    r+=1
print(r)

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
b=map(int,input().split())
a=0
for _ in range(n):
  a=map(int,input().split())
  s=0
  for i in range(m):
    s+=a[i]*b[i]
  if s > -c:
    a+=1
print(a)
Problem p03145 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(a*b//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b//2)
Problem p03219 (python)

Fixed submission:
a,b=map(int,input().split())
print(a+b//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print(a+b//2)
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
print("Yes" if a%2 and b%2 else "No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input()split())
print("Yes" if a%2 and b%2 else "No")
Problem p03547 (python)

Fixed submission:
a,b=input().split()
print('<' if a<b else '>' if a>b else '=')

Buggy submission (verdict: Runtime Error):
a,b=[input() for _ in range(2)]
print('<' if a<b else '>' if a>b else '=')
Problem p03711 (python)

Fixed submission:
a=[0,1,3,1,2,1,2,1,1,2,1,2,1]
x,y=map(int,input().split())
print("Yes" if a[x]==a[y] else "No")

Buggy submission (verdict: Runtime Error):
a=[0,1,3,1,2,1,2,1,1,2,1,2,1]
x,y=map(int,input().split())
print("Yes" if a[x]==x[y] else "No")
Problem p03101 (python)

Fixed submission:
i = list()
for x in range(2):
  i.append([int(x) for x in input().split()])
print((i[0][0]-i[1][0])*(i[0][1]-i[1][1]))

Buggy submission (verdict: Runtime Error):
i = list()
for x in range(2):
  i.append(map(int,input().split()))
print(i[0][0]-i[1][0])*(i[0][1]-i[1][1])

Buggy submission (verdict: Runtime Error):
i = list()
for x in range(2):
  i.append(map(int,input().split()))
return (i[0][0]-i[1][0])*(i[0][1]-i[1][1])
Problem p03501 (python)

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

print(min(A*N, B))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, raw_input().split())

print(min(A*N, B))
Problem p03101 (python)

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

import numpy as np

INPUT=input().split()
Input=input().split()
H,W=int(INPUT[0]),int(INPUT[1])
h,w=int(Input[0]),int(Input[1])

mat=np.ones((H,W))
mat[0:h,:]=0
mat[:,0:w]=0

print(int(np.sum(mat)))

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

import numpy as np

H,W=int(input().split())
h,w=int(input().split())

mat=np.ones((H,W))
mat[0:h,:]=0
mat[:,0:w]=0

print(np.sum(mat))

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

H,W=input().split()
h,w=input().split()

mat=np.ones((H,W))
mat[0:h,:]=0
mat[:,0:w]=0

print(np.sum(mat))
Problem p03434 (python)

Fixed submission:
#金額
moto = int(input())
num   = int((moto + 1 ) / 2)
retu    = input().split()
card = list( map((lambda x:int(x)),retu))
cardList = sorted(card, reverse=True)
Alice = 0
Bob = 0

for w in range(num):
    Alice = Alice + cardList[w*2]
    if moto > (w*2+1):
        Bob = Bob + cardList[w*2+1]

print(Alice - Bob)

Buggy submission (verdict: Runtime Error):
#金額
num   = int((int(input()) + 1 ) / 2)
retu    = input().split()
card = list( map((lambda x:int(x)),retu))
cardList = sorted(card, reverse=True)
Alice = 0
Bob = 0

for w in range(num):
    Alice = Alice + cardList[w*2]
    Bob = Bob + cardList[w*2+1]

print(Alice - Bob)
Problem p03449 (python)

Fixed submission:
num = int(input())

nowMax = 0

retu       = input().split()
list_up   = list( map((lambda x:int(x)),retu))
retu       = input().split()
list_down = list( map((lambda x:int(x)),retu))

#下に降りるタイミングを決めるためのループ
for w in range(num):
    total = 0

    #1段目の合計を足すためのループ
    for x in range(0,w+1):
        total = total + list_up[x]

    for y in range(w,num):
        total = total + list_down[y]

    if total > nowMax:
        nowMax = total

print(nowMax)

Buggy submission (verdict: Runtime Error):

num = int(input())

list = [[0 for col in range(2)] for row in range(num)]

total  = 0
nowMax = 0

#下に降りるタイミングを決めるためのループ
for w in range(num):
    #1段目の合計を足すためのループ
    for x in range(0,w+1):
        total = total + list[0][x]

    for y in range(w+1,num):
        total = total + list[1][y]

    if total < nowMax:
        nowMax = total

print(total)
Problem p03469 (python)

Fixed submission:
#日付
num = list(input())
num[3] = "8"
print("".join(num))

Buggy submission (verdict: Runtime Error):
#枚数
paper = int(input())

#餅リスト
moti_list  = []
li_uniq    = []

#取得
for w in range(paper):
    paper = int(input())

    moti_list.append(paper)

print(len(moti_list))

Buggy submission (verdict: Runtime Error):
num   = input()
num[3] = "8"
print(num)
Problem p03470 (python)

Fixed submission:
#枚数
paper = int(input())

#餅リスト
moti_list  = []
li_uniq    = []

#取得
for w in range(paper):
    paper = int(input())

    moti_list.append(paper)

li_uniq = list(set(moti_list))

print(len(li_uniq))

Buggy submission (verdict: Runtime Error):
    #枚数
    paper = int(input())
     
    #餅リスト
    moti_list  = []
    li_uniq    = []
     
    #取得
    for w in range(paper):
        paper = int(input())
     
        moti_list.append(paper)
     
    print(len(moti_list))
Problem p03997 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 整数の入力
b = int(input())
# 整数の入力
h = int(input())
# スペース区切りの整数の入力

# 出力
print("{:.0f}".format((a+b)*h/2))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 整数の入力
b = int(input())
# 整数の入力
h = int(input())
# スペース区切りの整数の入力
 
# 出力
print("{}".format((a+b)*h/2)))
Problem p03101 (python)

Fixed submission:
H, W = (int(x) for x in raw_input().split())
h, w = (int(x) for x in raw_input().split())
print((H - h) * (W - w))

Buggy submission (verdict: Runtime Error):
H, W = int(input()), int(input())
h, w = int(input()), int(input())
print((H - h) * (W - w))
Problem p03102 (python)

Fixed submission:
from itertools import izip

N, M, C = (int(x) for x in raw_input().split())
B = [int(x) for x in raw_input().split()]
A = [[int(x) for x in raw_input().split()] for i in xrange(N)]
result = 0
for i in xrange(N):
  cur_sum = C
  for a, b in izip(A[i], B):
    cur_sum += a * b
  if cur_sum > 0:
    result += 1
print(result)

Buggy submission (verdict: Runtime Error):
from itertools import izip

N, M, C = (int(x) for x in raw_input().split())
B = [int(x) for x in raw_input().split()]
A = [[int(x) for x in raw_input().split()] for i in xrange(N)]
result = 0
for i in xrange(N):
  cur_sum = C
  for a, b in izip(A, B):
    cur_sum += a * b
  if cur_sum > 0:
    result += 1
print(result)

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

N, M, C = (int(x) for x in raw_input().split())
B = [int(x) for x in raw_input().split()]
A = [[int(x) for x in raw_input().split()] for i in xrange(N)]
result = 0
for i in xrange(N):
  cur_sum = C
  for a, b in izip(A, B):
    cur_sum += a * b
  if cur_sum > 0:
    result += 1
print(result)

Buggy submission (verdict: Runtime Error):
N, M, C = (int(x) for x in raw_input().split())
B = [int(x) for x in raw_input().split()]
A = [[int(x) for x in raw_input().split()] for i in xrange(N)]
result = 0
for i in xrange(N):
  cur_sum = C
  for a, b in izip(A, B):
    cur_sum += a * b
  if cur_sum > 0:
    result += 1
print(result)
Problem p03219 (python)

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

print(int(y/2+x))

Buggy submission (verdict: Runtime Error):
x = int(input())
y = int(input())
print(y/2+x)
Problem p03238 (python)

Fixed submission:
n = int(input())


if n == 1:
    print("Hello World")
else :
    A = int(input())
    B = int(input())
    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)

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


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")
Problem p03284 (python)

Fixed submission:

n, k = map(int,input().split())
if n % k ==0:
    ans =0
else :
    ans =1
    
print(ans)

Buggy submission (verdict: Runtime Error):

n, k = map(int,input().split())
if n % k ==0:
    ans =0
else :
    ans =1
    
prnt(ans)
Problem p03337 (python)

Fixed submission:
a, b = map(int,input().split())
A = a + b
B = a - b
C = a * b
print (max (A, B, C))

Buggy submission (verdict: Runtime Error):
a, b = int (input())
A = a + b
B = a - b
C = a * b
print (max (A, B, C))
Problem p03352 (python)

Fixed submission:
x = int(input())
ans = []
for i in range(1, x+2):
    for l in range(2, x+2):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break
            

ans.sort()
print(ans[len(ans)-1])

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = []
for i in range(2, x):
    for l in range(2, x):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break

print(int(ans[len(ans)-1]))

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = []
for i in range(2, x):
    for l in range(2, x):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break

print(ans[len(ans)-1])
Problem p03378 (python)

Fixed submission:
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
if x == 1 or x == n:
    print(0)
else:
    for i in range(1, x):
        if len(a) != 0:
            if a[0] == i:
                ans1 += 1
                a.pop(0)
    if len(a) != 0:
        for i in range(x, n):
            if len(a) != 0:
                if a[0] == i:
                    ans2 += 1
                    a.pop(0)
    ans = min(ans1, ans2)
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
if x == 1 or x == n:
    print(0)
else:
    for i in range(1, x):
        if len(a) != 0:
            if a[0] == i:
                ans1 += 1
                a.pop(0)
    if len(a) != 0:
        for i in range(x, n):
            if a[0] == i:
                ans2 += 1
                a.pop(0)
    ans = min(ans1, ans2)
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
if x == 1 or x == n or x == 2 or x == n-1:
    print(0)
else:
    for i in range(1, x):
        if a[0] == i:
            ans1 += 1
            a.pop(0)
    if len(a) != 0:
        for i in range(x, n):
            if a[0] == i:
                ans2 += 1
                a.pop(0)
    ans = min(ans1, ans2)
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
aa = a
if x == 1 or x == n:
    print(0)
else:
    for i in range(1, x):
        if a[0] == i:
            ans1 += 1
            a.pop(0)
    if len(a) != 0:
        for i in range(x, n):
            if a[0] == i:
                ans2 += 1
                a.pop(0)
    ans = min(ans1, ans2)
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
aa = a
for i in range(1, x):
    if a[0] == i:
        ans1 += 1
        a.pop(0)
if len(a) != 0:
    for i in range(x, n):
        if a[0] == i:
            ans2 += 1
            a.pop(0)
    

ans = min(ans1,ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for i in range(x+1):
    if a[0] == i:
        ans1 += 1
        a.pop(0)
for i in range(x+1, n):
    if a[0] == i:
        ans2 += 1
        a.pop(0)
ans = min(ans1,ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for i in range(x):
    if a[0] == i:
        ans1 += 1
        a.pop(0)
for i in range(x, n):
    if a[0] == i:
        ans2 += 1
        a.pop(0)
ans = min(ans1,ans2)
print(ans)
Problem p03110 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(n):
  amount, name = input().split()
  amount = float(amount)
  if name == "BTC":
    sum += 380000 * amount
  else:
    sum += amount

print(sum)

Buggy submission (verdict: Runtime Error):
n = input()
sum = 0
for i in range(n):
  amount, name = input().split()
  amount = float(amount)
  if name == "BTC":
    sum += amount * 380000
  else:
    sum += amount
    
print(sum)
Problem p03149 (python)

Fixed submission:
if set(input().split()) == set("1974"):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s1, s2, s3, s4 = input().split()
aru = "NO"
for junjo in permutations((s1, s2, s3, s4)):
  if junjo[0] + junjo[1] + junjo[2] + junjo[3] == "1974":
    aru = "YES"
    break
  
print(aru)
Problem p03231 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

N, M = map(int,input().split())
S=input()
T=input()

Slist=list(S)
Tlist=list(T)

L=int(N*M/gcd(N,M))
G=gcd(N,M)

A=int(N/G)
B=int(M/G)

for i in range(G):
    if Slist[i*A]!=Tlist[i*B]:
        ans=-1
        break
    else:
        ans=L
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int,input().split())
S=input()
T=input()

Slist=list(S)
Tlist=list(T)

L=int(N*M/math.gcd(N,M))
G=math.gcd(N,M)

A=int(N/G)
B=int(M/G)

for i in range(G):
    if Slist[i*A]!=Tlist[i*B]:
        ans=-1
        break
    else:
        ans=L
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int,input().split())
S=input()
T=input()

Slist=list(S)
Tlist=list(T)

L=int(N*M/math.gcd(N,M))
G=math.gcd(N,M)

A=int(N/G)
B=int(M/G)

for i in range(G):
    if Slist[i*A]!=Tlist[i*B]:
        ans=-1
        break
    else:
        ans=L
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int,input().split())
S=input()
T=input()

Slist=list(S)
Tlist=list(T)

L=int(N*M/math.gcd(N,M))
G=math.gcd(N,M)

A=int(N/G)
B=int(M/G)

for i in range(G):
    if Slist[i*A]!=Tlist[i*B]:
        ans=-1
        break
    else:
        ans=L
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int,input().split())
S=input()
T=input()

Slist=list(S)
Tlist=list(T)

L=int(N*M/math.gcd(N,M))
G=math.gcd(N,M)

A=int(N/G)
B=int(M/G)

for i in range(G):
    if Slist[i*A+1]==Tlist[i*B+1]:
        print(-1)
        break
        
print(L)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int,input().split())
S=input()
T=input()

Slist=list(S)
Tlist=list(T)

L=int(N*M/math.gcd(N,M))
G=math.gcd(N,M)

A=int(N/G)
B=int(M/G)

for i in range(G):
    if Slist[i*A+1]==Tlist[i*B+1]:
        print(-1)
        break
        
print(L)
Problem p03101 (python)

Fixed submission:
#!/usr/bin/env python
#-*- coding:utf-8 -*-

H_s,W_s = input().split()
h_s,w_s = input().split()

H = int(H_s)
W = int(W_s)
h = int(h_s)
w = int(w_s)

num_total    = H * W
num_black_h  = h * W
num_black_w  = H * w
num_black_hw = h * w
num_white = num_total - num_black_h - num_black_w + num_black_hw

print(num_white)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding:utf-8 -*-

import numpy as np

N_s, M_s, C_s = input().split()
N = int(N_s)
M = int(M_s)
C = int(C_s)

B = [int(i) for i in input().split()]
A = []
for rows in range(0,N):
    tmp = [int(i) for i in input().split()]
    A.append(tmp)

B_array = np.array(B)
A_array = np.array(A)

val = np.dot(A_array, B_array) + C
print(np.sum(val>0))
Problem p03101 (python)

Fixed submission:
s1 = list(map(int, input().split()))
s2 = list(map(int, input().split()))
print((s1[0]-s2[0])*(s1[1]-s2[1]))

Buggy submission (verdict: Runtime Error):
H,W=int(input())
h,w=int(input())
print((H-h)*(W-w))
Problem p03145 (python)

Fixed submission:
a = list(int(i) for i in input().split())
print(a[0]*a[1]//2)

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(3)]
print(a[0]＊a[1]/2)

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(3)]
print(a[0]*a[1]/2)

Buggy submission (verdict: Runtime Error):
grid=[[int(i) for i in input().split()]for i in range(i)]
print(grid[0]*grid[1]/2)
Problem p03101 (python)

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

ans = H * W - (h*W + w*(H-h))
print(ans)

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

def whiecells(H, W, h, w):
	ans = H * W -(h*W + w*(H-h))
	return ans

print(ans)

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

def whiecells(H, W, h, w):
	ans = H * W - (h*W + w*(H-h))
	return ans

print(ans)
Problem p03103 (python)

Fixed submission:
N, M = map(int, input().split())
X = []
for i in range(N):
    X.append(list(map(int, input().split())))
X.sort(key=lambda x: x[0])
i = 0
num = 0
ans = 0
while i <= N - 1:
    num += X[i][1]
    ans += X[i][0] * X[i][1]
    if num > M:
        ans -= X[i][0] * (num - M)
        break
    i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = []
for i in range(N):
    X.append(list(map(int, input().split())))
X.sort1(key=lambda x: x[0])
i = 0
num = 0
ans = 0
while i <= N - 1:
    num += X[i][1]
    ans += X[i][0] * X[i][1]
    if num > M:
        ans -= X[i][0] * (num - M)
        break
    i += 1
print(ans)
Problem p03129 (python)

Fixed submission:
l=[]
n,k=map(int,input().split())
for i in range(1,n+1,2):
    l.append(i)

if k<=len(l):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
l=[]
count=0
flg=0
n,k=map(int,input().split())
for i in range(1,n+1):
    l.append(i)
for i in range(1,len(l)):
    for j in range(i+1,len(l)+1):
        if j-i<=1:
            del l[j]
if k<=len(l):
    print("YES")
else:
    print("NO")
Problem p03200 (python)

Fixed submission:
from sys import stdin
a=  stdin.readline().strip()
a= list(a)
a.reverse()
ans= 0
cur =0
for i in a:
 if i=='W':
  cur+=1
 else:
  ans+= cur
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
a=  stdin.readline().strip()
a= list(a)
a.reverse()
ans= 0
cur =0
for i in a:
 if i=='W':
  cur+=1
 else:
  ans+= 1
print ansa
Problem p03241 (python)

Fixed submission:
from sys import stdin
n,m = map(int,stdin.readline().split())
ans = 1
x = 1
a = []
while x * x <=m:
 if m%x==0:
  a.append(x)
  a.append(m/x)
 x+=1
for i in a:
 if m/i >= n:
  ans = max(ans,i)
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
n,m = int(stdin.readline().split())
ans = 1
x = 1
a = []
while x * x <=m:
 if m%x==0:
  a.append(x)
  a.append(m/x)
 x+=1
for i in a:
 if m/i <= n:
  ans = max(ans,i)
print ans
Problem p03502 (python)

Fixed submission:
from sys import stdin
ans = 'No'
n = int(stdin.readline())
m = n
s = 0
while m:
 s += m%10
 m/=10
if n%s==0:
 ans = 'Yes'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
ans = 'No'
n = int(stdin.readline())
m = n
s = 0
while m:
 s += m%10
 m/=10
if n%m==0:
 ans = 'Yes'
print ans
Problem p03543 (python)

Fixed submission:
from sys import stdin
a = stdin.readline().strip()
ans = 'No'
b = a[:3]
c = a[1:]
if b==a[0]*3:
 ans = 'Yes'
if c==a[1]*3:
 ans = 'Yes'
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = [0,2,1]
for i in xrange(3,80):
 a.append(a[-1] + a[-2])
print a[int(stdin.readline())]
Problem p03544 (python)

Fixed submission:
from sys import stdin
a = [2,1]
for i in xrange(100):
 a.append(a[-1] + a[-2])
print a[int(stdin.readline())]

Buggy submission (verdict: Runtime Error):
from sys import stdin
a = [2,1]
for i in xrange(80):
 a.append(a[-1] + a[-2])
print a[int(stdin.readline())]
Problem p03573 (python)

Fixed submission:
from sys import stdin
a,b,c = map(int,stdin.readline().split())
print a^b^c

Buggy submission (verdict: Runtime Error):
from sys import stdin
n,k = map(int,stdin.readline().split())
a = []
for i in xrange(n):
 a.append(map(int,stdin.readline().split()))
def solve(i,j):
 cnt = 0
 minx = min(a[i][0],a[j][0])
 maxx =  max(a[i][0],a[j][0])
 miny = min(a[i][1],a[j][1])
 maxy = max(a[i][1],a[j][1])
 #print "solving",i,j,minx,maxx,miny,maxy
 for m in xrange(n):
  if a[m][0]>=minx and a[m][0]<=maxx and a[m][1]>=miny and a[m][1]<=maxy:
   cnt+=1
 #print "has",cnt
 if cnt>=k:
  return (maxx-minx)*(maxy-miny)
 return 10**100
ans = 10**50
for i in xrange(n):
 for j in xrange(i+1,n):
  ans = min(ans,solve(i,j))
print ans

Buggy submission (verdict: Runtime Error):
from sys import stdin
n,k = map(int,stdin.readline().split())
a = []
for i in xrange(n):
 a.append(map(int,stdin.readline().split()))
def solve(i,j):
 cnt = 0
 minx = min(a[i][0],a[j][0])
 maxx =  max(a[i][0],a[j][0])
 miny = min(a[i][1],a[j][1])
 maxy = max(a[i][1],a[j][1])
 for m in xrange(n):
  if a[i][0]>=minx and a[i][0]<=maxx and a[i][1]>=miny and a[i][1]<=maxy:
   cnt+=1
 if cnt>=k:
  return (maxx-minx+1)*(maxy-miny+1)
 return 10**100
ans = 10**50
for i in xrange(n):
 for j in xrange(i+1,n):
  ans = min(ans,solve(i,j))
print ans