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

Fixed submission:
s=input()
a=""
for i in range(len(s)):
    if i%2==0:
        a=a+s[i]
print(a)

Buggy submission (verdict: Runtime Error):
s=input()
a=""
for i in range(len(s):
    if i%2==0:
        a=a+s[i]
print(a)
Problem p03624 (python)

Fixed submission:
S=sorted(list(set(list(input()))))
alph=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum=0
A="None"
for i in range(len(S)):
    if S[i]!=alph[i]:
        A=alph[i]
        break
if A=="None" and len(S)<26:
    A=alph[i+1]

print(A)

Buggy submission (verdict: Runtime Error):
s=sorted(list(set(list(input()))))
if len(s)==26:
    print("None")
alph=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
for i in range(26):
    if s[i]!=alph[i]:
        print(alph[i])
Problem p03658 (python)

Fixed submission:
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())))[::-1]
sum=0
for i in range(k):
    sum+=l[i]
print(sum)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=reversed(sorted(list(map(int,input().split()))))
sum=0
for i in range(k):
    sum+=l[i]
print(sum)
Problem p03719 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input()split())
if a<=c<=b:
    print("Yes")
else:
    print("No")
Problem p03760 (python)

Fixed submission:
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+o[i]+e[i]
    a=a+o[n]
    print(a)

Buggy submission (verdict: Runtime Error):
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+o[i]+e[i]
    a=a+e[n]
    print(a)

Buggy submission (verdict: Runtime Error):
o=input()
e=input()
n=len(e)
a=""
if len(o)-len(e)==0:
    for i in range(n):
        a=a+o[i]+e[i]
    print(a)
else:
    for i in range(n):
        a=a+0[i]+e[i]
    a=a+e[n]
    print(a)
Problem p03778 (python)

Fixed submission:
w,a,b=map(int,input().split())
if a+w>=b and b+w>=a:
    print(0)
elif a+w>b:
    print(a-b-w)
else:
    print(b-a-w)

Buggy submission (verdict: Runtime Error):
w,a,b=map(int,input().split())
if a+w>=b and b+w>=a:
    print(0)
elif: a+w>b:
    print(a-b-w)
else:
    print(b-a-w)
Problem p03826 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max(ab,cd))
Problem p03827 (python)

Fixed submission:
n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
    if s[i]=="I":
        x+=1
        a.append(x)
    else:
        x-=1
        a.append(x)
