Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = raw_input().replace("egg","0").replace("chicken","1")
for i in range(len(a)-1):
	if a[i] == a[i+1]:
		if len(a[:i+1]) >= len(a[i+1:]):
			ans = a[:i+1][-1]
			break
		else:
			ans = a[i+1:][-1]
			break
print "egg" if ans == "0" else "chicken"

Fixed submission:
a = raw_input().replace("egg","0").replace("chicken","1")
for i in range(len(a)-2,-1,-1):
	if a[i] == a[i+1]: a = a[:i+1] + " " + a[i+1:]
a = sorted(a.split(), key = lambda x:len(x), reverse = True)
print "egg" if a[0][-1] == "0" else "chicken"
Buggy python submission (verdict: Runtime Error):
import itertools as it
T,F = True,False

while 1:
    s = raw_input()
    if s == "#": break
    for b,a in zip(["=","->","*","+","-"],[" == "," <= "," and "," or "," not "]):
        s = s.replace(b,a)
    
    for v in xrange(2**11):
        a,b,c,d,e,f,g,h,i,j,k = map(int,list(format(v,"b").zfill(11)))
        if not eval(s):
            print "NO"
            break
    else:
        print "YES"

Fixed submission:
T,F = True,False
while 1:
    s = raw_input()
    if s == "#": break
    for i in xrange(100): s = s.replace("--","")
    for b,a in zip(["=","->","-","*","+"],[") == ("," != 1 or "," not "," and "," or "]):
        s = s.replace(b,a)
    s = "("+s+")"
    for v in xrange(2**11):
        a,b,c,d,e,f,g,h,i,j,k = map(int,list(format(v,"b").zfill(11)))
        if not eval(s):
            print "NO"
            break
    else:
        print "YES"
Buggy python submission (verdict: Runtime Error):
n = input()
mind = n
for i in range(max(0,n-20),min(10001,n+20)):
	if i == int(str(i)[::-1]) and abs(n - i) < mind:
		mind = abs(n - i)
		ans = i
print ans

Fixed submission:
n = input()
i = 0
while 1:
	n1,n2 = str(n-i), str(n+i)
	if n1 == n1[::-1]:
		print n1
		break
	elif n2 == n2[::-1]:
		print n2
		break
	i += 1
Buggy python submission (verdict: Time Limit Exceeded):
slp = [map(int,raw_input().split()) for _ in range(int(raw_input()))]
dp = [0]*400
for s,l,p in slp:
    for i in range(s,l+1): dp[i] = max(dp[i],p)

for s,l,p in slp:
    for i in range(s,400-s):
        if dp[i]:
            for j in range(i+s,min(399,i+l+1)):
                dp[j] = max(dp[j],dp[i]+p)

ans = []
for roop in range(int(raw_input())):
    w = int(raw_input())
    if dp[w] == 0:
        print -1
        break
    ans.append(dp[w])
else:
    for a in ans: print a

Fixed submission:
slp = [map(int,raw_input().split()) for _ in range(int(raw_input()))]
maxp = [0]*400

for s,l,p in slp:
    for i in range(s,l+1): maxp[i] = max(maxp[i],p)

dp = maxp[:]
for i in range(399):
    for l in range(1,400-i):
        dp[i+l] = max(dp[i+l],dp[i]+maxp[l])

ans = []
for roop in range(int(raw_input())):
    w = int(raw_input())
    if dp[w] == 0:
        print -1
        break
    ans.append(dp[w])
else:
    for a in ans: print a
Buggy python submission (verdict: Time Limit Exceeded):
def solve(G,start):
	for i in range(n):
		if G[start][i]:
			cost[i] = max(cost[i],cost[start] + G[start][i])
			solve(G,i)
n,m = map(int,raw_input().split())
G = [[0]*n for i in range(n)]
for i in range(m):
	a,b,c = map(int,raw_input().split())
	G[a][b] = c
cost = [0]*n
solve(G,0)
print cost[n-1]

Fixed submission:
inf = 1e9
n,m = map(int,raw_input().split())
edge = [map(int,raw_input().split()) for i in range(m)]
d = [inf]*n
d[0] = 0
while 1:
	update = 0
	for i in range(m):
		a,b,c = edge[i]
		if d[a] != inf and d[b] > d[a] - c:
			d[b] = d[a] - c
			update = 1
	if update == 0: break
