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

Fixed submission:
N_str, K=input().split()
K=10-int(K)
N_digit=list(map(int,list(N_str)))
D=sorted(list(map(int,input().split())))
D=[d for d in range(10) if d not in D]

l_digit=[n>D[-1] for n in N_digit]

if any(l_digit):
  N_n=l_digit.index(True)
  if not any([n is not D[-1] for n in N_digit[0:N_n]]):
    out=list(str(D[1] if D[0]==0 else D[0]))
    out+=[str(D[0]) for i in range(len(N_digit))]
  else:
    flag=False
    out=[]
    for i in range(N_n):
      if not flag:
      	for j in range(K):
          if D[j]>=N_digit[i]:
            out.append(str(D[j]))
            if D[j]!=N_digit[i]:
              flag=True
              break
      else:
        out.append(str(D[0]))
    for i in range(N_n,len(N_digit)):
      out.append(str(D[0]))
else:
  out=[]
  flag=False
  for n in N_digit:
    if not flag:
      for j in range(K):
        if D[j]>=n:
          out.append(str(D[j]))
          if D[j]>n:
            flag=True
          break
    else:
      out.append(str(D[0]))
      
print(int("".join(out)))

Buggy submission (verdict: Runtime Error):
N_str, K=input().split()
N_digit=list(map(int,list(N_str)))
D=sorted(list(map(int,input().split())))
l_digit=[n>D[-1] for n in N_digit]


if any(l_digit):
  N_n=l_digit.index(True)
  if not any([n<D[-1] for n in N_digit[0:N_n]]):
    out=list(str(D[1] if D[0]==0 else D[0]))
    out+=[str(D[0]) for i in range(len(N_digit))]
  else:
    out=[str(D[[n<=D[j] for j in range(int(K))].index(True)]) for n in N_digit[0:N_n]] + [str(D[0]) for n in N_digit[N_n:]]
    for k in range(N_n-1,-1,-1):
      if N_digit[k]<D[-1]:
        out[k]=str(D[[N_digit[k]<D[j] for j in range(int(K))].index(True)])
        break
    
else:
  out=[str(D[[n<=D[j] for j in range(int(K))].index(True)]) for n in N_digit]

print(int("".join(out)))
Problem p03844 (python)

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

if op =="+":
    print(int(A) + int(B))
elif op == "-":
    print(int(A) - int(B))

Buggy submission (verdict: Runtime Error):
A, op, B = (input()).split()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A + B)
elif op == "-":
    print(A - B)

Buggy submission (verdict: Runtime Error):
A, op, B = str(input()).split()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A + B)
elif op == "-":
    print(A - B)

Buggy submission (verdict: Runtime Error):
A, op, B = str(input()).split("")
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)

Buggy submission (verdict: Runtime Error):
A, op, B = str(input()).split()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)

Buggy submission (verdict: Runtime Error):
A, op, B = str(input()).split
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)

Buggy submission (verdict: Runtime Error):
A, op, B = str(input())
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)

Buggy submission (verdict: Runtime Error):
A, op, B = input()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)

Buggy submission (verdict: Runtime Error):
A, op, B = input()
A = int(A)
B = int(B)
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)

Buggy submission (verdict: Runtime Error):
A, op, B = input()
A = int(A)
B = int(B)
if op =="+":
    print(A+B)
else op == "-":
    print(A-B)

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

op = "+" or "-"

print(A op B)

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



print(A + B)
print(A - B)

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

print(a + b)
print(a - b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
op = "+" or "-"

print(a + op + b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
op = + or -

print(a op b)
Problem p03852 (python)

Fixed submission:
word = input()

if word=="a" or word=="e" or word=="i" or word=="o" or word=="u" :
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
word = input().split()

if word == "a", "e", "i", "o", "u" :
    print("vowel")
else:
    print("consonant")
Problem p03943 (python)

Fixed submission:
# coding: utf-8

def solve_a():
    candies = list(map(int, input().split()))
    for c in candies:
        if 2 * c == sum(candies):
            return "Yes"
    return "No"

print(solve_a())

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

def solve(a, b, c):
  if a == b + c:
    return "Yes"
  elif b == c + a:
    return "Yes"
  elif c == a + b:
    return "Yes"
  return "No"

print(solve(list(map(int, input().split()))))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
"""Fighting over Candies

@author: hijiri.n
@modified: 11-19-2016

"""


def solve():
    candies = list(map(int, input().split()))
    ach = sum(candies) // 2
    for c in candies:
        if c == ach:
            return "Yes"
    return "No"
 

print(solve_a())

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

w, h, N = list(map(int, input().split()))

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][p * (c - r) < 0])([x, y][a > 2], rect[a - 1], int(not a % 2) - int(a % 2))

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))

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

