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

Fixed submission:
A, B = map(int, input().split())
print((A-1) * (B-1))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print((A-1) * (B-1))

Buggy submission (verdict: Runtime Error):
A, B = int(input()), int(input())
print((A-1) * (B-1))

Buggy submission (verdict: Runtime Error):
A, B = int(input()), int(input())
print((A-1) * (B-1))
Problem p02801 (python)

Fixed submission:
C = input()
alphabet = "abcdefghijklmnopqrltuvwxyz"

for i in range(len(alphabet)):
    if alphabet[i] == C:
        print(alphabet[i+1])
        exit()

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ac = [0] * N
wa = [0] * N

ac = 0
wa = 0

for i in range(M):
    p, S = input().split()
    p = int(p)

    if S == "AC":
        if ac[p-1] == 0:
            ac += 1
            
    else:
        if ac[N-1] == 0:
            wa += 1

print(ac, wa)
Problem p02843 (python)

Fixed submission:
from itertools import combinations_with_replacement

X = list(input())
tmp = X
num = int("".join(tmp))

if num < 100:
    print(0)
    exit()

X.pop()
X.pop()
X = int("".join(X))

food = [100, 101, 102, 103, 104, 105]

for i in combinations_with_replacement(food, X):
    if sum(i) == num:
        print(1)
        exit()

print(0)

Buggy submission (verdict: Runtime Error):
from itertools import combinations_with_replacement

X = list(input())
tmp = X
num = int("".join(tmp))

X.pop()
X.pop()
X = int("".join(X))

food = [100, 101, 102, 103, 104, 105, 106]

for i in combinations_with_replacement(food, X):
    if sum(i) == num:
        print(1)
        exit()

print(0)
Problem p02885 (python)

Fixed submission:
A, B = map(int, input().split())
B *= 2

if B >= A:
    print(0)

else:
    print(A-B)

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
L = list(map(int, input().split()))
num = []
ans = 0

for i in itertools.permutations(L, r=3):
    i = list(i)
    i.sort()
    if i not in num:
        num.append(i)

for i in range(len(num)):
    if num[i][0] + num[i][1] > num[i][2]　and num[i][1] + num[i][2] > num[i][0] and num[i][0] + num[i][2] > num[i][1]:
        ans += 1
print(ans)
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

ans = 0

for i in range(len(S)):
    if S[i] == T[i]:
        ans += 1
print(ans)

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


while True:
    if A > B:
        break
    else:
        A += A
        ans += 1
print(ans)
Problem p02946 (python)

Fixed submission:
K, X = map(int, input().split())
cule = [i for i in range(X-K+1, X+K)]

print(" ".join(repr(i) for i in cule))

Buggy submission (verdict: Runtime Error):
K, X = map(int, input().split())

ans = [X]

for i in range(K-1):
    ans.append(X+i+1)

ans.reverse()
for i in range(K-1):
    ans.append(X-(i+1))

ans.reverse()
print("".join(ans))
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
s = H*W/2

if x*2 == W and y*2 == H:
    print(s, 1)
else:
    print(s, 0)
Problem p03071 (python)

Fixed submission:
A, B =map(int, input().split())
ans = 0

for i in range(2):
    if A >= B :
        ans += A
        A -= 1
    else:
        ans += B
        B -= 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
count = 0

for i in range(N):
    if H[0] <= H[i]:
        count += 1
        if H[i] <= H[i-1]:
            count -= 1
print(count if H[0] >= H[i] else count + 1)
Problem p03105 (python)

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

if a * c <=  b:
    print(c)
else:
    print(b // a)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
num_list = [i for i in range(a, b) if a % i == 0 and b % i == 0][::-1]
print(number_list[k-1])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
num_list = [i for i in range(1, 101) if a % i == 0 and b % i == 0]
num_list.reverse()
print(number_list[k-1])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
number_list = [i for i in range(1, 101) if a % i == 0 and b % i == 0][::-1]
print(number_list[k-1])
Problem p03106 (python)

Fixed submission:
A, B, K = map(int, input().split())
small = min(A, B)
both = [i for i in range(1, small+1)]
gcd = []

for i in both:
    if A % i == 0 and B % i == 0:
        gcd.append(i)

K -= 1
gcd.sort(reverse=True)
print(gcd[K])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
num_list = [i for i in range(a, b) if a % i == 0 and b % i == 0]
num_list.reverse()
print(number_list[k-1])
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
    print("Christmas")
else:
    E = 25 - D
    print("Christmas" + " " +  "Eve " * E)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
p.sort(reverse=True)
a = p[1:]
b = p[0] // 2
print(sum(a, b))
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())