print abs(d[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
def solve(G,goal):
	cost = 0
	for i in range(n):
		if G[i][goal]:
			cost = max(cost,G[i][goal] + solve(G,i))
	return cost
n,m = map(int,raw_input().split())
G = [[0]*n for i in range(n)]
for i in range(m):
	a,b,c = map(int,raw_input().split())
	G[a][b] = c
print solve(G,n-1)

Fixed submission:
inf = 1e9
n,m = map(int,raw_input().split())
edge = [map(int,raw_input().split()) for i in range(m)]
d = [inf]*n
d[0] = 0
while 1:
	update = 0
	for i in range(m):
		a,b,c = edge[i]
		if d[a] != inf and d[b] > d[a] - c:
			d[b] = d[a] - c
			update = 1
	if update == 0: break
print abs(d[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
def solve():
	for k in range(n):
		for i in range(n):
			for j in range(n):
				d[i][j] = min(d[i][j],d[i][k] + d[k][j])

n,m = map(int,raw_input().split())
d = [[1e10]*n for i in range(n)]
for i in range(m):
	a,b,c = map(int,raw_input().split())
	d[a][b] = -c
solve()
print abs(d[0][n-1])

Fixed submission:
inf = 1e9
n,m = map(int,raw_input().split())
edge = [map(int,raw_input().split()) for i in range(m)]
d = [inf]*n
d[0] = 0
while 1:
	update = 0
	for i in range(m):
		a,b,c = edge[i]
		if d[a] != inf and d[b] > d[a] - c:
			d[b] = d[a] - c
			update = 1
	if update == 0: break
print abs(d[n-1])

Buggy python submission (verdict: Runtime Error):
inf = 1e10
n,m = map(int,raw_input().split())
edge = [map(int,raw_input().split()) for i in range(m)]
d = [[inf]*n for i in range(n)]
for i in range(m):
	d[0] = 0
	while 1:
		update = False
		a,b,c = edge[i]
		if d[a] != inf and d[b] > d[a] - c:
			d[b] = d[a] - c
			update = True
		if not update: break
print abs(d[n-1])

Fixed submission:
inf = 1e9
n,m = map(int,raw_input().split())
edge = [map(int,raw_input().split()) for i in range(m)]
d = [inf]*n
d[0] = 0
while 1:
	update = 0
	for i in range(m):
		a,b,c = edge[i]
		if d[a] != inf and d[b] > d[a] - c:
			d[b] = d[a] - c
			update = 1
	if update == 0: break
print abs(d[n-1])
Buggy python submission (verdict: Runtime Error):
p=raw_input()
if len(p)<6 or islower(p) or isupper(p) or isdigit(p):
	print "INVARID"
else:
	print "VARID"

Fixed submission:
p=raw_input()
print "INVALID" if len(p)<6 or p.isalpha() or p.isdigit() or p.islower() or p.isupper() else "VALID"
Buggy python submission (verdict: Runtime Error):
data = [[1, "kogaku10gokan"]

n, q = map(int, raw_input().split())
for i in range(n):
    a, b = map(int, raw_input().split())
    data.append([a,b])

for i in data:
    if i[0] > q:
        print i[1]

Fixed submission:
n,q = map(int,raw_input().split())
old = "kogakubu10gokan"
for i in range(n):
	year,new = map(str,raw_input().split())
	if int(year) >= q:
		print new if int(year) == q else old
		break
	old = new
else:
	print old
Buggy python submission (verdict: Runtime Error):
ref = "0123456789ACDEFGHIJKLMNOPQRSTUVWXYZ"
while 1:
    N,M,Q = map(int,raw_input().split())
    if N == 0: break

    corr = [set(range(N)) for _ in range(M)]
    s = ["0"]*N
    for loop in xrange(Q):
        S,B = raw_input().split()
        for i in range(N):
            if S[i] == "1": s[i] = {"0":"1","1":"0"}[s[i]]           
        on  = set([i for i in range(N) if s[i] == "1"])
        off = set(range(N))-on
        for i in range(M):
            if B[i] == "1": corr[i] &= on
            else:           corr[i] &= off
    ans = [ref[list(i)[0]] if len(i) == 1 else "?" for i in corr]
    print "".join(ans)

Fixed submission:
ref = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
while 1:
    N,M,Q = map(int,raw_input().split())
    if N == 0: break
    sn = set(range(N))
    corr = [set(range(N)) for _ in range(M)]
    s = [0]*N
    for loop in xrange(Q):
        S,B = raw_input().split()
        s = [1-s[i] if S[i] == "1" else s[i] for i in range(N)]
        on  = set([i for i in range(N) if s[i]])
        off = sn-on
        for i in range(M):
            corr[i] &= on if B[i] == "1" else off
    ans = [ref[list(i)[0]] if len(i) == 1 else "?" for i in corr]
    print "".join(ans)

Buggy python submission (verdict: Runtime Error):
ref = "0123456789ACDEFGHIJKLMNOPQRSTUVWXYZ"
while 1:
    N,M,Q = map(int,raw_input().split())
    if N == 0: break
    sn = set(range(N))
    corr = [set(range(N)) for _ in range(M)]
    s = [0]*N
    for loop in xrange(Q):
        S,B = raw_input().split()
        s = [1-s[i] if S[i] == "1" else s[i] for i in range(N)]
        on  = set([i for i in range(N) if s[i]])
        off = sn-on
        for i in range(M):
            corr[i] &= on if B[i] == "1" else off
    ans = [ref[list(i)[0]] if len(i) == 1 else "?" for i in corr]
    print "".join(ans)

Fixed submission:
ref = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
while 1:
    N,M,Q = map(int,raw_input().split())
    if N == 0: break
    sn = set(range(N))
    corr = [set(range(N)) for _ in range(M)]
    s = [0]*N
    for loop in xrange(Q):
        S,B = raw_input().split()
        s = [1-s[i] if S[i] == "1" else s[i] for i in range(N)]
        on  = set([i for i in range(N) if s[i]])
        off = sn-on
        for i in range(M):
            corr[i] &= on if B[i] == "1" else off
    ans = [ref[list(i)[0]] if len(i) == 1 else "?" for i in corr]
    print "".join(ans)
Buggy python submission (verdict: Runtime Error):
def dfs(i, z):
    print "." * z + name[i]
    for j in child[i]:
        dfs(j, z + 1)

n = int(raw_input())
name = []
child = [[] for i in xrange(n)]
for i in xrange(n):
    k = int(raw_input())
    m = raw_input()
    name.append(m)
    if k == 0: continue
    child[k - 1].append(i)

dfs(0, 0)

Fixed submission:
import sys
sys.setrecursionlimit(9999)
def dfs(i, z):
    print "." * z + name[i]
    for j in child[i]:
        dfs(j, z + 1)

n = int(raw_input())
name = []
child = [[] for i in xrange(n)]
for i in xrange(n):
    k = int(raw_input())
    m = raw_input()
    name.append(m)
    if k == 0: continue
    child[k - 1].append(i)

dfs(0, 0)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimi(9999)
def dfs(i, z):
    print "." * z + name[i]
    for j in child[i]:
        dfs(j, z + 1)

n = int(raw_input())
name = []
child = [[] for i in xrange(n)]
for i in xrange(n):
    k = int(raw_input())
    m = raw_input()
    name.append(m)
    if k == 0: continue
    child[k - 1].append(i)

dfs(0, 0)

Fixed submission:
import sys
sys.setrecursionlimit(9999)
def dfs(i, z):
    print "." * z + name[i]
    for j in child[i]:
        dfs(j, z + 1)

n = int(raw_input())
name = []
child = [[] for i in xrange(n)]
for i in xrange(n):
    k = int(raw_input())
    m = raw_input()
    name.append(m)
    if k == 0: continue
    child[k - 1].append(i)

dfs(0, 0)
Buggy python submission (verdict: Runtime Error):
import math
d = float(raw_input())
res = math.sqrt(2) * d
for x in xrange(1, 11):
    if x * x <= d * d <= x * 2 + 1:
        ans = max(ans, d + 1.0)
print "%.10f" % ans

Fixed submission:
import math
d = float(raw_input())
ans = math.sqrt(2) * d
for x in xrange(1, 11):
    if x * x <= d * d <= x * 2 + 1:
        ans = max(ans, x + 1)
print "%.10f" % ans
Buggy python submission (verdict: Runtime Error):
def: isort(n,a):
    print " ".join(map(str, a))
    for j in range(1,n):
        key = a[j]
        i = j-1
        while i >= 0 and a[i] > key:
            a[i+1] = a[i]
            i = i - 1
        a[i+1] = key
        print " ".join(map(str, a))

n = int(raw_input())
a = map(int, raw_input().split())
isort(n,a)

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())
print " ".join(map(str, a))
for j in range(1,len(a)):
    key = a[j]
    i = j -1
    while i >= 0 and a[i] > key:
        a[i + 1] = a[i]
        i = i -1
    a[i+1]= key
    print " ".join(map(str, a))
Buggy python submission (verdict: Runtime Error):
cat ALDS1_1_d.py
n = int(raw_input())
R = [int(raw_input()) for i in xrange(n)]
mn = R[0]
ans = -1e10
for r in R[1:]:
    ans = max(ans, r - mn)
    mn = min(mn, r)
print ans

Fixed submission:
n = int(raw_input())
R = [int(raw_input()) for i in xrange(n)]
mn = R[0]
ans = -1e10
for r in R[1:]:
    ans = max(ans, r - mn)
    mn = min(mn, r)
print ans
Buggy python submission (verdict: Runtime Error):
def ss(n, a):
    count = 0
    for i in range(n):
        mini = i
        for j in range(i,n):
            if a[j] < a[mini]:
                mini = j
        if i != mini:
            a[i], a[mini] = a[mini], a[i]
            count += 1
    print " ".join(map(str, a))
    print count
    
ss(int(raw_input()), map(int, raw_inpu().split()))

Fixed submission:
n = int(raw_input())
a = map(int, raw_input().split())
count = 0
for i in range(n):
    mini = i
    for j in range(i,n):
        if a[j] < a[mini]:
            mini = j
    if i != mini:
        a[i], a[mini] = a[mini], a[i]
        count += 1
print " ".join(map(str, a))
print count
Buggy python submission (verdict: Runtime Error):
a = [raw_input() for i in range(4)]
print len(set(a[1].split())&set(a[3].split())

Fixed submission:
a = [raw_input() for i in range(4)]
print len(set(a[1].split())&set(a[3].split()))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
ls = []
for i in range(n):
    inp = raw_input()
    if inp[0] == "i":
        ls.append(inp[7:])
    else:
        print "yes" if inp[5:] in ls else "no"
            

Fixed submission:
n = int(raw_input())
ls = {}
for i in range(n):
    inp = raw_input()
    if inp[0] == "i":
        ls[inp[7:]] = 1
    else:
        try:
        	if ls[inp[5:]]: print "yes"
        except:
        	print "no"

Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
ls = [[] for i in range(12)]
for i in range(n):
    inp = raw_input()
    if inp[0] == "i":
        ls[len(inp[7:])].append(inp[7:])
    else:
        print "yes" if inp[5:] in ls[len(inp[5:])] else "no"
            

Fixed submission:
n = int(raw_input())
ls = {}
for i in range(n):
    inp = raw_input()
    if inp[0] == "i":
        ls[inp[7:]] = 1
    else:
        try:
        	if ls[inp[5:]]: print "yes"
        except:
        	print "no"

Buggy python submission (verdict: Runtime Error):
dict = {"A":1,"C":2,"G":3,"T":4}
def a2n(a):
	ans = 0
	for i in range(len(a)):
		ans += dict[a[i]]*4**i
	return ans
	
n = int(raw_input())
ls = [0 for i in range(1000000)]
for i in range(n):
    inp = raw_input()
    if inp[0] == "i":
        ls[a2n(inp[7:])] = 1
    else:
        print "yes" if ls[a2n(inp[5:])] else "no"
            

Fixed submission:
n = int(raw_input())
ls = {}
for i in range(n):
    inp = raw_input()
    if inp[0] == "i":
        ls[inp[7:]] = 1
    else:
        try:
        	if ls[inp[5:]]: print "yes"
        except:
        	print "no"
Buggy python submission (verdict: Time Limit Exceeded):
def solve(Mi,i):
	if Mi == 0: return True
	if i < n and Mi > 0:
		r1 = solve(Mi-A[i],i+1)
		r2 = solve(Mi,i+1)
		if r1: return r1
		if r2: return r2
n = input()
A = map(int,raw_input().split())
q = input()
M = map(int,raw_input().split())
for Mi in M:
	print "yes" if solve(Mi,0) else "no"

Fixed submission:
def solve(Mi,i):
	if Mi == 0: return True
	if i < n and A[i] <= Mi <= sum(A[i:]):
		r1 = solve(Mi-A[i],i+1)
		if r1: return r1
		r2 = solve(Mi,i+1)
		if r2: return r2
n = input()
A = sorted(map(int,raw_input().split()))
q = input()
M = map(int,raw_input().split())
for Mi in M:
	print "yes" if solve(Mi,0) else "no"
Buggy python submission (verdict: Runtime Error):
import bisect
def lis(A):
    n = len(A)
    L = [0] * n
    L[0] = A[0]
    length = 1

    for i in xrange(1, n):
        if L[length - 1] < A[i]:
            L[length] = A[i]
            length += 1
        else:
            L[bisect.bisect_left(L, A[i])] = A[i]

    return length

n = int(raw_input())
a = [int(raw_input()) for i in xrange(n)]
print lis(a)

Fixed submission:
import bisect
def lis(A):
    n = len(A)
    L = [0] * n
    L[0] = A[0]
    length = 1

    for i in xrange(1, n):
        if L[length - 1] < A[i]:
            L[length] = A[i]
            length += 1
        else:
            L[bisect.bisect_left(L[:length], A[i])] = A[i]

    return length

n = int(raw_input())
a = [int(raw_input()) for i in xrange(n)]
print lis(a)
Buggy python submission (verdict: Runtime Error):
class RangeMinQuery:
    inf = 2 ** 31 - 1
    def __init__(self, N):
        self.n = 1
        while self.n < N: self.n *= 2
        self.dat = [self.inf] (2 * self.n - 1)

    def update(self, k, x):
        k += self.n - 1
        self.dat[k] = x
        while (k > 0):
            k = (k - 1) / 2
            self.dat[k] = min(self.dat[2 * k + 1], self.dat[2 * k + 2])

    # [a, b); call query(a, b)
    def query(self, a, b, k = 0, l = 0, r = -1):
        if r == -1: r = self.n
        if r <= a  or b <= l: return self.inf
        if a <= l and r <= b: return self.dat[k]

        vl = self.query(a, b, 2 * k + 1, l, (l + r) / 2)
        vr = self.query(a, b, 2 * k + 2, (l + r) / 2, r)
        return min(vl, vr)

n, q = map(int, raw_input().split())
rmq = RangeMinQuery(n)
for i in xrange(q):
    c, x, y = map(int, raw_input().split())
    if c == 0:
        c.update(x, y)
    else:
        print c.query(x, y + 1)

Fixed submission:
class RangeMinQuery:
    inf = 2 ** 31 - 1
    def __init__(self, N):
        self.n = 1
        while self.n < N: self.n *= 2
        self.dat = [self.inf] * (2 * self.n - 1)
 
    def update(self, k, x):
        k += self.n - 1
        self.dat[k] = x
        while (k > 0):
            k = (k - 1) / 2
            self.dat[k] = min(self.dat[2 * k + 1], self.dat[2 * k + 2])
 
    # [a, b); call query(a, b)
    def query(self, a, b, k = 0, l = 0, r = -1):
        if r == -1: r = self.n
        if r <= a  or b <= l: return self.inf
        if a <= l and r <= b: return self.dat[k]
 
        vl = self.query(a, b, 2 * k + 1, l, (l + r) / 2)
        vr = self.query(a, b, 2 * k + 2, (l + r) / 2, r)
        return min(vl, vr)
 
n, q = map(int, raw_input().split())
rmq = RangeMinQuery(n)
for i in xrange(q):
    c, x, y = map(int, raw_input().split())
    if c == 0:
        rmq.update(x, y)
    else:
        print rmq.query(x, y + 1)
Buggy python submission (verdict: Runtime Error):
class BIT:
    def __init__(self, size):
        self.size = size
        self.bit = [0] * (size + 1)

    # sum [0, i)
    def sum(self, i):
        s = 0
        while (i > 0):
            s += self.bit[i]
            i -= i & -i
        return s

    # sum [i, j)
    def sum_sec(self, i, j):
        return self.sum(j) - self.sum(j)

    def add(self, i, x):
        i += 1
        while (i <= self.size):
            self.bit[i] += x
            i += i & -i

n, q = map(int, raw_input().split())
bit = BIT(n)
for i in xrange(q):
    c, x, y = map(int, raw_input().split())
    if c == 0: bit.add(x - 1, y)
    else: print bit.sum(x - 1, y)

Fixed submission:
class BIT:
    def __init__(self, size):
        self.size = size
        self.bit = [0] * (size + 1)

    # sum [0, i)
    def sum(self, i):
        s = 0
        while (i > 0):
            s += self.bit[i]
            i -= i & -i
        return s

    # sum [i, j)
    def sum_sec(self, i, j):
        return self.sum(j) - self.sum(i)

    def add(self, i, x):
        i += 1
        while (i <= self.size):
            self.bit[i] += x
            i += i & -i

n, q = map(int, raw_input().split())
bit = BIT(n)
for i in xrange(q):
    c, x, y = map(int, raw_input().split())
    if c == 0: bit.add(x - 1, y)
    else: print bit.sum_sec(x - 1, y)
Buggy python submission (verdict: Runtime Error):
import math

x1, y1, x2, y2 = map(float, raw_input().split())

print sqrt((x2-x1)**2 + (y2-y1)**2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)

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

x1, y1, x2, y2 = raw_input().split()

print sqrt((x2-x1)**2 + (y2-y1)**2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)

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

x1, y1, x2, y2 = float(raw_input().split())

print sqrt((x2-x1)**2 + (y2-y1)**2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)

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

x1, y1, x2, y2 = raw_input().split()
x1 = float(x1)
x2 = float(x2)
y1 = float(y1)
y2 = float(y2)

print sqrt((x2-x1)**2 + (y2-y1)**2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)

Buggy python submission (verdict: Runtime Error):
import math.py

x1, y1, x2, y2 = raw_input().split()

print sqrt((float(x2)-float(x1))**2 + (float(y2)-float(y1))**2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)

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

x1, y1, x2, y2 = map(raw_input().split())
print sqrt((float(x2)-float(x1))**2 + (float(y2)-float(y1))**2)

Fixed submission:
import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)
Buggy python submission (verdict: Runtime Error):
import math

a, b, c = map(float, raw_input())

print a*b*math.sin(c)/2
print a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c))
print b*math.sin(c)

Fixed submission:
import math

a, b, c = map(float, raw_input().split())
c = c/180*math.pi

print a*b*math.sin(c)/2
print a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c))
print b*math.sin(c)

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