w, h, N = list(map(int, input().split()))

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][p * (c - r) < 0])([x, y][a > 2], rect[a - 1], [1, -1][a % 2])

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))
Problem p03944 (python)

Fixed submission:
# coding: utf-8

w, h, N = list(map(int, input().split()))

rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    rect[a - 1] = (lambda c, r, p: [r, c][[c < r, c > r][p]])([x, y][a > 2], rect[a - 1], a % 2)

length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
"""Snuke's Coloring 2 (ABC Edit)

@author: hijiri.n
@modified: 11-19-2016

"""

def data(): return list(map(int, input().split()))


def solve(init, point):
    w, h, N = init
    rect = [0, w, 0, h]

    for p in point:
        x, y, a = p

        if [1, -1][a % 2] * ([x, y][a > 2] - rect[a - 1]) < 0:
            rect[a - 1] = [x, y][a > 2]

        if rect[1] <= rect[0] or rect[3] <= rect[2]:
            return 0
        
    return (rect[1] - rect[0]) * (rect[3] - rect[2])

i_in = data()
p_in = [data() for _ in i[-1]]
print(solve(i_in, p_in))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
w, h, N = list(map(int, input().split()))
 
rect = [0, w, 0, h]
for i in range(N):
    x, y, a = list(map(int, input().split()))
    if [1, -1][a % 2] * ([a > 2] - rect[a - 1]) < 0:
        rect[a - 1] = [x, y][a > 2]
 
length = lambda x: [x, 0][x < 0]
print(length(rect[1] - rect[0]) * length(rect[3] - rect[2]))
Problem p03945 (python)

Fixed submission:
# coding: utf-8

stones = input().strip()
counter, switch = 0, stones[0]

for s in stones[1:]:
    if switch != s:
        switch = s
        counter += 1

print(counter)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
# R: Right hand side
# L: Left  hand side
def add_stone(stone, pos, searched_stones):
    sample = searched_stones[::[1, -1][pos == "R"]]
    if sample[0] == stone:
        return None
 
    for n, s in enumerate(sample[1:]):
        if s == stone:
            return stone * (n + 2) + sample[1 + n:]
 
 
def stones_bfs(searched_stones):
    
    queue = [searched_stones + "0"]
    patterns = [["B", "R"], ["B", "L"], ["W", "R"], ["W", "L"]]
    
    while queue:
        stones = queue.pop(0)
        if (stones.count("W") == len(stones) - 1 |
            stones.count("B") == len(stones) - 1):
            return int(stones[-1])
            
        for p in patterns:
            s = add_stone(*p, stones[:-1])
            if s is not None:
                queue += [s + str(int(stones[-1]) + 1)]
 
print(stones_bfs(input().strip()))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
# R: Right hand side
# L: Left  hand side
def add_stone(stone, pos, searched_stones):
    sample = searched_stones[::[1, -1][pos == "R"]]
    if sample[0] == stone:
        return None
 
    for n, s in enumerate(sample[1:]):
        if s == stone:
            return (stone * (n + 2) + sample[1 + n:])[::[1, -1][pos == "R"]]
 
 
def stones_bfs(searched_stones):
    
    queue = [searched_stones + "0"]
    patterns = [["B", "R"], ["B", "L"], ["W", "R"], ["W", "L"]]
    
    while queue:
        stones = queue.pop(0)
        if (stones.count("W") == len(stones) - 1 |
            stones.count("B") == len(stones) - 1):
            return int(stones[-1])
            
        for p in patterns:
            s = add_stone(*p, stones[:-1])
            if s is not None:
                queue += [s + str(int(stones[-1]) + 1)]
 
print(stones_bfs(input().strip()))

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