a=sorted(list(set(a)))
print(a[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
    if s[i]=="I":
        x+=1
        a.append(x)
    else:
        x-=1
        a.append(x)
a=list(set(a))
b=a.reverse()
print(b[0])
Problem p03844 (python)

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

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

Fixed submission:
from math import ceil
from decimal import *
n=int(input())
prea=Decimal("1.0")
pret=Decimal("1.0")
for i in range(n):
    
    t,a=map(Decimal,input().split())
    i=max(ceil(prea/a),ceil(pret/t))
    pret,prea=t*i,a*i

print(pret+prea)

Buggy submission (verdict: Runtime Error):
from math import ceil
from decimal import *
n=int(input())
prea=1.0
pret=1.0
for i in range(n):
    
    t,a=map(Decimal,input().split())
    i=max(ceil(prea/a),ceil(pret/t))
    pret,prea=t*i,a*i

print(pret+prea)
Problem p04001 (python)

Fixed submission:
s=list(input())
n=len(s)
ans=0
for i in range(1<<(n-1)):

    """
    ここで既に、n-1個の文字間のうち、どこに+を入れるかが決まる。入れるところにはbit
    が立ち(その桁が1となる)、入れないところにはbitが立たない(その桁が0となる)
    """

    S=s[0]
    for j in range(n-1):
        if i & (1<<j): #bitが立っている時
            S+="+"+s[j+1]
        else: #bitが立っていない時
            S+=s[j+1]
    ans+=eval(S)
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(map(int,list(input())))
n=len(s)
ans=0
for i in range(1<<(n-1)):
"""ここで既に、n-1個の文字間のうち、どこに+を入れるかが決まる。入れるところにはbitが立ち(その桁が1となる)、入れないところにはbitが立たない(その桁が0となる)"""
    S=s[0]
    for j in range(n-1):
        if i & (1<<j): #bitが立っている時
            S+="+"+s[j+1]
        else: #bitが立っていない時
            S+=s[j+1]
    ans+=eval(S)
print(ans)
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split())
list1=[a,b,c]
list2=sorted(list1)
if list2[0]==list2[1]==5 and list2[2]==7:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
list1=[a,b,c]
list2=sorted(list1)
if list2[0]==list2[1]==5 and list2[2]==7:
    print("YES")
else:
    print(NO")
Problem p02848 (python)

Fixed submission:
N = int(input())
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(t)

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
t = []
for i in S:
    t.append(chr(ord(i) + N))
print(t.join)
Problem p02861 (python)

Fixed submission:
N = int(input())
x = []
y = []
for i in range(N):
    a,b = map(int, (input().split()))
    x.append(a)
    y.append(b)

aaa = 0
for i in range(N):
    for k in range(N):
        aaa += ((x[i] - x[k])**2+(y[i] - y[k])**2)**0.5
print(aaa/N)

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

aaa = 0
for i in range(N):
    for k in range(N):
        aaa += ((x[i] - x[k])**2+(y[i] - y[k])**2)**0.5
print(aaa/N)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
for i in range(N):
    x[i], y[i] = map(int, (input().split(" ")))
roop = []
import itertools
for i in itertools.permutations(range(N), r=2):
    roop.append(i)
aaa = 0
for i in roop:
    aaa += ((x[i[0]] - x[i[1]])**2+(y[i[0]] - y[i[1]])**2)**0.5
print(aaa/N)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
for i in range(N):
    x[i], y[i] = map(int, (input().split( )))
roop = []
import itertools
for i in itertools.permutations(range(N), r=2):
    roop.append(i)
aaa = 0
for i in roop:
    aaa += ((x[i[0]] - x[i[1]])**2+(y[i[0]] - y[i[1]])**2)**0.5
print(aaa/N)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = []
y = []
for i in range(N):
    x[i], y[i] = map(int, (input().split()))
roop = []
import itertools
for i in itertools.permutations(range(N), r=2):
    roop.append(i)
aaa = 0
for i in roop:
    aaa += ((x[i[0]] - x[i[1]])**2+(y[i[0]] - y[i[1]])**2)**0.5
print(aaa/N)

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

roop = []
import itertools

for i in itertools.permutations(range(N)):
    roop.append(i)
aaa = 0
for i in roop:
    for l in i:
        aaa += ((x[l] - x[l+1])**2+(y[l] - y[l+1])**2)**0.5
print(aaa/N)
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
L = list(map(int, input().split()))
c = 1
D = 0
for i in L:	
    D = D + i
    if D > x:
        print(c)
        exit()
    c = c + 1
print(c)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
L = list(map(int, input().split()))
c = 0
D = 0
for i in L:
  	c = c + 1
    D = D + i
    if D > x:
        print(c)
        exit()
if D > x:
  print(c)
else:
  print(c+1)
Problem p03623 (python)

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

if a < x:
    a_abs = x-a
else:
    a_abs = a-x

if b < x:
    b_abs = x-b
else:
    b_abs = b-x
if a_abs > b_abs:
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, (inp.readline().rstrip().split()))
if a < x:
    a_abs = x-a
else:
    a_abs = a-x

if b < x:
    b_abs = x-b
else:
    b_abs = b-x
if a_abs > b_abs:
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
if a < x:
    a_abs = x-a
else:
    a_abs = a-x

if b < x:
    b_abs = x-b
else:
    b_abs = b-x
if a_abs > b_abs:
    print("B")
else:
    print("A")
Problem p03624 (python)

Fixed submission:
S = input()
S_list = list(set(S))
string = "qazwsxedcrfvtgbyhnujmikolp"
str_list = list(string)
str_list.sort()
for a in S_list:
    str_list.remove(a)
if str_list == []:
    print("None")
else:
    print(str_list.pop(0))

Buggy submission (verdict: Runtime Error):
S = input()
S_list = list(set(S))
string = "qazwsxedcrfvtgbyhnujmikolp"
str_list = list(string)
str_list.sort()
for a in S_list:
    str_list.remove(a)
print(str_list.pop(0))
Problem p03625 (python)

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

a = sorted(a, reverse=True)

count = 0
edge = []

i = 0
for _ in range(n-1):
    if a[i] == a[i+1]:
        count = count + 1
        edge.append(a[i])
        i = i + 1
        if count == 2:
            break
    i = i + 1

s = edge[0]*edge[1] if count == 2 else 0
print(s)

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


a = sorted(a, reverse=True)
count = 0
edge = []
i = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        count = count + 1
        edge.append(a[i])
        i = i + 1
        if count == 2:
            break

s = edge[0]*edge[1] if count == 2 else 0
print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split(' ')))
rect_long = 0
rect_small = 0
while A != []:
    long_max = max(A)
    if A.count(long_max) >= 2:
        rect_long += long_max
        A.remove(long_max)
        A.remove(long_max)
        break
	A.remove(long_max)