if N % K == 0:
    print(0)

else:
    print(1)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
root = [4, 7]

if bisect.bisect_right(root, N):
    print("Yes")
else:
    print("No")
Problem p03289 (python)

Fixed submission:
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

upper = False
count = 0
for i in S:
    if i.isupper():
        count += 1

if count == 2:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")

Buggy submission (verdict: Runtime Error):
S = list(input())

ac = False
if S[0] == "A":
    if S[2:len(S)-1].count("C") == 1:
        ac = True

 upper = False
 count = 0
for i in S[2:len(S)-1]:
    if i.isupper():
        count += 1

if count == 1:
    upper = True

if ac and upper:
    print("AC")
else:
    print("WA")
Problem p03331 (python)

Fixed submission:
N = int(input())

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(b))

print(ans)

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

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(b)

print(ans)

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

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(BytesWarning))

print(ans)
Problem p03369 (python)

Fixed submission:
S = input()

ans = 700
for i in S:
    if i == "o":
        ans += 100

print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C, X, Y = map(int, input().split())
ans = 0

while X > 0 or Y > 0:
    if C*2 < A + B:
        if X >= 1 and Y >= 1:
            ans += C*2
            X -= 1
            Y -= 1
        elif X >= 1 and Y == 0:
            ans += A
            X -= 1
        elif Y >= 1 and X == 0:
            ans += B
            Y -= 1
    else:
        if X >= 1 and Y >= 1:
            ans += A
            X -= 1
            ans += B
            Y -= 1
        elif Y == 0:
            X -= 1
            ans += A
        elif X == 0:
            Y -= 1
            ans += B

print(ans)
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
a = A
b = B

ans = []
for i in range(K):
    if A not in ans:
        ans.append(A)

    if B not in ans:
        ans.append(B)

    if A + 1 <= b:
        A += 1
    if B - 1 >= a:
        B -= 1

ans.sort()
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
num = [i for i in range(A, B+1)]
numset = []

if B < K:
    K = len(num)

for i in range(K):
    print(num[i])
    numset.append(num[i])

num.sort(reverse=True)
num = num[:K]
num.sort()

for i in range(K):
    if num[i] not in numset:
        print(num[i])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
num = [i for i in range(A, B+1)]
num_set = []

if B < K:
    K = len(num)

for i in range(K):
    num_set.append(num[i])

num.sort(reverse=True)
for i in range(K):
    if num[i] not in num_set:
        num_set.append(num[i])

num_set.sort()
for i in range(len(num_set)):
    print(num_set[i])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
num = [i for i in range(A, B+1)]
num_set = []

if B < K:
    K = len(num)

for i in range(K):
    num_set.append(num[i])

num.sort(reverse=True)
for i in range(K):
    if num[i] not in num_set:
        num_set.append(num[i])

num_set.sort()
for i in range(len(num_set)):
    print(num_set[i])
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())

print("Yes" if N % 500 <= A else "No")

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

ans = N % A

if A == 0:
    print("No")
    exit()
print("Yes" if ans <= A else "No")

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

print("Yes" if N % A and N % 500 else "No")
Problem p03543 (python)

Fixed submission:
N = input()

cnt = 1

for i in range(len(N)-1):

    if N[i] == N[i+1]:
        cnt += 1

    else:
        cnt = 1

    if cnt == 3:
        print("Yes")
        exit()


print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
luca = [2, 1]

for i in range(101):
    luca.append(luca[i]+luca[i+1])

print(luca[N])
Problem p03547 (python)

Fixed submission:
X, Y = input().split()

num = {"A": 10, "B": 11, "C": 12, "D": 13, "E": 14, "F": 15}

if num[X] > num[Y]:
    print(">")

elif num[X] < num[Y]:
    print("<")

else:
    print("=")

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())
ans = 0

while X > Y + Z:
    X -= Y + Z
    ans += 1
if X < Z:
    ans -= 1
print(ans)
Problem p03609 (python)

Fixed submission:
X, t = map(int, input().split())