# R: Right hand side
# L: Left  hand side
def add_stone(stone, pos, searched_stones):
    sample = searched_stones[::[1, -1][pos == "R"]]
    if sample[0] == stone:
        return None

    for n, s in enumerate(sample[1:]):
        if s == stone:
            return (stone * (n + 2) + sample[1 + n:])[::[1, -1][pos == "R"]]


def stones_bfs(searched_stones):
    
    queue = [[searched_stones, 0]]
    patterns = [["B", "R"], ["B", "L"], ["W", "R"], ["W", "L"]]
    
    while queue:
        stones = queue.pop(0)
        if (stones[0].count("W") == len(stones[0]) |
            stones[0].count("B") == len(stones[0])):
            return stones[-1]
            
        for p in patterns:
            s = add_stone(*p, stones[0])
            if s is not None:
                queue += [[s, stones[-1] + 1]]

print(stones_bfs(input().strip()))
Problem p03855 (python)

Fixed submission:
from collections import Counter
n,k,l = map(int, input().split())
def f(m):
    a = list(range(n))
    def g(i):
        if a[i] == i:
            return i
        a[i] = g(a[i])
        return a[i]
    for _ in range(m):
        p,q = map(int, input().split())
        i = g(p-1)
        j = g(q-1)
        a[j] = i
    return g
g = f(k)
h = f(l)
c = Counter((g(i),h(i)) for i in range(n))
print(' '.join((str(c.get((g(i),h(i)), 1)) for i in range(n))))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n,k,l = map(int, input().split())
def f(m):
    a = [[] for _ in range(n)]
    for _ in range(m):
        p,q = map(int, input().split())
        a[p-1].append(q-1)
        a[q-1].append(p-1)
    b = list(range(n))
    for i in range(n):
        def g(j):
            if b[j] != j:
                return
            b[j] = i
            for k in a[j]:
                g(k)
        g(i)
    return b
a = f(k)
b = f(l)
c = Counter((a[i],b[i]) for i in range(n))
print(' '.join((str(c[a[i],b[i]]) for i in range(n))))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n,k,l = map(int, input().split())
def f(m):
    a = [[] for _ in range(n)]
    for _ in range(m):
        p,q = map(int, input().split())
        a[p-1].append(q-1)
        a[q-1].append(p-1)
    b = list(range(n))
    for i in range(n):
        def g(j):
            if b[j] != j:
                return
            b[j] = i
            for k in a[j]:
                g(k)
        g(i)
    return b
a = f(k)
b = f(l)
c = Counter((a[i],b[i]) for i in range(n))
print(' '.join((str(c[a[i],b[i]]) for i in range(n))))
Problem p03836 (python)

Fixed submission:
import sys
inp=sys.stdin.readline()
sx,sy,tx,ty=map(lambda x: int(x), inp.split(' '))
ret=''
for i in range(ty-sy):
    ret=ret+'U'
for i in range(tx-sx):
    ret=ret+'R'
for i in range(ty-sy):
    ret=ret+'D'
for i in range(tx-sx+1):
    ret=ret+'L'
for i in range(ty-sy+1):
    ret=ret+'U'
for i in range(tx-sx+1):
    ret=ret+'R'
ret=ret+'DR'
for i in range(ty-sy+1):
    ret=ret+'D'
for i in range(tx-sx+1):
    ret=ret+'L'
ret=ret+'U'
print(ret)

Buggy submission (verdict: Runtime Error):
ret=''
for i in range(tx-sx):
    ret=ret+'U'
for i in range(ty-sy):
    ret=ret+'R'
for i in range(tx-sx):
    ret=ret+'D'
import sys
inp=sys.stdin.readline()
sx,sy,tx,ty=map(lambda x: int(x), inp.split(' '))
for i in range(ty-sy+1):
    ret=ret+'L'
for i in range(tx-sx+1):
    ret=ret+'U'
for i in range(ty-sy+1):
    ret=ret+'R'
ret=ret+'DR'
for i in range(tx-sx+1):
    ret=ret+'D'
for i in range(ty-sy+1):
    ret=ret+'L'
ret=ret+'U'
Problem p03852 (python)

Fixed submission:
# -*- coding: utf-8 -*-
s = input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

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

#output = np.ndarray((2*H,W))
output = list()

for i in range(0,H):
    #output[i] = input()
    strings = input()
    print(strings)
    print(strings)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = raw_input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = raw_input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])
Problem p03836 (python)

