Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
q = input()

aset = set()
for i in range(1, len(a) + 1):
    aset |= set(sum(combi) for combi in itertools.combinations(a, i))

for m in map(int, input().split()):
    print('yes' if m in aset else 'no')

Fixed submission:
import itertools

n = input()
a = list(map(int, input().split()))
q = input()
 
aset = set()
for i in range(1, len(a) + 1):
    aset |= set(sum(combi) for combi in itertools.combinations(a, i))
 
for m in map(int, input().split()):
    print('yes' if m in aset else 'no')
Buggy python submission (verdict: Time Limit Exceeded):
SENTINEL = 2 ** 32
cnt = 0
def merge(A, left, mid, right):
    n1 = mid - left
    n2 = right - mid
    L = [i for i in range(n1 +1)]
    R = [i for i in range(n2 +1)]
    for i in range(n1):
        L[i] = A[left + i]
    for i in range(n2):
        R[i] = A[mid + i]
    L[n1] = SENTINEL
    R[n2] = SENTINEL
    i = 0
    j = 0
    for k in range(left, right):
        global cnt
        cnt += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def merge_sort(A, left, right):
    if left+1 < right:
        mid = int((left + right)/2)
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

n = input()
A = list(map(int, input().split()))
merge_sort(A,0,len(A))
print(*A)
print(cnt)

Fixed submission:
SENTINEL = 2 ** 32
cnt = 0
def merge(A, left, mid, right):
    L = A[left:mid] + [SENTINEL]
    R = A[mid:right] + [SENTINEL]
    
    i = 0
    j = 0
    for k in range(left, right):
        global cnt
        cnt += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

n = input()
A = list(map(int, input().split()))
merge_sort(A,0,len(A))
print(*A)
print(cnt)
Buggy python submission (verdict: Runtime Error):
def partition(a, p, r):
    q  = p
    for i in range(p, r):
        if a[i][1] <= a[r][1]:
            a[q], a[i] = a[i], a[q]
            q += 1
    a[q], a[r] = a[r], a[q]
    return q 

def quicksort(a, p, r):
    if p < r:
        q = partition(a, p, r)
        quicksort(a, p, q-1)
        quicksort(a, q+1, r)

def check_stable(a):
    for i in range(1, len(a)):
        if a[i - 1][1] == a[i][1]:
            if a[i - 1][2] > a[i][2]:
                return 'Not stable'
    return 'Stable '
    
import sys
n = sys.stdin.readline()
a = []
for i in range(n):
    suit, num = sys.stdin.readline().split()
    a += [[suit, int(num), i]]

quicksort(a, 0, len(a) - 1)
print(check_stable(a))

for line in a:
    print(line[0],line[1])

Fixed submission:
def partition(a, p, r):
    q  = p
    for i in range(p, r):
        if a[i][1] <= a[r][1]:
            a[q], a[i] = a[i], a[q]
            q += 1
    a[q], a[r] = a[r], a[q]
    return q 
  
def quicksort(a, p, r):
    if p < r:
        q = partition(a, p, r)
        quicksort(a, p, q-1)
        quicksort(a, q+1, r)
  
def check_stable(a):
    for i in range(1, len(a)):
        if a[i - 1][1] == a[i][1]:
            if a[i - 1][2] > a[i][2]:
                return 'Not stable'
    return 'Stable'
      
import sys
n = int(sys.stdin.readline())
a = []
for i in range(n):
    suit, num = sys.stdin.readline().split()
    a += [[suit, int(num), i]]
  
quicksort(a, 0, len(a) - 1)
print(check_stable(a))
  
for line in a:
    print(line[0],line[1])
Buggy python submission (verdict: Time Limit Exceeded):
def parent(i):return (i - 1) // 2
def left(i):return  2 * i + 1
def right(i):return  2 * i + 2
def max_heapify(a, i):
    l = left(i)
    r = right(i)
    largest = l if  l < len(a) and a[l] > a[i] else i
    largest = r if  r < len(a) and a[r] > a[largest] else largest
    
    if largest != i:
        a[i], a[largest] = a[largest], a[i]
        max_heapify(a, largest)
        
