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

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            q, mod = divmod(b,a)
            return 2*q*a + func(a, mod)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            q, mod = divmod(a,b)
            return 2*q*b + func(mod, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            return 2*a + func(a, b-a)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            return 2*b + func(a-b, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return b//a*2 - 1
        else:
            return 2*a + func(a, b-a)
    else:
        if a%b == 0:
            return a//b*2 - 1
        else:
            return 2*b + func(a-b, b)

print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return b/a*2 - 1
        else:
            return 2*a + func(a, b-a)
    else:
        if a%b == 0:
            return a/b*2 - 1
        else:
            return 2*b + func(a-b, b)
            
if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))
Problem p03251 (python)

Fixed submission:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
a.append(x)
b=list(map(int,input().split()))
b.append(y)
print("No War" if max(a)<min(b) else "War")

Buggy submission (verdict: Runtime Error):
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print("No War" if min(a)<=x<=max(a) and min(b)<=y<=max(b) and max(a) =<min(b) else "War")
Problem p03316 (python)

Fixed submission:
#coding: utf-8

N = str(input())
sum = 0

for i in range(len(N)):
    sum += int(N[i])

if(int(N)%sum==0):
    print('Yes')
else:
    print('No')

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

N = str(input())
sum = 0

for i in range(len(S)):
    sum += int(N[i])

if(int(N)%sum==0):
    print('Yes')
else:
    print('No')
Problem p03325 (python)

Fixed submission:
#coding: utf-8
N = int(input())
L = list(map(int, input().split()))

cnt = 0
tri_cnt = 0
mem = 0

#全てが奇数になるまで実行し続ける
while(mem != len(L)):
    if(L[mem]%2 != 0):
        mem += 1
    else:
        L[mem] //= 2
        # for i in range(len(L)):
        #     if(i != mem):
        #         L[i] = L[i] * 3
        #         print('',end='')
        cnt += 1

    # tri_cnt = 0
    # for i in range(len(L)):
    #     if (L[i] % 2 != 0):
    #         tri_cnt += 1
else:
    print(cnt)

Buggy submission (verdict: Runtime Error):
#coding: utf-8
N = int(input())
L = list(map(int, input().split()))

cnt = 0
tri_cnt = 0
mem = 0

#全てが奇数になるまで実行し続ける
while(tri_cnt != len(L)):
    if(L[mem]%2 != 0):
        mem += 1
    else:
        L[mem] /= 2
        for i in range(len(L)):
            if(i != mem):
                L[i] *= 3
        cnt += 1

    tri_cnt = 0
    for i in range(len(L)):
        if (L[i] % 2 != 0):
            tri_cnt += 1

else:
    print(cnt)

Buggy submission (verdict: Runtime Error):
#coding: utf-8
N = int(input())
L = list(map(int, input().split()))

cnt = 0
tri_cnt = 0

mem = 0

#全てが3の倍数になるまで実行し続ける
while(tri_cnt != len(L)):
    if(L[mem]%2 == 0):
        mem += 1
    else:
        L[mem] /= 2
        for i in range(len(L)):
            if(i != mem):
                L[i] *= 3
        cnt += 1
        
    for i in range(len(L)):
        if (L[i] % 3 == 0):
            tri_cnt += 1

else:
    print(cnt)
Problem p03680 (python)

Fixed submission:
#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = int(sys.stdin)
a = []
for i in range(N):
    a.append(int(sys.stdin))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = sys.stdin
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = map(int, sys.stdin)
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = int(sys.stdin)
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
from statistics import mean
import math
x = mean(list(map(int, input().split()))
print(math.ceil(x))
Problem p03693 (python)

Fixed submission:
r, g, b = input().split()
rgb = int(r+g+b)
if rgb%4==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = input().split()
rgb = map(int, r+g+b)
if rgb%4==0:
  print("YES")
else:
  print("NO")
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
else :
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(int(input()) for _ in range(n))
a=[]
h.sort(reverse=True)
for i in range(n-k+1):
    a.append(h[i]-h[i+k-1])
    if 0 in a:
        print(0)
        exit()
print(min(a))
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(t-a-i*0.006))

print(s.index(min(s))+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(a-t+i*0.006))