if t >= X:
    print(0)

else:
    print(X-t)

Buggy submission (verdict: Runtime Error):
X, t = map(int, input().split())

if t >= x:
    print(0)

else:
    print(X-t)
Problem p03657 (python)

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

if A % 3 == 0 or B % 3 == 0 or (A+B) % 3 == 0:
    print("Possible")

else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = 0

for i in range(N):
    if K != 0:
        ans += l[i]
        K -= 1
    elif K == 0:
        break
print(ans)
Problem p03693 (python)

Fixed submission:
r, g, b = map(int, input().split())
ans = r * 100 + g * 10 + b

print("YES" if ans % 4 == 0 else "NO")

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

min_color = 0
max_color = 0

cnt = 0

color = [0] * 8

for i in a:
    if i < 400 and color[0] == 0:
        min_color += 1
        max_color += 1
        color[0] = 1

    elif 400 <= i and i < 800 and color[1] == 0:
        min_color += 1
        max_color += 1
        color[1] = 1

    elif 800 <= i and i < 1200 and color[2] == 0:
        min_color += 1
        max_color += 1
        color[2] = 1

    elif 1200 <= i and i < 1600 and color[3] == 0:
        min_color += 1
        max_color += 1
        color[3] = 1

    elif 1600 <= i and i < 2000 and color[4] == 0:
        min_color += 1
        max_color += 1
        color[4] = 1

    elif 2000 <= i and i < 2400 and color[5] == 0:
        min_color += 1
        max_color += 1
        color[5] = 1

    elif 2400 <= i and i < 2800 and color[6] == 0:
        min_color += 1
        max_color += 1
        color[6] = 1

    elif 2800 <= i and i < 3200 and color[7] == 0:
        min_color += 1
        max_color += 1
        color[7] = 1

    elif i >= 3200:
        max_color += 1
        cnt += 1

if cnt == N:
    min_color = 1

print(min_color, max_color)
Problem p03826 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

if A * B > C * D:
    print(A*B)

else:
    print(C*D)

Buggy submission (verdict: Runtime Error):
if A * B > C * D:
    print(A*B)

else:
    print(C*D)
Problem p03853 (python)

Fixed submission:
H, W = map(int, input().split())

for i in range(H):
    C = input()
    print(C)
    print(C)

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

for i in range(W):
    C = input()
    print(C)
    print(C)
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n > k:
    print(x * k + (n - k) * y)
else:
    print(n * x)

Buggy submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())


print(abs(X * K + (N - K) * Y))

Buggy submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())

print(X * K + (N - K) * Y)
Problem p04043 (python)

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

if A.count(5) == 2 and A.count(7) == 1:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
ABC = list(map(int(input().split())))

if ABC.count(5) == 2 and ABC.count == 7:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
ABC = list(map(int(input().split())))

if ABC.count(5) == 2 and ABC.count == 7:
    print("YES")
else:
    print("NO")
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)

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

if N == 1:
    print("Hello World")
elif N == 2:
    print(A+B)

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

if N == 1:
    print("Hello World")
elif N == 2:
    print(A+B)
Problem p03853 (python)

Fixed submission:
a = input().split()
h = int(a[0])
w = int(a[1])

b = []
c =[]

for i in range(h):
    s = input()
    b.append(s)

for i in range(h):
    c.append(b[i])
    c.append(b[i])

for i in range(len(c)):
    print(c[i])

Buggy submission (verdict: Runtime Error):
a = input().split()
w = int(a[0])
h = int(a[1])

b = []
c =[]

for i in range(h):
    s = input()
    b.append(s)

for i in range(h):
    c.append(b[i])
    c.append(b[i])

for i in range(len(c)):
    print(c[i])
Problem p04044 (python)

Fixed submission:
a = input().split()
n= a[0]
l = a[1]
s = []
for i in range(int(n)):
    s.append(input())

s.sort()
ret = ""
for i in range(int(n)):
    ret = ret + s[i]

print(ret)

Buggy submission (verdict: Runtime Error):
a = input().split()
l = a[0]
n = a[1]
s = []
for i in range(int(n)):
    s.append(input())

s.sort()
ret = ""
for i in range(int(n)):
    ret = ret + s[i]

print(ret)
Problem p02534 (python)

Fixed submission:
a = input()
K = int(a)

x = 'ACL'