def build_max_heap(a):
    for i in range(len(a) // 2, -1, -1):
        max_heapify(a, i)
def max_heap_insert(a, key):
    a.append(key)
    heap_increase_key(a)
def heap_increase_key(a):
    i = len(a) - 1
    while i > 0 and a[parent(i)] < a[i]:
        a[i], a[parent(i)] = a[parent(i)], a[i]
        i = parent(i)
def heap_extract_max(a):
    if  len(a)  == 0:
        raise Exception
    max_heap = a[0]
    a[0] = a[-1]
    a.pop(-1)
    max_heapify(a, 0)
    return max_heap

a = []
while True:
    command = input().split()
    if command[0] == 'insert':
        max_heap_insert(a, int(command[1]))
    elif command[0] == 'extract':
        print(heap_extract_max(a))
    else:
        break

Fixed submission:
from sys import stdin
from heapq import heappop, heappush
readline = stdin.readline


heap = []
while True:
    line = readline()
    if line[1] == 'x':print(-heappop(heap))
    elif line[0] == 'i':heappush(heap, -int(line.split()[1]))
    else:break
Buggy python submission (verdict: Runtime Error):
from sys import stdin
readline = stdin.readline


n, total_wait = map(int, readline().split())
value_wait = [list(map(int, readline().split())) for _ in range(n)]
value_wait.sort(key=operator.itemgetter(1), reverse=True)

dp = [0] * (total_wait + 1)

for ni, (v, w) in enumerate(value_wait):
    for tw in range(w, total_wait + 1):
        if dp[tw] < dp[tw - w] + v:
            dp[tw] = dp[tw - w] + v
print(dp[-1])

Fixed submission:
from sys import stdin
import operator

readline = stdin.readline


n, total_wait = map(int, readline().split())
value_wait = [list(map(int, readline().split())) for _ in range(n)]
value_wait.sort(key=operator.itemgetter(1), reverse=True)

dp = [0] * (total_wait + 1)

for ni, (v, w) in enumerate(value_wait):
    for tw in range(w, total_wait + 1):
        if dp[tw] < dp[tw - w] + v:
            dp[tw] = dp[tw - w] + v
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
readline = stdin.readline

n = int(readline())
a = [int(readline()) for _ in range(n)]

dp = [-float('inf')]

for ai in a:
    for i in range(1, len(dp)):
        if dp[i - 1] < ai and ai < dp[i]:
            dp[i] = ai
    if dp[-1] < ai:
        dp.append(ai)

print(len(dp) - 1)

Fixed submission:
from sys import stdin
from bisect import bisect_left
readline = stdin.readline


dp = [-float('inf')]
n = int(readline())
a = (int(readline()) for _ in range(n))
for ai in a:
    if dp[-1] < ai:
        dp.append(ai)
    else:
        dp[bisect_left(dp, ai)] = ai
print(len(dp) - 1)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
import bisect
readline = stdin.readline

dp = [-float('inf')]
n = int(readline())
a = (int(readline()) for _ in range(n))
for ai in a:
    if dp[-1] < ai:
        dp.append(ai)
    else:
        dp[bisect.bisect(dp, ai)] = ai
print(len(dp) - 1)

Fixed submission:
from sys import stdin
from bisect import bisect_left
readline = stdin.readline


dp = [-float('inf')]
n = int(readline())
a = (int(readline()) for _ in range(n))
for ai in a:
    if dp[-1] < ai:
        dp.append(ai)
    else:
        dp[bisect_left(dp, ai)] = ai
print(len(dp) - 1)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
readline = stdin.readline

h, w = map(int, readline().split())

dp = [list(map(int, readline().split())) for _ in range(h)]

for i in range(h):
    for j in range(w):
        dp[i][j] ^= 1
    
for i in range(1, h):
    for j in range(w):
        if dp[i][j]:
            dp[i][j] = dp[i - 1][j] + 1

max_s = 0
for i in range(h):
    for j in range(w):
        h = dp[i][j]
        for k in range(j, w):
            if dp[i][k] == 0:
                break
            h = min(h, dp[i][k])
            s = h * ((k - j) + 1)
            if max_s < s:
                max_s = s
print(max_s)

Fixed submission:
from sys import stdin
readline = stdin.readline


h, w = map(int, readline().split())
w += 1
dp = [list(map(int, readline().split())) + [1] for _ in range(h)]

for i in range(h):
    for j in range(w):
        dp[i][j] ^= 1
    
for i in range(1, h):
    for j in range(w):
        if dp[i][j]:
            dp[i][j] += dp[i - 1][j]

max_s = 0
for i in range(h):
    stack = []
    for j in range(w):
        if (stack[-1][0] if stack else 0) < dp[i][j]:
            stack.append((dp[i][j], j))
        elif stack and stack[-1][0] > dp[i][j]:
            while stack and stack[-1][0] > dp[i][j]:
                height, l = stack.pop()
                s = height * (j - l)
                if max_s < s:
                    max_s = s
            if dp[i][j]:
                stack.append((dp[i][j], l))
print(max_s)
Buggy python submission (verdict: Runtime Error):
import sys
f = sys.stdin

def unite(x, y):
    global dat
    x, y = find(dat, x), find(dat, y)
    if x != y:
        dat[x] = y

def same(x, y):
    global dat
    x, y = find(dat, x), find(dat, y)
    print(1 if x == y else 0)
def find(dat, x):
    if dat[x] < 0:
        return x
    dat[x] = find(dat, dat[x])
    return dat[x]

com = (unite, same)

n, q = map(int, f.readline().split())
dat = [-1] * n

for c, x, y in (map(int, f.readline().split()) for _ in range(q)):
    com[c](x, y)

Fixed submission:
class union_find:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]

    def union(self, x, y):
        x, y = self.find(x), self.find(y)
        if x == y:return True
        
        if self.table[y] < self.table[x]:x, y = y, x

        self.table[x] += self.table[y]
        self.table[y] = x
        return False
            
    def find(self, x):
        if self.table[x] < 0:return x
        self.table[x] = self.find(self.table[x])
        return self.table[x]