print(s.index(min(s))+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in range(n):
    s.append(abs(a-t+i*0.006))

print(s.index(min(s))+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(753-t+a*0.006))

print(s.index(min(s))+1)

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

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = int(X + Y/2)

print(x)

Buggy submission (verdict: Runtime Error):
X,Y = int(input()),int(input())
x = X + Y/2
print(x)

Buggy submission (verdict: Runtime Error):
X = input()
Y = input()
print(int(X+Y/2)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = X + Y/2
print(int(x))

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = int(X + Y/2)
print(x)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = X + Y/2
print(str(x))

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = X + Y/2
print(x)

Buggy submission (verdict: Runtime Error):
input_X = input()
input_Y = input()
X = int(input_X)
Y = int(input_X)
x = X + Y/2

print(x)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = X + Y/2

print(x)

Buggy submission (verdict: Runtime Error):

X = int(input())
Y = int(input())

x = X + Y/2

print(str(x))

Buggy submission (verdict: Runtime Error):

X = int(input())
Y = int(input())

x = X + Y/2

print(x)

Buggy submission (verdict: Runtime Error):

X = int(input())
Y = int(input())

x = X + Y/2

print(x)

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

x = round(X + Y/2)

print(x)

Buggy submission (verdict: Runtime Error):

X = int(input())
Y = int(input())

x = X + Y/2

print(round(x))

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())

print(round(X+Y/2))

Buggy submission (verdict: Runtime Error):

X = int(input())
Y = int(input())

print(X+Y/2)
Problem p03220 (python)

Fixed submission:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(t-i*0.006-a))

