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

Fixed submission:
def ferris_wheel(age, cost):
    if age <= 5:
        print(0)
    elif age <= 12:
        print(int(cost / 2))
    else:
        print(cost)
        
a, b = map(int, input().split())
ferris_wheel(a, b)

Buggy submission (verdict: Runtime Error):
import collections

def int_cards(N, cards, operations):
    col_cards = collections.deque(sorted(cards), N)
    operations.sort(reverse=True)
    for c, b in operations:
        for _ in range(b):
            if col_cards[0] >= c:
                break
            col_cards.popleft()
            col_cards.append(c)
            
    print(sum(col_cards))
    
N, M = map(int, input().split())
A = list(map(int,input().split()))
operations = []
for i in range(M):
    B, C = map(int, input().split())
    operations.append([C, B])
    
int_cards(N, A, operations)
Problem p03044 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10**5)

n = int(input())

p = [[] for i in range(n)]

for i in range(n-1):
    u, v, w = list(map(int, input().split()))
    u = u-1
    v = v-1
    p[u].append((v, w))
    p[v].append((u, w))

c = [-1 for i in range(n)]

def dfs(num, zo):
    if c[num] != -1:
        return
    else:
        c[num] = zo
    for v, w in p[num]:
        if w % 2 == 0:
            dfs(v, zo)
        else:
            dfs(v, not zo)
dfs(0, 0)

for i in range(n):
    print(1 if c[i] else 0)

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(2000)

n = int(input())

p = [[] for i in range(n)]

for i in range(n-1):
    u, v, w = list(map(int, input().split()))
    u = u-1
    v = v-1
    p[u].append((v, w))
    p[v].append((u, w))

c = [-1 for i in range(n)]

def dfs(num, zo):
    if c[num] != -1:
        return
    else:
        c[num] = zo
    for v, w in p[num]:
        if w % 2 == 0:
            dfs(v, zo)
        else:
            dfs(v, not zo)
dfs(0, 0)

for i in range(n):
    print(1 if c[i] else 0)

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

p = [[] for i in range(n)]

for i in range(n-1):
    u, v, w = list(map(int, input().split()))
    u = u-1
    v = v-1
    p[u].append((v, w))
    p[v].append((u, w))

c = [-1 for i in range(n)]

def dfs(num, zo):
    if c[num] != -1:
        return
    else:
        c[num] = zo
    for v, w in p[num]:
        if w % 2 == 0:
            dfs(v, zo)
        else:
            dfs(v, -1*(zo-1))
dfs(0, 0)

for i in range(n):
    print(c[i])
Problem p03059 (python)

Fixed submission:
a, b, t = (int(i) for i in input().split())