Fixed submission:
sx, sy, tx, ty = map(int, input().split())
path = ''
for _ in range(tx - sx):
  path += 'R'
for _ in range(ty - sy):
  path += 'U'
for _ in range(tx - sx):
  path += 'L'
for _ in range(ty - sy):
  path += 'D'

  
path += 'D'
for _ in range(tx - sx + 1):
  path += 'R'
for _ in range(ty - sy + 1):
  path += 'U'
path += 'L'
path += 'U'
for _ in range(tx - sx + 1):
  path += 'L'
for _ in range(ty - sy + 1):
  path += 'D'
path += 'R'

print(path)

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

for b in behavior:
  if b == 'S':
    if A > 0:
      A -= 1
  elif b == 'C':
    if B > 0:
      B -= 1
  elif b == 'E':
    if not ((A == 0) and (B == 0)):
      if A >= B:
        A -= 1
      else:
        B -= 1
print(A)
print(B)
Problem p04044 (python)

Fixed submission:
N, L = map(int,input().split())
words = []
for i in range(N):
  words.append(input())
 
words.sort()
print(''.join(words))

Buggy submission (verdict: Runtime Error):
L, N = map(int,input().split())
words = []
for i in range(N):
  words.append(input())

words.sort()
print(''.join(words))
Problem p03838 (python)

Fixed submission:
x, y = map(int, input().split())
if x==0 and y==0:
	print(0)
elif x>=0 and y==0:
	print(x+1)
elif x>=0 and y>=0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)
elif x>=0 and y<0:
	print(abs(x+y)+1)
elif x<0 and y==0:
	print(abs(x))
elif x<0 and y>=0:
	print(abs(x+y)+1)
elif x<0 and y<0:
	if x<=y:
		print(y-x)
	if x>y:
		print(x-y+2)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
A = [-1]*N*N
sorted_X = sorted(X)
fail_flag = 0
for i in range(N):
	x = sorted_X[i]
	K = X.index(x)+1
	if A[x-1]==-1:
		A[x-1] = K
	else:
		print("No")
		fail_flag = 1
		break
	K_rest = K-1
	j = 0
	while K_rest>0:
		if j==x-1:
			print("No")
			fail_flag = 1
			break
		if A[j]==-1:
			A[j] = K
			K_rest = K_rest-1
		j = j+1

count = 0
num = 1
for i in range(N*N):
	if A[i]==-1:
		A[i] = num
		count = count+1
	if count==N-num:
		num = num+1
		count = 0

if fail_flag==0:
	print("Yes")
	for a in A:
		print(str(a), end=" ")

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
K = 0
K = K+A[1]
if A[0]%2==0 and A[3]%2==0 and A[4]%2==0:
	K = K+A[0]+A[3]+A[4]
elif A[0]%2!=0 and A[3]%2!=0 and A[4]%2!=0:
	K = K+A[0]+A[3]+A[4]
elif A[0]+A[3]+A[4]<=2:
	pass
else:
	K = K+A[0]+A[3]+A[4]-1
print(K)

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
K = 0
K = K+A[1]
if A[0]%2==0 and A[3]%2==0 and A[4]%2==0:
	K = K+A[0]+A[3]+A[4]
elif A[0]%2!=0 and A[3]%2!=0 and A[4]%2!=0:
	K = K+A[0]+A[3]+A[4]
elif A[0]+A[3]+A[4]<=2:
	pass
else:
	K = K+A[0]+A[3]+A[4]-1
print(K)
Problem p03844 (python)

Fixed submission:

a, op,  b = map(str, input().split())
if op =="+":
    print(int(a)+int(b))
else:
    print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a, op,  b = map(int, input().split())
if op =="+":
    print(int(a+b))
else:
    print(int(a-b))

Buggy submission (verdict: Runtime Error):
a, op,  b = map(int, input().split())
if op =="+":
    print(a+b)
else:
    print(a-b)
Problem p03860 (python)

Fixed submission:
a, b, c = map(str, input().split())
print(a[0]+b[0]+c[0])

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
A = b//x
B = a//x
if a%x == 0:
    print(A-B+1)
else:
    print(A-B)

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
A = b//x
B = a//x
if B%x == 0:
    print(A-B+1)
else:
    print(A-B)