import sys
f = sys.stdin

n, q = map(int, f.readline().split())
uf = union_find(n)

op = (uf.union, lambda x, y:print(1 if uf.find(x) == uf.find(y) else 0))

for com, x, y in (map(int, f.readline().split()) for _ in range(q)):
    op[com](x, y)
Buggy python submission (verdict: Runtime Error):
import math
class segment_tree:
    
    # self.table is 1-indexed
    def __init__(self, dat, query, default=0):
        self.offset = 2 ** math.ceil(math.log2(len(dat)))
        self.table = [default] * self.offset + dat + [default] * (self.offset - len(dat))
        self.query = query
        for i in reversed(range(1, self.offset)):
            self.table[i] = self.query(self.table[2 * i], self.table[2 * i + 1])

    # [l, r] closed-interval
    def find(self, l, r):
        return self.query(self.__range(l,r))

    def __range(self, l, r):
        l += self.offset
        r += self.offset
        while l <= r:
            if l & 1:
                yield self.table[l]
                l += 1
            l >>= 1
            if r & 1 == 0:
                yield self.table[r]
                r -= 1
            r >>= 1
        
    def update(self, i, x):
        i += self.offset
        self.table[i] = x
        while 1 < i:
            i >>= 1
            self.table[i] = self.query(self.table[2 * i], self.table[2 * i + 1])

import sys
f = sys.stdin


n, q = map(int, f.readline().split())

rmq = segment_tree([(1 << 31) - 1] * n, min, float('inf'))

function = (rmq.update, lambda x, y:print(rmq.find(x, y)))
for com, x, y in (map(int, f.readline().split()) for _ in range(q)):
    function[com](x, y)

Fixed submission:
import math
class segment_tree:
    
    # self.table is 1-indexed
    # math.log2 not implemented 3.2.3
    def __init__(self, dat, query, default=0):
        self.offset = 2 ** math.ceil(math.log(len(dat), 2))
        self.table = [default] * self.offset + dat + [default] * (self.offset - len(dat))
        self.query = query
        for i in reversed(range(1, self.offset)):
            self.table[i] = self.query(self.table[2 * i], self.table[2 * i + 1])

    # [l, r] closed-interval
    def find(self, l, r):
        return self.query(self.__range(l,r))

    def __range(self, l, r):
        l += self.offset
        r += self.offset
        while l <= r:
            if l & 1:
                yield self.table[l]
                l += 1
            l >>= 1
            if r & 1 == 0:
                yield self.table[r]
                r -= 1
            r >>= 1
        
    def update(self, i, x):
        i += self.offset
        self.table[i] = x
        while 1 < i:
            i >>= 1
            self.table[i] = self.query(self.table[2 * i], self.table[2 * i + 1])

import sys
f = sys.stdin

n, q = map(int, f.readline().split())

rmq = segment_tree([(1 << 31) - 1] * n, min, float('inf'))

function = (rmq.update, lambda x, y:print(rmq.find(x, y)))
for com, x, y in (map(int, f.readline().split()) for _ in range(q)):
    function[com](x, y)
Buggy python submission (verdict: Runtime Error):
class exist_negative_cycle(Exception):
    pass
def bellman_ford(g, size, start=0):
    d = [float('inf')] * size
    d[start] = 0
   
    for _ in range(size):
        for u in g:
            for length, v in g[u]:
                if d[v] > d[u] + length:
                    d[v] = d[u] + length

    for u in g:
        for length, v in g[u]:
            if d[v] > d[u] + length:
                raise exist_negative_cycle    
    return d