while A != []:
    small_max = max(A)
    if A.count(small_max) >= 2:
        rect_small += small_max
        break
    A.remove(small_max)

print(rect_long * rect_small)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split(' ')))
rect_long = 0
rect_small = 0
while rect_long == 0:
    a_max = max(A)
    if A.count(a_max) >= 2:
        rect_long += a_max
    elif A.count(a_max) >= 4:
        rect_small += a_max
    A.remove(a_max)

while rect_small == 0:
    b_max = max(A)
    if A.count(b_max) >= 2:
        rect_small += b_max
    A.remove(b_max)

print(rect_long * rect_small)
Problem p03632 (python)

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


if a <= c and b <= d and c <= b:
    print(b-c)
elif c <= a and b <= d:
    print(b-a)
elif a <= c and d <= b:
    print(d-c)
elif c <= a and d <= b and a <= d:
    print(d-a)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, (input().split))
if a < c and b < d:
    print(b-c)
elif c < a and b < d:
    print(b-a)
elif a < c and d < b:
    print(d-c)
elif c < a and d < b:
    print(d-a)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split)
if a < c and b < d:
    print(b-c)
elif c < a and b < d:
    print(b-a)
elif a < c and d < b:
    print(d-c)
elif c < a and d < b:
    print(d-a)
else:
    print(0)
Problem p02843 (python)

Fixed submission:
X = int(input())

for i in range(X+1):
  if X >= 100*i and X <= 105*i:
    print(1)
    exit(0)
print(0)

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

n = math.floor(X/100)
remain = X % 100
print(n>= 1 && remain <= n*5)
Problem p02865 (python)

Fixed submission:
N = int(input())
half = 0
if N % 2 == 0:
  half = N//2-1
else:
  half = N//2
print(half)

Buggy submission (verdict: Runtime Error):
N = int(input())
D = list(map(int, input().strip().split()))
D.sort()
# print(D)
 
def calc(arr):
  if arr[0] != 0:
    return 0
  result = 1
  curCount = 1
  preCount = 1
  for i in range(1, len(arr)):
    if arr[i] == 0:
      return 0
    if arr[i] == arr[i-1]:
      curCount += 1
    elif arr[i] == arr[i-1] + 1:
      preCount = curCount
      curCount = 1
    else:
      return 0
    result = result * preCount
    if result > 998244353:
      result = result % 998244353
    #print(pre, curCount, preCount, result)
  return result%998244353
 
print(calc(D))
Problem p03261 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
n = int(input());
words = []

for i in range(n):
    words.append(input())

if (len(words) > len(set(words))):
    print('No')
    sys.exit(0)

before_word = words.pop(0)
while( len(words) > 0 ):
    after_word = words.pop(0)
    if (before_word[-1] != after_word[0]):
        print('No')
        sys.exit(0)
    before_word = after_word
print('Yes')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
n = int(input());
words = []

for i in range(n):
    words.append(input())

# 単語が重複していたらアウト
                            if (len(words) > len(set(words))):
    print('No')
    sys.exit(0)

before_word = words.pop(0)
while( len(words) > 0 ):
    after_word = words.pop(0)
    # しりとりになっていなかったらアウト
    if (before_word[-1] != after_word[0]):
        print('No')
        sys.exit(0)
    before_word = after_word
print('Yes')
Problem p03273 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
H, W = map(int, input().split(' '));

board = []
flags = [ True for x in range(W)]
for i in range(H):
    line = list(input())
    if ( '#' in line ):
        board.append(line)
        flags = [ f and s == '.' for s,f in zip(line, flags) ]

j = 0
for b in board:
    for l,flag in zip(b,flags):
        if not flag:
            sys.stdout.write(l)
    print()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
H, W = map(int, input().split(' '));

board = []
flags = [ True for x in range(W)]
for i in range(H):
    line = list(input())
    if ( '#' in line ):
        board.append(line)
        flags = [ f and s == '.' for s,f in zip(line, flags) ]

j = 0
for i, flag in enumerate(flags):
    if flag:
        for b in board:
            b.pop(i-j)
            j += 1
for b in board:
    print(''.join(b))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
H, W = map(int, input().split(' '));

board = []
flags = [ True for x in range(W)]
for i in range(H):
    line = list(input())
    if ( '#' in line ):
        board.append(line)
        flags = [ f and s == '.' for s,f in zip(line, flags) ]