print(t // a * b)

Buggy submission (verdict: Runtime Error):
a, b, t = [int(i) for i in input().split()]
print(b * (c // a))
Problem p03061 (python)

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

import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd

l = [0, a[0]]
r = [0, a[-1]]
for i in range(1, n):
    l.append(gcd(a[i], l[i]))
    r.append(gcd(a[n-i-1], r[i]))
counter = 0
for i in range(n):
    num = gcd(l[i], r[n-i-1])
    if counter < num:
        counter = num

print(counter)

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

a = list(map(int, input().split()))

left = [a[0]]
right = [a[-1]]

from math import gcd

for i in range(n):
    left.append(gcd(left[i], a[i]))
    right.append(gcd(right[i], a[-1-i]))

ans = [right[-2]]

for l, r in zip(left[2:-1], list(reversed(right[1:]))[2:]):
    ans.append(gcd(l, r))

ans.append(left[-2])

print(max(ans))
Problem p03071 (python)

Fixed submission:
a, b = (map(int, input().split()))
if a == b:
    print(a * 2)
else:
    c = max(a, b)
    print(c * 2 - 1)

Buggy submission (verdict: Runtime Error):
a, b = (map(int, input()))
if a == b:
    print(a * 2)
else:
    c = max(a, b)
    print(c * 2 - 1)

Buggy submission (verdict: Runtime Error):
a, b = (map(int, input()))
if a == b:
    print(a * 2)
else:
    c = max(a, b)
    print(c * (c - 1))
Problem p03228 (python)

Fixed submission:
list_num = [int(i) for i in input().split()]

players = list_num[0:2]
k = list_num[-1]

for i in range(k):
    players[i%2] = players[i%2]//2
    players[(i+1)%2] += players[i%2]

print(players[0], players[1])

Buggy submission (verdict: Runtime Error):
list_num = [int(i) for i in input().split()]

players = list_num[0:1]
k = list_num[-1]

for i in range(k):
    players[i%2] = int(players[i%2]/2)
    players[(i+1)%2] += players[i%2]

for i in range(2):
    print(players[i], end="")

print("")
Problem p03289 (python)

Fixed submission:
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    num = s.index("C")
    s = s[1:num] + s[num+1:]
    if s != s.lower():
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

Buggy submission (verdict: Runtime Error):
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if s[2:-1].count("C") != 1:
        return 0
    s.pop(0)
    s.pop(s.index("C"))
    if s != s.lower():
        return 0
    return 1

l = ["WA", "AC"]

print(l[checker()])

Buggy submission (verdict: Runtime Error):
def checker():
    s = input()
    if s[0] != "A":
        return 0
    if "C" in s[2:-1]:
        s[2:-1].pop(s[2:-1].index("C"))
        if "C" in s[2:-1]:
            return 0
        else:
            return 1
    return 1

l = ["WA", "AC"]

print(l[checker()])
Problem p03292 (python)

Fixed submission:
def main():
    cost_list = input().split()
    for i in range(len(cost_list)):
        cost_list[i] = int(cost_list[i])
    cost_list.sort()
    counter = 0
    for i in range(len(cost_list) - 1):
        counter += cost_list[i+1] - cost_list[i]
    print(counter)

main()

Buggy submission (verdict: Runtime Error):
def main():
    n = [int(i) for i in input().split()]
    bridge = set()
    counter = 0
    reqs = [[int(j) for j in input().split()] for i in range(n[1])]
    reqs.sort(key=lambda x:(x[0],x[1]))
    
    preset = 0
    for i in range(1, n[0]+1):
        if i in bridge:
            bridge = []
            counter += 1
        for j in range(preset, len(reqs)):
            if reqs[j][0] == i:
                bridge.add(reqs[j][1])
            else:
                preset = j
                break
    
    print(counter)

main()

Buggy submission (verdict: Runtime Error):
def main():
    n = [int(i) for i in input().split()]
    bridge = [0 for i in range(n[0]-1)]
    reqs = [[int(j) for j in input().split()] for i in range(n[1])]
    reqs.sort(key=lambda x:(x[1]-x[0]))

    for req in reqs:
        if 1 not in bridge[req[0]-1:req[1]-1]:
            bridge[req[1] - 2] = 1
    print(bridge.count(1))

main()
Problem p03294 (python)

Fixed submission:
def main():
    input()
    lcm = 1
    num_list = [int(i) for i in input().split()]
    for i in range(len(num_list)):
        lcm = num_list[i] * lcm
    lcm -= 1

    counter = 0
    for i in num_list:
        counter += (lcm % i)
    
    print(counter)

main()

Buggy submission (verdict: Runtime Error):
import math

def func(x, y):
    return (x * y) // math.gcd(x, y)

def main():
    input()
    lcm = 1
    num_list = [int(i) for i in input().split()]
    for i in range(len(num_list)):
        lcm = func(num_list[i], lcm)
    lcm -= 1

    counter = 0
    for i in num_list:
        counter += (lcm % i)
    
    print(counter)

main()

Buggy submission (verdict: Runtime Error):
import math

def func(x, y):
    return (x * y) // math.gcd(x, y)

def main():
    input()
    lcm = 1
    num_list = [int(i) for i in input().split()]
    for i in range(len(num_list)):
        lcm = func(num_list[i], lcm)
    lcm -= 1

    counter = 0
    for i in num_list:
        counter += (lcm % i)
    
    print(counter)

main()
Problem p03035 (python)

Fixed submission:
A , B = map(int,input().split())
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(int(B / 2))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A , B = map(int,input().split())
if A => 13:
  print(B)
elif 6 =< A => 12:
  print(B / 2)
else:
  print(0)
Problem p03219 (python)

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

ans = x+y/2

print(int(ans))

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

Z = X + (Y/2)

print(int(Z))

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

Z = X + (Y/2)

print(Z)
Problem p03037 (python)

Fixed submission:
N, M = map(int, input().split())
l, r = map(int, input().split())
for _ in range(M-1):
    new_l, new_r = map(int, input().split())
    if l < new_l:
        l = new_l
    if new_r < r:
        r = new_r

score = r-l+1
if score > 0:
    print(score)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
l, m = map(int, input().split())
for _ in range(M-1):
    new_l, new_r = map(int, input().split())
    if l < new_l:
        l = new_l
    if new_r < r:
        r = new_r

print(r-l+1)
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().rstrip().split())
if A >= 13:
  print(B)
elif A >= 6:
  print(B//2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import sys
import bisect
Q = int(input().rstrip())
#queries = []
#for _ in range(Q):
#    queries.append(list(map(int, input().rstrip().split(" "))))

bias = 0
vs = []

qi = 0
#for query in queries:
#    if len(query) == 3:
#        _, v, b = query
for _ in range(Q):
    query = input()
    if query[0] == "1":
        v, b = map(int, query[2:].split(" "))
        qi += 1
        bisect.insort_left(vs, v)
        bias += b
        if qi == 1:
            abs_sum = 0
            med = v
            medp = 0
        else:
            if qi % 2 == 0:
                if v <= med:
                    # * ^ + -> v * ^ + -> v ^ + +
                    #       -> * v ^ + -> * ^ + +
                    # medp -> same
                    # med -> new
                    # abs_sum -> += abs(new_med - med) + abs(new_med - v) = (med - new_med) + (new_med - v) = med - v
                    abs_sum += med - v
                    med = vs[medp]
                else:
                    # * ^ + -> * ^ + v
                    #       -> * ^ v +
                    # medp -> same
                    # med -> same
                    # abs_sum -> += abs(med - v) = v - med
                    abs_sum += v - med
            else:
                if v <= med:
                    # * ^ + + -> v * ^ + +
                    #         -> * v ^ + +
                    # ^ + -> v ^ +
                    # medp -> += 1
                    # med -> same
                    # abs_sum -> += abs(med - v) = med - v
                    abs_sum += med - v
                    medp += 1
                else:
                    # * ^ + + -> * ^ + + v -> * * ^ + v
                    #         -> * ^ v + + -> * * ^ + +
                    # medp -> += 1
                    # med -> new
                    # abs_sum -> += abs(new_med - v) = v - new_med
                    medp += 1
                    med = vs[medp]
                    abs_sum += v - med
    else:
        print(med, abs_sum+bias)
Problem p03103 (python)

Fixed submission:
s = input().split()
N = int(s[0])
M = int(s[1])
 
AB = {}
for i in range(N):
  data = input().split()
  if int(data[0]) in AB.keys():
    AB[int(data[0])] += int(data[1])
  else:
    AB[int(data[0])] = int(data[1])
AB = sorted(AB.items())
money = 0
num = 0
for A,B in AB:
  for b in range(B):
    num += 1
    money += A
    if num == M:
      break
      
  if num == M:
    break
  
print(int(money))

Buggy submission (verdict: Runtime Error):
s = input().split()
N = int(s[0])
M = int(s[1])

AB = {}
for i in range(N):
  data = input().split()
  AB[int(data[0])] = int(data[1])

money = 0
num = 0
for A,B in sorted(AB.items()):
  if num+B < M:
    money += A*B
  	num += B
  else:
    money += A*(M-num)
    break
  
print(money)
Problem p03035 (python)

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

if a < 6:
    print(0)
elif a < 13:
    print(int(b / 2))
else:
    print(b)

Buggy submission (verdict: Runtime Error):
import numpy as np
N ,M = (int(x) for x in input().split())
a = np.array([int(x) for x in input().split()])
for i in range(M):
    B,C = (int(x) for x in input().split())
    a = np.insert(a, np.shape(a) ,np.full(B, C))

a_sort = np.sort(a)
print(np.sum(a_sort[-N:]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N ,M = (int(x) for x in input().split())
a = np.array([int(x) for x in input().split()])
for i in range(M):
    B,C = (int(x) for x in input().split())
    a = np.insert(a, np.shape(a) ,np.full(B, C))

a_sort = np.sort(a)
print(np.sum(a_sort[-N:]))
Problem p03433 (python)

Fixed submission:
N = int(raw_input())
A = int(raw_input())
div = N % 500
if div <= A:
    print 'Yes'
else:
    print 'No'

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
list = map(int,raw_input().split())
list = np.sort(list)[::-1]
print list
list2 = np.array([1 if i % 2 == 0 else -1 for i in range(N)])
x = np.sum(list * list2)
print x
Problem p03035 (python)

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

if A >= 13:
    print(B)
elif A >= 6:
    print(int(B/2))
else:
    print("0")

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

answer = []
tmp = []

L, R = map(int, input().split())
answer = list(range(L, R+1))

for i in range(M-1):
    L, R = map(int, input().split())
    for j in range(L, R+1):
        if j in answer:
            tmp.append(j)
        elif j > answer[-1]:
            continue
            
    answer = tmp
    tmp = []

print(len(answer))
Problem p03071 (python)

Fixed submission:
A, B = map(int, input().split())
sum = 0
if A < B:
  sum += B
  B = B-1
else:
  sum += A
  A = A-1
 
if A < B:
  sum += B
  B = B-1
else:
  sum += A
  A = A-1
 
print(sum)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split)
sum = 0
if A < B:
  sum += B
  B = B-1
else:
  sum += A
  A = A-1

if A < B:
  sum += B
  B = B-1
else:
  sum += A
  A = A-1

print(sum)
Problem p03035 (python)

Fixed submission:
age, fee= map(int, input().split())

if age <= 5:
    print(0)
elif 6 <= age and age <= 12:
    print(int(fee/2))
elif 13 <= age:
    print(fee)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
LR_list = [list(map(int, input().split())) for _ in range(0, M)]

num_card = 0

for i in range(0, N):
    for j in range(0, M-1):
        if not (i >= LR_list[j][0] and i <= LR_list[j][1]):
            break
    else:
        num_card += 1

print(num_card)

Buggy submission (verdict: Runtime Error):
age = int(input())
fee = int(input())

if age <= 6:
    print(0)
elif 6 <= age and age <= 12:
    print(fee/2)
elif 13 <= age:
    print(fee)
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
if A <= 5:
  print(0)
elif A <= 12:
  print(B // 2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input.split())
if A <= 5:
  print(0)
elif A <= 12:
  print(B // 2)
else:
  print(B)
Problem p03076 (python)

Fixed submission:
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10
 
aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
if k > 0:
  l = r[r != 0].min()
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)

Buggy submission (verdict: Runtime Error):
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
if k > 0:
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)

Buggy submission (verdict: Runtime Error):
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10

aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)

Buggy submission (verdict: Runtime Error):
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10

r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
print(A + B + C + D + E + 10*(k-1) + l)
Problem p03200 (python)

Fixed submission:
S = input()
num, cnt = 0, 0
for k in range(len(S)):
  if S[k] == 'B':
    num += 1
  else:
    cnt += num
print(cnt)

Buggy submission (verdict: Runtime Error):
import numpy as np
S = input()
b_num = S.count('B')
w_num = len(S) - b_num
end = 2**(w_num + 1) - 1
start = 0
for i in range(len(S)):
  if S[i] = 'W':
    start += np.power(2, i)
print(np.log2(start / end))
Problem p03231 (python)

Fixed submission:
import fractions
N, M = map(int, input().split())
S = input()
T = input()
g = fractions.gcd(N, M)
n = N // g
m = M // g
out = n * m * g
for k in range(g):
  if S[k * n] != T[k * m]:
    out = -1
    break
print(out)

Buggy submission (verdict: Runtime Error):
import math
N, M = map(int, input().split())
S = input()
T = input()
g = math.gcd(N, M)
n = N // g
m = M // g
out = n * m * g
for k in range(g):
  if S[k * n] != T[k * m]:
    out = -1
    break
print(out)

Buggy submission (verdict: Runtime Error):
import math
N, M = map(int, input().split())
S = input()
T = input()
g = math.gcd(N, M)
flag = True
n = N // g
m = M // g
for k in range(g):
  flag *= int(S[n*k] == T[m*k])
if flag == 0:
  out = -1
else:
  out = n * m * g
print(out)

Buggy submission (verdict: Runtime Error):
import math
N, M = map(int, input().split())
S = input()
T = input()
g = math.gcd(N, M)
flag = True
n = int(N / g)
m = int(M / g)
for k in range(g):
  flag *= int(S[n*k] == T[m*k])
if flag == 0:
  out = -1
else:
  out = n * m * g
print(out)

Buggy submission (verdict: Runtime Error):
import math
N, M = map(int, input().split())
S = input()
T = input()
g = math.gcd(N, M)
flag = True
n = int(N / g)
m = int(M / g)
for k in range(g):
  flag *= int(S[n*m*k] == T[n*m*k])
if flag == 0:
  out = -1
else:
  out = n * m * g
print(out)

Buggy submission (verdict: Runtime Error):
import math
N, M = map(int, input().split())
S = input()
T = input()
g = math.gcd(N, M)
flag = True
n = N / g
m = M / g
for k in range(g):
  flag *= (S[n*m*k] == T[n*m*k])
if flag == 0:
  out = -1
else:
  out = n * m * g
print(out)
Problem p03311 (python)

Fixed submission:
import sys

N = int(input())
A = list(map(int, input().split()))
A = sorted([A[k]-(k+1) for k in range(N)])

if N == 1:
  print(0)
  sys.exit()

for k in range((N-2)//2 + 1, N-1):
  if A[k] < A[k+1]:
    b = k
    break
  if k == N-2:
    print(0)
    sys.exit()
print(sum([abs(A[k]-A[b]) for k in range(N)]))

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())
A = list(map(int, input().split()))
A = sorted([A[k]-(k+1) for k in range(N)])

for k in range((N-2)//2 + 1, N-1):
  if A[k] < A[k+1]:
    b = k
    break
  if k == N-2:
    print(0)
    sys.exit()
print(sum([abs(A[k]-A[b]) for k in range(N)]))
Problem p03331 (python)

Fixed submission:
import numpy as np
N = input()
N = np.array([int(k) for k in N])
if N[-1] == 0:
  print(10)
else:
  print(N.sum())

Buggy submission (verdict: Runtime Error):
import numpy as np
N = np.array(int(input()))
if N[-1] == 0:
  print(10)
else:
  print(N.sum())

Buggy submission (verdict: Runtime Error):
import numpy as np
N = np.array(int(input()))
if N[-1] == 0:
  print(10)
else:
  print(N.cumsum())
Problem p03363 (python)

Fixed submission:
import numpy as np
N = int(input())
A = np.array([0] + list(map(int, input().split())))
B = np.cumsum(A)
B.sort()
cnt = 1
out = 0
for k in range(N):
  if B[k] == B[k+1]:
    cnt += 1
    if k == N-1:
      out += (cnt * (cnt - 1)) // 2
  else:
    out += (cnt * (cnt - 1)) // 2
    cnt = 1
print(out)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
B = np.cumsum(A)
B = B.sort()
cnt = 0
for k in range(N):
  if B[k] == B[k+1]:
    cnt += 1
  else:
    continue
print(cnt)
Problem p03035 (python)

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


if b%2==0 and 2<=b<=1000:
  
  if 0<=a<=5:
    
    print(0)
  
  elif 6<=a<=12:
    
    print(int(b/2))
    
  elif 13<=a<=100:
    
    print(b)

Buggy submission (verdict: Runtime Error):

if 6<=a<=13:

    print(int(b/2))

elif 0<=a<=5:
    print(0)

elif 13<=a<=100:
    print(b)
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
if (a<6):
  print(0)
elif (a<13):
  print(b//2)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
r,d,x=map(int, input().split())
for i in range(1,11):
  x_i = r*x - d
  print(x_i)
  x = x_i
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input.split())
print(b*int(c/a))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input.split())
print(b*(c//a))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split()
print(b*int(c/a))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split()
print(b*(c//a))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input.split()
print(b*(c//a))
Problem p03086 (python)

Fixed submission:
def main():
    S = list(input())
    count = 0
    counts = []
    for i in S:
        if i in ['A', 'T', 'C', 'G']:
            count += 1
        else:
            counts.append(count)
            count = 0
    counts.append(count)
    print(max(counts))
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = list(input())
    count = 0
    counts = []
    for i in S:
        if i in ['A', 'T', 'C', 'G']:
            count += 1
        else:
            counts.append(count)
            count = 0
    print(max(counts))
main()
Problem p04012 (python)

Fixed submission:
def main2():
    w = input()
    judge = "Yes"
    for i in w:
        if w.count(i) % 2 != 0:
            judge = "No"
    print(judge)

main2()

Buggy submission (verdict: Runtime Error):
def main2():
    w = input()
    judge = "Yes"
    for i in w:
        if w.count(i) % 2 != 0:
            judge = false
    print(judge)

main2()

Buggy submission (verdict: Runtime Error):
def main2():
    w = input()
    judge = ""
    for i in w:
        if w.count(i) % 2 != 0:
            judge = false
    print(judge)

main2()
Problem p03280 (python)

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

l = input().split()
a = int(l[0])
b = int(l[1])

garden = (a-1) * (b-1)
print(garden)

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

a = int(sys.argv[1])
b = int(sys.argv[2])

garden = (a-1) * (b-1)
print(garden)

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

a = sys.args[0]
b = sys.args[1]

garden = (a-1) * (b-1) + 1
print(garden)
Problem p03037 (python)

Fixed submission:
n,m = [int(i) for i in input().split()]

n_left = 1
n_right = n
result = 0

for i in range(m):
    l_i,r_i = [int(i) for i in input().split()]
    if(l_i > n_left):
        n_left = l_i
    if(r_i < n_right):
        n_right = r_i

if(n_left > n_right):
    print(0)
else:
    print(n_right - n_left + 1)

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

n_left = 1
n_right = n
result = 0

for i in range(m):
    l_i,r_i = [int(i) for i in input().split()]
    if(l_i > n_left):
        n_left = l_i
    if(r_i < n_right):
        n_right = r_i
    if(n_left > n_right):
        print(0)
        sys.exit(0)

print(n_right - n_left + 1)