from sys import stdin
readline = stdin.readline

from collections import defaultdict

vertex, edge, r = map(int, readline().split())

g = defaultdict(list)
for i in range(edge):
    s, t, length = map(int, readline().split())
    g[s].append((length, t))
try:
    d = bellman_ford(g, vertex, r)
    for di in d:
        print('INF' if math.isinf(di) else di)
except exist_negative_cycle:
    print('NEGATIVE CYCLE')

Fixed submission:
class exist_negative_cycle(Exception):
    pass
def bellman_ford(g, size, start=0):
    d = [float('inf')] * size
    d[start] = 0
   
    for _ in range(size):
        for u in g:
            for length, v in g[u]:
                if d[v] > d[u] + length:
                    d[v] = d[u] + length

    for u in g:
        for length, v in g[u]:
            if d[v] > d[u] + length:
                raise exist_negative_cycle    
    return d
from sys import stdin
readline = stdin.readline
import math
from collections import defaultdict

vertex, edge, r = map(int, readline().split())

g = defaultdict(list)
for i in range(edge):
    s, t, length = map(int, readline().split())
    g[s].append((length, t))
try:
    d = bellman_ford(g, vertex, r)
    for di in d:
        print('INF' if math.isinf(di) else di)
except exist_negative_cycle:
    print('NEGATIVE CYCLE')
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
def prim(g, v):
    for vi in range(v):
        g[vi].sort()
    
    cost = 0
    heap = iter(g[0])
    rest_tree = set(range(1, v))
    while rest_tree:
        d, u = next(heap)
        if u in rest_tree:
            cost += d
            rest_tree -= {u}
            heap = heapq.merge(heap, g[u])
    return cost

from sys import stdin
readline = stdin.readline


v, e = map(int, readline().split())
from collections import defaultdict
g = defaultdict(list)
for _ in range(e):
    s, t, d = map(int, readline().split())
    g[s].append((d, t))
    g[t].append((d, s))

print(prim(g, v))

Fixed submission:
def kruskal(g, size):
    g.sort(key=itemgetter(2), reverse=True)
    uf = union_find(size)
    tree = []
    while len(tree) < size - 1:
        u, v, d = g.pop()
        if not uf.union(u, v):
            tree.append((u, v, d))
    return tree

class union_find:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]

    def union(self, x, y):
        x, y = self.find(x), self.find(y)
        if x == y:return True
        
        if self.table[y] < self.table[x]:x, y = y, x

        self.table[x] += self.table[y]
        self.table[y] = x
        return False
            
    def find(self, x):
        if self.table[x] < 0:return x
        self.table[x] = self.find(self.table[x])
        return self.table[x]

from sys import stdin
from operator import itemgetter

import heapq

readline = stdin.readline


v, e = map(int, readline().split())

g = [list(map(int, readline().split())) for _ in range(e)]

tree = kruskal(g, v)

print(sum(d for s, t, d in tree))
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())
print(math.sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2)))

Fixed submission:
x1, y1, x2, y2 = map(float, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)

Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split())
print((pow(x1 - x2, 2) + pow(y1 - y2, 2)) ** 0.5)

Fixed submission:
x1, y1, x2, y2 = map(float, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)

Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)