print(s.index(min(s))+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
s = []
f = 1
for i in range(1,n+1):
    h = int(input())
    d = int(abs(a-t-h*0.006))
    s.append(d)
    if d == min(s):
       f = i
print(f)

Buggy submission (verdict: Runtime Error):
n = int(input())
a,t = map(int,input().split())
s = 0
t = 1
for i in range(1,n+1):
    h = int(input())
    if a-t-h*0.006 <= s:
        t = i 
print(i)
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=[]

x,y,k=-1,-1,-1
n=-1
for _ in range(n):
    a.append(list(map(int,input().split())))
    if a[_][2] != 0:
        n=i
for i in range(101):
    for j in range(101):
        h=a[0][2]+abs(a[0][0]-i)+abs(a[0][1]-j)
        d=True

        for l in range(n):
            if a[l][2] > 0 and h != a[l][2]+abs(a[l][0]-i)+abs(a[l][1]-j):
                d=False
            if a[l][2]==0 and h>abs(a[l][0]-i)+abs(a[l][1]-j):
                d=False
            
        if d:
            x,y,k=i,j,h
            print(x,y,k)
            exit()
Problem p03239 (python)

Fixed submission:
n,t = map(int,input().split())
d = []

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d== []:
    print("TLE")
else:
    print(min(d))

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
d = []

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d == 0:
    print("TLE")
else:
    print(min(d))
Problem p03251 (python)

Fixed submission:
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

print(["War","No War"][X<min(y) and max(x)<Y and max(x)<min(y)])

Buggy submission (verdict: Runtime Error):
n,m,X,Y = map(int,input().split())
x = map(int,input().split())
y = map(int,input().split())

print(["War","No War"][X<min(y) and max(x)<Y and max(x)<min(y)])
Problem p03261 (python)

Fixed submission:
n = int(input())
w = [input() for i in range(n)]
ans = "Yes"
if len(set(w)) != n:
    ans = "No"
for j in range(1,len(w)):
    if w[j-1][-1] != w[j][0]:
        ans = "No"
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
w = []
a = input()
w.append(a)

for i in range(n):
    b = input()
    if b[0] != a[-1] or b in count:
        print("No")
        quit()
    count.append(b)
    a=b
print("Yes")
Problem p03273 (python)

Fixed submission:
h,w = map(int,input().split())
a = []
for _ in range(h):
    i = input()
    if "#" in i:
        a.append(i)

ans = []
for i in zip(*a):
    if "#" in i:
        ans.append(i)
for j in zip(*ans):
    print(*j,sep = "")

Buggy submission (verdict: Runtime Error):
import numpy as np
h,w=map(int,input().split())
s=[]
for _ in range(w):
    a = input() 
    if "#" in a:
        s.append(a)
d = []
for i in zip(*s):
    if "#" in i:
        d.append(i)
for j in zip(*d):
    print(*j,sep="")

Buggy submission (verdict: Runtime Error):
import numpy as np
h,w=map(int,input().split())
s=[]
for _ in range(w):
    a = input() 
    if "#" in a:
        s.append(a)
d = []
for i in zip(*s):
    if "#" in i:
        d.append(i)
for j in zip(*d):
    print(*j,sep="")
Problem p03293 (python)

Fixed submission:
s = input()
t = input()
print(["No","Yes"][t in s*2])

Buggy submission (verdict: Runtime Error):
vs=input()
t=input()
print("Yes" if t in s*2 else "No")
Problem p03316 (python)

Fixed submission:
n = int(input())
s = 0
for i in str(n):
    s += int(i)
print("Yes" if n%s == 0 else "No")

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in len(n):
    s += int(n[i])

print(["No","Yes"][int(n)%s == 0])

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in len(n):
    s += int(n[i])

print(["No","Yes"][n%s == 0])

Buggy submission (verdict: Runtime Error):
n = int(input())
s = 0
for i in len(n):
    s += n[i]

print(["No","Yes"][n%s == 0])

Buggy submission (verdict: Runtime Error):
n = int(input())
s = 0
for i in n:
    s += n[i]

print(["No","Yes"][n%s == 0])

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in n:
    s += n[i]

print(["No","Yes"][n%s == 0])

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in n:
    s += n[i]

print(["No","Yes"][n%s == 0])
Problem p03328 (python)

Fixed submission:
a,b = map(int,input().split())
s = b-a
d = []
f = 0
for i in range(1,1000):
    f += i
    d.append(f)

print(d[s-1]-b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
d = []
f = 0
for i in range(1,1000):
    f += i
    d.append(f)
c = []
for j in range(b) :
    c.append(abs(d[j]-a))
print(min(c))
Problem p03338 (python)

Fixed submission:
n = int(input())
s = input()
a = 0
for i in range(1,n):
    a = max(a, len(set(s[:i]) & set(s[i:])))

print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
a = 0
for i in range(1,n):
    a = max(a,set(s[:i]) & set(s[i:]))

print(a)
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
x = abs(a-b)
y = abs(b-c)
z = abs(a-c)
if x <= d and y <= d:
    print("Yes")
elif z <= d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
a = 0
for i in range(1,x+1):
    for j in range(2,4):
        if i**j <= x:
            a = max(a,i**j)
print(a)
Problem p03377 (python)

Fixed submission:
a,b,c = map(int,input().split())
if (a+b>=c and a<= c):print("YES")
else:print("NO")

Buggy submission (verdict: Runtime Error):
a,b,x = map(int,input().split())
print(["NO","YES"][(a+b>=c)*(a<=c)])

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if x-a<=b and x>=a:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,x = map(int,input().split())
print(["No","Yes"][(a+b>=c)*(a<=c)])
Problem p03386 (python)

Fixed submission:
a,b,k = map(int,input().split())
if b+1-a <= k*2:
    for i in range(a,b+1):
        print(i)
else:
    for j in range(a,a+k):
        print(j)
    for l in range(b-k+1,b+1):
        print(l)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
k = int(input())
for i in range(a,b+1):
    if i<a+k or i>b-k:
        print(i)
Problem p03399 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())

print(min(a,b)+min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print(min(a,b)+min(c,d))
Problem p03407 (python)

Fixed submission:
a,b,c = map(int,input().split())
print(["Yes","No"][a+b<c])

Buggy submission (verdict: Runtime Error):
n = int(input())
s = {}
for i in range(n):
    d = input()
    if d in s:
        s[d] += 1
    else:
        s.update({d:1}) 

m = int(input())
for j in range(m):
    t = input()
    if t in s:
        s[t] -= 1
    else:
        s.update({t:-1})

print("0" if max(d.values()) < 0 else max(d.values()))
Problem p03408 (python)

Fixed submission:
n = int(input())
s = list(input() for _ in range(n))

m = int(input())
t = list(input() for _ in range(m))

a = 0
d = 0
for i in s:
    a = s.count(i)-t.count(i)
    if d <= a:
        d = a
print(d)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = {}
for i in range(n):
    d = input()
    if d in s:
        s[d] += 1
    else:
        s.update({d:1}) 

m = int(input())
for j in range(m):
    t = input()
    if t in s:
        s[t] -= 1
    else:
        s.update({t:-1})

print("0" if max(d.values()) < 0 else max(d.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = {}
for i in range(n):
    d = input()
    if d in s:
        s[d] += 1
    else:
        s.update({d:1}) 

m = int(input())
for j in range(m):
    t = input()
    if t in s:
        s[t] -= 1
    else:
        s.update({t:-1})

print(0 if max(d.values()) < 0 else max(d.values()))
Problem p03456 (python)

Fixed submission:
a = list(map(int,input().split()))
s = int(str(a[0]) + str(a[1]))
for i in range(s):
    if s == i**2:
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
a = input()
for i in range(int(a[0]+a[2:])):
    if int(a[0]+a[2:]) == i**2:
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
a = input()
s = 0
for i in range(int(a[0]+a[2]+a[3])+1):
    if int(a[0]+a[2]+a[3]) == i**2:
        s += 1
        break
if s == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = input()
print(int(a[0]+a[2]+a[3]))
s = 0
for i in range(int(a[0]+a[2]+a[3])+1):
    if int(a[0]+a[2]+a[3]) == i**2:
        s += 1
        break
if s == 1:
    print("Yes")
else:
    print("No")
Problem p03059 (python)

Fixed submission:
[A, B, T] = map(int, raw_input().split())
biscuits = 0
time = 0
while time < (T + 0.5 - A):
  biscuits = biscuits + B
  time = time + A
print biscuits

Buggy submission (verdict: Runtime Error):
data = input()
[A, B, T] = data.split(" ")
biscuits = 0
time = 0
while time < int(T) + 0.5:
  biscuits = biscuits + int(B)
  time = time + int(A)
print biscuits
Problem p03061 (python)

Fixed submission:
def gcd(x, y):
  while(y): 
       x, y = y, x % y   
  return x 

def solve():
  n = int(raw_input())
  a = map(int, raw_input().split())
  left = [0] * (n + 1)
  right = [0] * (n + 1)
  for i in range(1,n + 1):
    left[i] = gcd(left[i - 1], a[i - 1])
  for i in range(n - 1, 0, -1):
    right[i] = gcd(right[i + 1], a[i])
  max_gcd = 0
  for i in range(n):
    max_gcd = max(max_gcd, gcd(left[i], right[i + 1]))
  print max_gcd
        
if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
  while(y): 
       x, y = y, x % y   
  return x 

def solve():
  n = 3
  a = [7, 6, 8]
  left = [0] * n + 1
  right = [0] * n + 1
  for i in range(1,n + 1):
    left[i] = gcd(left[i - 1], a[i - 1])
  for i in range(n - 1, 0, -1):
    right[i] = gce(right[i + 1], a[i])
  max_gcd = 0
  for i range(n):
    max_gcd = max(max_gcd, gcd(left[i], right[i]))
  print max_gcd
        
if __name__ == '__main__':
    solve()
Problem p03062 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

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

memo = dict()
def dp(pos, flag):
  if pos == n - 1:
    if flag == 0:
      return a[pos]
    else:
      return -a[pos]
  if (pos, flag) in memo:
    return memo[(pos, flag)]
  elif flag == 0:
    memo[(pos, flag)] = max(dp(pos + 1, 0) + a[pos], dp(pos + 1, 1) - a[pos])
    return memo[(pos, flag)]
  else:
    memo[(pos, flag)] = max(dp(pos + 1, 0) - a[pos], dp(pos + 1, 1) + a[pos])
    return memo[(pos, flag)]
print dp(0, 0)

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

memo = dict()
def dp(pos, flag):
  if pos == n - 1:
    if flag == 0:
      return a[pos]
    else:
      return -a[pos]
  if (pos, flag) in memo:
    return memo[(pos, flag)]
  elif flag == 0:
    memo[(pos, flag)] = max(dp(pos + 1, 0) + a[pos], dp(pos + 1, 1) - a[pos])
    return memo[(pos, flag)]
  else:
    memo[(pos, flag)] = max(dp(pos + 1, 0) - a[pos], dp(pos + 1, 1) + a[pos])
    return memo[(pos, flag)]
print dp(0, 0)

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

memo = dict()
def dp(pos, flag):
  if pos == n - 1:
    if flag == 0:
      return a[pos]
    else:
      return -a[pos]
  if (pos, flag) in memo:
    return memo[(pos, flag)]
  elif flag == 0:
    memo[(pos, flag)] = max(dp(pos + 1, 0) + a[pos], dp(pos + 1, 1) - a[pos])
  else:
    memo[(pos, flag)] = max(dp(pos + 1, 0) - a[pos], dp(pos + 1, 1) + a[pos])
  return memo[(pos, flag)]

print dp(0, 0)

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
a = map(int, raw_input().split())
dp = [[0, float('inf')]] * N

for i in range(n):
  dp[i + 1, 0] = max(dp[i, 0] + a[i], dp[i, 1] - a[i])
  dp[i + 1, 1] = max(dp[i, 0] - a[i], dp[i, 1] + a[i])
print dp[n - 1, 0]
Problem p03071 (python)

Fixed submission:
nums = map(int, raw_input().split())
a = max(nums)
b = min(nums)
ans = a + max(a - 1, b)
print ans

Buggy submission (verdict: Runtime Error):
nums = map(int, raw_input())
a = max(nums)
b = min(nums)
ans = a + max(a - 1, b)
print ans

Buggy submission (verdict: Runtime Error):
nums = map(int, raw_input().split(""))
print sum(nums)