Buggy submission (verdict: Runtime Error):
a, b, c = map(input().split())
print(a[0]b[0]c[0])
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i <= k:
        ans += x
    else:
        ans += y
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1:n):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1:n+1):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(n+1):
    if i =< k:
        ans += x
    else:
        ans += y
print(ans)
Problem p03962 (python)

Fixed submission:
s = list(input().split(" "))
s_set = list(set(s))
print(len(s_set))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split(" "))
goukei = k*(k-1)**(n-1)
print(goukei)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split(" "))
goukei = k*(k-1)**(n-1)
print(goukei)
Problem p03844 (python)

Fixed submission:
parameter = input().split(" ")
a = int(parameter[0])
b = int(parameter[2])
if parameter[1] == "+":
    print(a+b)
else:
    print(a-b)

Buggy submission (verdict: Runtime Error):
N = int(input())
number = input().split(" ")
if N%2 == 0:
    count = 0
    for i in range(int(N/2)):
        if number.count(str(2*i +1)) == 2:
            count += 0
        else:
            count += 1
    if count != 0:
        print(0)
    else:
        print(2**(int(N/2)))
else:
    count = 0
    if "0" not in number:
        print(0)
    else:
        for i in range(int((N-1)/2)):
            if number.count(str(2*i+2)) == 2:
                count += 0
            else:
                count += 1
        if count != 0:
            print(0)
        else:
            print(2**(int((N-1)/2)))
Problem p03853 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 22 16:06:57 2017

@author: 0048005387
"""

h, w = map(int, raw_input().split())
c=[]

for i in range(h):
    c.append(map(str, raw_input().split()))
    
for i in c:
    for j in i:
        print j
    for j in i:
        print j

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 22 16:06:57 2017

@author: 0048005387
"""

h, w = map(int, raw_input().split())
c=[]

for i in range(h):
    c.append(map(str, raw_input().split()))
    
for i in c:
    for j in i:
        print j
22 3    for j in i:
        print j
Problem p03844 (python)

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

def main():
    a, op, b = raw_input().split()
    if op == '+':
        result = int(a) + int(b)
    else:
        result = int(a) - int(b)
    print result


if __name__ == "__main__":
    main()

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


def main():
    count = int(raw_input())
    li = [int(n) for n in raw_input().split()]
    if count%2 == 1: # 奇数
        if li.count(0) != 1:
            print 0
            return
        for i in range(count)[2::2]:
            if li.count(i) != 2:
                print 0
                return
        print 2**(count/2)
    else: # 偶数
        for i in range(count)[1::2]:
            if li.count(i) != 2:
                print 0
                return
        print 2**(count/2)



if __name__ == "__main__":
    main()

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

def read_data():
    lines = [line.rstrip() for line in sys.stdin]
    ns = [int(n) for n in lines[1].split()]
    ms = []
    for line in lines[3:]:
        num, sec = line.split()
        ms.append((int(num)-1, int(sec)))
    return ns, ms

def main():
    ns, ms = read_data()
    for (drink_num, drink_sec) in ms:
        result = sum(ns) - ns[drink_num] + drink_sec
        print result


if __name__ == "__main__":
    main()

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

def read_data():
    lines = [line.rstrip() for line in sys.stdin]
    ns = [int(n) for n in lines[1].split()]
    ms = [(int(line.split()[0]), int(line.split()[1])) for line in lines[3:]]
    return ns, ms

def main():
    ns, ms = read_data()
    for (drink_num, drink_sec) in ms:
        result = sum(ns) - ns[drink_num-1] + drink_sec
        print result


if __name__ == "__main__":
    main()
Problem p03844 (python)

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


if op =="+":
    print(int(A) + int(B))
elif op =="-":
    print(int(A)-int(B))

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

OP = input(plus_minus)

if OP == "-":
    print(int(A) + int(B))
elif OP == "+":
    print(int(A) - int(B))

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

OP = input(plus_minus)

if OP == -:
    print(int(A) + int(B))
elif OP == +:
    print(int(A) - int(B))

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

op = + or -

print(int(A) + op + int(B))
Problem p03962 (python)

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

if a==b and b==c:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)

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

if a == b == c:
    print(1)
elif a == b or a == c or b == c:
    print(2)
else:
    print(3)

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

if a == b == c:
    print(1)
elif a == b or a == c or b == c:
    print(2)
else:
    print(3)