Fixed submission:
x1, y1, x2, y2 = map(float, input().split())
print(((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5)
Buggy python submission (verdict: Runtime Error):
while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    
    ave = sum(s) / n
    dev = math.sqrt(sum((ave - si) ** 2 for si in s) / n)

    print(dev)    

Fixed submission:
import math


while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    
    ave = sum(s) / n
    dev = math.sqrt(sum((ave - si) ** 2 for si in s) / n)

    print("{:.8f}".format(dev))
Buggy python submission (verdict: Runtime Error):
mask = [range(6), (1, 5, 2, 3, 0, 4), (2, 1, 5, 0, 4,3),(3, 1, 0, 5, 4, 2), (4, 0, 2, 3, 5, 1)]
mask += [mask[1][i] for i in mask[1]]

TOP, FRONT, RIGHT, LEFT, BACK, BOTTOM = mask[0]

def set_top(dice, top):
    return [dice[i] for i in mask[top]]

def set_front(dice, front):
    twist = (0, 3, 1, 4, 2, 5)
    while dice[FRONT] != front:
        dice = [dice[i] for i in twist]
    return dice
        
label = input().split()
q = int(input())
for _ in range(q):
    top, front = map(label.index, input().split())
    dice = set_top(mask[0], top)
    dice = set_front(dice, front)
    print(label[dice[RIGHT]])

Fixed submission:
mask = [[i for i in range(6)], (1, 5, 2, 3, 0, 4), (2, 1, 5, 0, 4,3),(3, 1, 0, 5, 4, 2), (4, 0, 2, 3, 5, 1)]
mask += [[mask[1][i] for i in mask[1]]]

TOP, FRONT, RIGHT, LEFT, BACK, BOTTOM = mask[0]

def set_top(dice, top):
    return [dice[i] for i in mask[top]]

def set_front(dice, front):
    twist = (0, 3, 1, 4, 2, 5)
    while dice[FRONT] != front:
        dice = [dice[i] for i in twist]
    return dice
        
label = input().split()
q = int(input())
for _ in range(q):
    top, front = map(label.index, input().split())
    dice = set_top(mask[0], top)
    dice = set_front(dice, front)
    print(label[dice[RIGHT]])
Buggy python submission (verdict: Runtime Error):
mask = [[i for i in range(6)], (1, 5, 2, 3, 0, 4), (2, 1, 5, 0, 4,3),(3, 1, 0, 5, 4, 2), (4, 0, 2, 3, 5, 1)]
mask += [[mask[1][i] for i in mask[1]]]

def set_top(dice, top):
    return [dice[i] for i in mask[top]]

def twist(dice):
    return [dice[i] for i in (0, 3, 1, 4, 2, 5)]

def equal(dice1, dice2):
    if sorted(dice1) != sorted(dice2):
        return False
    
    for i in range(6):
        if i:tmp_dice = set_top(dice2, i)
        for j in range(4):
            if j:tmp_dice = twist(tmp_dice)
            if dice1 == tmp_dice:
                return True
    return False

def diff_check_all(dices, n):
    for i in range(n -1):
        for j in range(i + 1, n):
            if equal(dices[i], dices[j]):
                return False
    return True
            

n = int(input())
dices = [input().split() for _ in range(n)]

print('Yes' if diff_check_all(dices, n) else 'No')

Fixed submission:
mask = [[i for i in range(6)], (1, 5, 2, 3, 0, 4), (2, 1, 5, 0, 4,3),(3, 1, 0, 5, 4, 2), (4, 0, 2, 3, 5, 1)]
mask += [[mask[1][i] for i in mask[1]]]

def set_top(dice, top):
    return [dice[i] for i in mask[top]]

def twist(dice):
    return [dice[i] for i in (0, 3, 1, 4, 2, 5)]

def equal(dice1, dice2):
    if sorted(dice1) != sorted(dice2):
        return False
    
    for i in range(6):
        tmp_dice = set_top(dice2, i)
        for _ in range(4):
            if dice1 == tmp_dice:
                return True
            tmp_dice = twist(tmp_dice)
    return False

def diff_check_all(dices, n):
    for i in range(n -1):
        for j in range(i + 1, n):
            if equal(dices[i], dices[j]):
                return False
    return True
            

n = int(input())
dices = [input().split() for _ in range(n)]

print('Yes' if diff_check_all(dices, n) else 'No')
Buggy python submission (verdict: Runtime Error):
 print(int(input()) ** 3)

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    input = int(input())
    if input == 0:
        break
    print("Case {}: {}, i, input)
    i += 1

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    input = int(input())
    if input == 0:
        break
    print("Case {}: {}", i, input)
    i += 1

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    input = int(input())
    if input == 0:
        break
    print("Case {}: {}".format( i, input))
    i += 1

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    input = int(input())
    if input == 0: break
    print("Case {}: {}".format(i, input))
    i += 1

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    input = input()
    if input == '0': break
    print("Case {}: {}".format(i, input))
    i += 1

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')

Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    input = input()
    if input == '0':
        break
    print("Case {}: {}".format(i, input))
    i += 1

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')

Buggy python submission (verdict: Runtime Error):
import sys, itertools
 
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0:
        break
    print('Case {0}: {1}'.format(count, input)

Fixed submission:
import sys, itertools
  
for count, input in zip(itertools.count(1), sys.stdin):
    if int(input) == 0: break
    print('Case {0}: {1}'.format(count, input), end='')
Buggy python submission (verdict: Runtime Error):
import sys, operator

list = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.div}

for line in sys.stdin:
    a, op, b = line.split()
    if op == '?': break
    print(int(list[op](a, b)))

Fixed submission:
import sys, operator

list = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv}

for line in sys.stdin:
    a, op, b = line.split()
    if op == '?': break
    print(int(list[op](int(a), int(b))))