for i, flag in enumerate(flags):
    if flag:
        for b in board:
            b.pop(i)
for b in board:
    print(''.join(b))
Problem p03289 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys

S = input()
if S[0] != 'A':
    print('WA')
    sys.exit(0)
for l in S:
    if l in list('BDEFGHIJKLMNOPQRSTUVWXYZ'):
        print('WA')
        sys.exit(0)

re = len(list(filter( lambda x: x == 'C', S[2:-1])))
if re == 1:
    print('AC')
else:
    print('WA')

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

S = input()
re = len(list(filter( lambda x: x == 'C', a[2:-1])))
if re == 1:
    print('AC')
else:
    print('WA')
Problem p03293 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = lines.pop(0)
    T = lines.pop(0)
    for i in range(len(S)):
        S = S[-1] + S[:-1]
        if S == T:
            print('Yes')
            sys.exit(0)

    print('No')

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#abcdefg
#abcdegg\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    l = list(map(int, lines.pop(0).split(' ')))
    l.sort()
    print(l[2] - l[0])

#
# main
#

# 1. use list instead of stdin
# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03294 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
from functools import reduce
from fractions import gcd
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    lcd = reduce(lambda i,j: i*j//gcd(i,j), A, 1)
    m = lcd - 1
    A = [ m % i for i in A ]
    print(sum(A))

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
from functools import reduce
from math import gcd
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    lcd = 10
    m = lcd - 1
    A = [ m % i for i in A ]
    print(sum(A))

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
from functools import reduce
from math import gcd
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    lcd = reduce(lambda i,j: i*j//gcd(i,j), A, 1)
    m = lcd - 1
    A = [ m % i for i in A ]
    print(sum(A))

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
from functools import reduce
from math import gcd
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    # 最小公倍数
    lcd = reduce(lambda i,j: i*j//gcd(i,j), A, 1)
    m = lcd - 1
    A = [ m % i for i in A ]
    print(sum(A))

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
from functools import reduce
from math import gcd
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    # 最小公倍数
    lcd = reduce(lambda i,j: i*j//gcd(i,j), A, 1)
    m = lcd - 1
    A = [ m % i for i in A ]
    print(sum(A))

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03308 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    L = list(map(int, lines.pop(0).split(' ')))
    L.sort()
    print(L[-1] - L[0])

#
# main
#

# 1. use list instead of stdin

# contents = '''\
# 4
# 1 4 6 3\
# '''
# lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    L = list(map(int, lines.pop(0).split(' ')))
    L.sort()
    print(L[-1] - L[0])

#
# main
#

# 1. use list instead of stdin

# contents = '''\
# 4
# 1 4 6 3\
# '''
# lines = contents.split('\n')

# 2. use stdin

# lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03337 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
a# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03339 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    S = lines.pop(0)
    RS = S[::-1]
    S = 'x' + S
    RS = 'x' + RS
    slist = []
    rslist = []
    ss = 0
    rss = 0
    for i in range(N):
        if S[i] == 'W':
            ss += 1
        if RS[i] == 'E':
            rss += 1
        slist.append(ss)
        #rslist.insert(0,rss)
        rslist.append(rss)
    #print(S)
    #print(RS)
    #print(list( zip(slist, rslist)))
    rslist.reverse()
    print(min([s + r for s, r in zip(slist, rslist)]))

#
# main
#
# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
[carbon:~/src/github.com/hilolih/atcoder:148](! master )% cat ABC098/c.py
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    S = lines.pop(0)
    RS = S[::-1]
    S = 'x' + S
    RS = 'x' + RS
    slist = []
    rslist = []
    ss = 0
    rss = 0
    for i in range(N):
        if S[i] == 'W':
            ss += 1
        if RS[i] == 'E':
            rss += 1
        slist.append(ss)
        rslist.insert(0,rss)
    #print(S)
    #print(RS)
    #print(list( zip(slist, rslist)))
    print(min([s + r for s, r in zip(slist, rslist)]))

#
# main
#
# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03352 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
from math import sqrt,floor
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    X = int(lines.pop(0))
    s = floor(sqrt(X))
    res = 1
    for c in range(s, 1, -1):
        n = 2
        while( c**n <= X ):
            res = max(res, c**n)
            n += 1

    print(res)
#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
from math import sqrt,floor
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    X = int(lines.pop(0))
    s = floor(sqrt(X))
    res = 1
    for c in range(s, 1, -1):
        print(c)
        while( c**n <= X ):
            res = max(res, c**n)
            n += 1

    print(res)
#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)