for i in range(K):
    print(x, end = "")

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

x = 'ACL'

for i in K:
    print(x, end = "")

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

for i in K:
    print('ACL', end = "")
Problem p02841 (python)

Fixed submission:
MD = [map(int, input().split()) for _ in range(2)]
M, D = [list(i) for i in zip(*MD)]

if D[1] == 1:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
MD = [map(int, input().split()) for _ in range(N)]
M, D = [list(i) for i in zip(*MD)]

if D[1] == 1:
    print(1)
else:
    print(0)
Problem p02573 (python)

Fixed submission:
#n = int(input())
import random
import sys
sys.setrecursionlimit(10 ** 7)
n, m = map(int, input().split())
#n=200000
#m=200000
#al = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
adjl = [[] for _ in range(n+1)]
NIL = -1
appear = {}
isalone = {}
for i in range(m):
    a, b = map(int, input().split())
    #a=random.randrange(1,n+1)
    #b=random.randrange(1,n+1)
    #while a==b:
    #    b=random.randrange(1,n+1)
    #print(a,b)
    if appear.get((a, b), False) or appear.get((a, b), False):
        continue
    appear[(a, b)] = True
    appear[(b, a)] = True
    isalone[a] = False
    isalone[b] = False
    adjl[a].append(b)
    adjl[b].append(a)

color = [NIL for i in range(n+1)]
color_id = 0


def dfs(u, color_id):
    global color
    color[u] = color_id
    for v in adjl[u]:
        if color[v] == NIL:  # 未到達なら再起呼び出し
            color[v] = color_id
            dfs(v, color_id)


for u in range(1, n+1):
    if color[u] == NIL:
        color_id += 1
        dfs(u, color_id)

group = {}
for i in range(1, n+1):
    if isalone.get(i, True):
        continue
    group[color[i]] = group.get(color[i], 0)+1

mx = 1
for k, v in group.items():
    mx = max(mx, v)

print(mx)

Buggy submission (verdict: Runtime Error):
#n = int(input())
import random
n, m = map(int, input().split())
#al = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
adjl = [[] for _ in range(n+1)]
NIL = -1
appear = {}
isalone = {}
for i in range(m):
    a, b = map(int, input().split())
    if appear.get((a, b), False) or appear.get((a, b), False):
        continue
    appear[(a, b)] = True
    appear[(b, a)] = True
    isalone[a] = False
    isalone[b] = False
    adjl[a].append(b)
    adjl[b].append(a)

color = [NIL for i in range(n+1)]
color_id = 0


def dfs(u, color_id):
    global color
    color[u] = color_id
    for v in adjl[u]:
        if color[v] == NIL:  # 未到達なら再起呼び出し
            color[v] = color_id
            dfs(v, color_id)


for u in range(1, n+1):
    if color[u] == NIL:
        color_id += 1
        dfs(u, color_id)

group = {}
for i in range(1, n+1):
    if isalone.get(i, True):
        continue
    group[color[i]] = group.get(color[i], 0)+1

mx = 1
for k, v in group.items():
    mx = max(mx, v)
print(mx)

Buggy submission (verdict: Runtime Error):
#n = int(input())
n, m = map(int, input().split())
#al = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

fgroup = {i: 0 for i in range(1, n+1)}
g_id = 0
for i in range(m):
    a, b = map(int, input().split())
    if fgroup[a] != 0:
        fgroup[b] = fgroup[a]
    elif fgroup[b] != 0:
        fgroup[a] = fgroup[b]
    else:
        g_id += 1
        fgroup[a] = g_id
        fgroup[b] = g_id

gid_num = {}
for person, gid in fgroup.items():
    gid_num[gid] = gid_num.get(gid, 0)+1
mx = 1
for i in range(1, g_id+1):
    mx = max(mx, gid_num[i])
print(mx)
Problem p02742 (python)

Fixed submission:
#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
v1=h//2
v2=w//2
if h==1 or w==1:
    ans=1
elif h%2==0:
    ans=v1*w
else:
    if w%2==0:
        ans=(v1+1)*v2+(v1)*v2
    else:
        t=v1+1
        ans=v2*(v1)+(v2+1)*(v1+1)
print(ans)

Buggy submission (verdict: Runtime Error):
#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
v1=h//2
v2=w//2
if h==1 or w==1:
    print(0)