a, b, c = map(float, raw_input())

print a*b*math.sin(c)/2
print a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c))
print b*math.sin(c)

Fixed submission:
import math

a, b, c = map(float, raw_input().split())
c = c/180*math.pi

print a*b*math.sin(c)/2
print a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c))
print b*math.sin(c)
Buggy python submission (verdict: Runtime Error):
import random
class Dice:
    def __init__(self, ls):
        self.top,   self.bottom = ls[0], ls[5]
        self.right, self.left   = ls[2], ls[3]
        self.front, self.back   = ls[1], ls[4]

    def rot(self, d):
        if   d == "N":
            (self.top, self.back, self.bottom, self.front) = (
             self.front, self.top, self.back, self.bottom)
        elif d == "S":
            (self.top, self.back, self.bottom, self.front) = (
             self.back, self.bottom, self.front, self.top)
        elif d == "E":
            (self.top, self.right, self.bottom, self.left) = (
             self.left, self.top, self.right, self.bottom)
        elif d == "W":
            (self.top, self.right, self.bottom, self.left) = (
             self.right, self.bottom, self.left, self.top)

    def show(self):
        return (self.top, self.bottom, self.right,
                self.left, self.front, self.back)

S = set()
N = int(raw_input())
judge = True
for i in xrange(N):
    dice = Dice(map(int, raw_input().split()))
    s = set()
    for loop in xrange(1000):
        nums = dice.show()
        if nums in S:
            judge = False
            break
        s.add(nums)
        dice.rot("NSEW"[random.randint(0, 3)])
    if not judge:
        break
    S |= s
print "Yes" if judge else "No"

Fixed submission:
class Dice:
    def __init__(self, top, front, right, left, back, bottom):
        self.top,   self.bottom = top, bottom
        self.right, self.left   = right, left
        self.front, self.back   = front, back

    def rot(self, d):
        if   d == "N":
            self.top, self.back, self.bottom, self.front = self.front, self.top, self.back, self.bottom
        elif d == "S":
            self.top, self.back, self.bottom, self.front = self.back, self.bottom, self.front, self.top
        elif d == "E":
            self.top, self.right, self.bottom, self.left = self.left, self.top, self.right, self.bottom
        elif d == "W":
            self.top, self.right, self.bottom, self.left = self.right, self.bottom, self.left, self.top

ls = map(int, raw_input().split())
dice = Dice(ls[0], ls[1], ls[2], ls[3], ls[4], ls[5])
for d in raw_input():
    dice.rot(d)
print dice.top