elif h%2==0:
    
    ans=v1*w
else:
    if w%2==0:
        ans=v1*v2+(v1-1)*v2
    else:
        t=v1+1
        ans=v2*(t-1)+(v2+1)*t
print(ans)
Problem p02882 (python)

Fixed submission:
#n=int(input())
a,b,x=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

import math

s=x/a
if x==a*a*b:
    print(0)
elif s<= a*b/2:
    c=2*s/b
    deg=math.degrees(math.atan(c/b))
    ans=90.0-deg
    print('{:.9f}'.format(ans))
else:
    s=a*b-s
    h=2*s/a
    deg=math.degrees(math.atan(a/h))
    ans=90.0-deg
    print('{:.9f}'.format(ans))

Buggy submission (verdict: Runtime Error):
#n=int(input())
a,b,x=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

import math

s=x/a
if s<= a*b/2:
    c=2*s/b
    deg=math.degrees(math.atan(c/b))
    ans=90.0-deg
    print('{:.9f}'.format(ans))
else:
    s=a*b-s
    h=2*s/a
    deg=math.degrees(math.atan(a/h))
    ans=90.0-deg
    print('{:.9f}'.format(ans))

Buggy submission (verdict: Runtime Error):
#n=int(input())
a,b,x=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

import math

s=x/a
if s<= a*b/s:
    c=2*s/b
    deg=math.degrees(math.atan(c/b))
    ans=90.0-deg
    print('{:.9f}'.format(ans))
else:
    s=a*b-s
    h=2*s/a
    deg=math.degrees(math.atan(a/h))
    ans=90.0-deg
    print('{:.9f}'.format(ans))
Problem p03086 (python)

Fixed submission:
S=list(input())

n=len(S)
l=list("ACGT")
ans=[]

for i in range(n):
  count=0
  for j in range(i,n):
    if S[j] in l:
      count+=1
    else:
      break
  ans.append(count)
print(max(ans))

Buggy submission (verdict: Runtime Error):
S=list(input())

n=len(S)
l=list("ACGT")
ans=[]

for i in range(7):
  count=0
  for j in range(i,7):
    if S[j] in l:
      count+=1
    else:
      break
  ans.append(count)
print(max(ans))
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())

for i in range(len(s)):
    if s[i]!="1":
        nextone=s[i]
        break
if s.count("1")==len(s):
    print(1)
elif i>=k:
    print(1)
else:
    print(nextone)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

for i in range(len(s)):
    if s[i]!="1":
        nextone=s[i]
        break
    
if i>=k:
    print(1)
else:
    print(nextone)
Problem p03729 (python)

Fixed submission:
#n=int(input())
a,b,c=map(str,input().split())
#al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(m)]

if a[-1]==b[0] and b[-1]==c[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
st="NO"
for i in range(a,b*a+1):
  if i%b==c:
    st="YES"
    break

print(st)
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split())
l=[a,b,c]
l.sort()
if l==[5,5,7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
l,n=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*ans,sep="")
Problem p04044 (python)

Fixed submission:
n,l=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*ans,sep="")

Buggy submission (verdict: Runtime Error):
l,n=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*ans,sep="")

Buggy submission (verdict: Runtime Error):
l,n=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*s,sep="")

Buggy submission (verdict: Runtime Error):
l,n=map(int,input().split())
li=[input() for i in range(n)]

li.sort()
"""
for st in li :
  s += st
print(s)
"""
print(*li,sep="")

Buggy submission (verdict: Runtime Error):
l,n=map(int,input().split())
li=[input() for i in range(n)]

s=""
li.sort()
for st in li :
  s += st
print(s)
Problem p03696 (python)

Fixed submission:
N = input()

S = raw_input()
sample = [i for i in S]

i = 0
while i < len(sample)-1:
    if sample[i] == '(' and sample[i+1] == ')':
        del sample[i],sample[i]
        i = -1
    i += 1

S = '('*sample.count(')')+S+')'*sample.count('(')
print S

Buggy submission (verdict: Runtime Error):
N = input()

S = raw_input()
sample = [i for i in S]

i = 0
while i < len(sample)-1:
    if sample[i] == '(' and sample[i+1] == ')':
        del sample[i],sample[i+1]
        i = 0
    i += 1

S = '('*sample.count(')')+S+')'*sample.count('(')
print S