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

Fixed submission:
from collections import deque

N = int(input())
c = input()

rd = deque([i for i, x in enumerate(c) if x == "R"])
wd = deque([i for i, x in enumerate(c) if x == "W"])
if(len(rd) == 0 or len(wd) == 0):
  print(0)
  exit()
count = 0
for i in range(len(c)):
  if(not(wd[0] < rd[-1])):
    break
  rd.pop()
  wd.popleft()
  count += 1
  if(len(rd) == 0 or len(wd) == 0):
    break
print(count)

Buggy submission (verdict: Runtime Error):
from collections import deque

N = int,input()
c = input()

rd = deque([i for i, x in enumerate(c) if x == "R"])
wd = deque([i for i, x in enumerate(c) if x == "W"])
if(len(rd) == 0 or len(wd) == 0):
  print(0)
  exit()
count = 0
for i in range(len(c)):
  if(not(wd[0] < rd[-1])):
    break
  rd.pop()
  wd.popleft()
  count += 1
print(count)
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c >= 22:
  	print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b+c >= 22:
  	print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
s = input()
arr = [int(i) for i in s.split('')]
result = 0
for j in range(arr):
  result += arr[j]
if(result >= 22):
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
s = input()
arr = [int(i) for i in s.split('')]
result = 0
for i in range(arr):
  result = result+arr[i]
if(result>=22):
  print("bust")
else:
  print("win")
Problem p02859 (python)

Fixed submission:
print(int(input()) ** 2)

Buggy submission (verdict: Runtime Error):
print(r*r)
Problem p03221 (python)

Fixed submission:
N,M = map(int,input().split())
PY = [[int(py) for py in input().split()] for _ in range(M)]

for i in range(1,M+1):
    PY[i-1].append(i)

PY.sort(key=lambda x:x[1])

count = [1 for _ in range(N)]

ans = []

for cell in PY:
    row = '{0:06d}'.format(cell[0]) + '{0:06d}'.format(count[cell[0]-1])
    ans.append([row,cell[2]])
    count[cell[0]-1] += 1


ans.sort(key=lambda x:x[1])

for row in ans:
    print(row[0])

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

for i in range(1,M+1):
    PY[i-1].append(i)

PY.sort(key=lambda x:x[1])

count = [1 for _ in range(M)]

ans = []

for cell in PY:
    row = '{0:06d}'.format(cell[0]) + '{0:06d}'.format(count[cell[0]-1])
    ans.append([row,cell[2]])
    count[cell[0]-1] += 1


ans.sort(key=lambda x:x[1])

for row in ans:
    print(row[0])

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

for i in range(1,M+1):
    PY[i-1].append(i)

PY.sort(key=lambda x:x[1])

count = [1 for _ in range(M)]

ans = []

for cell in PY:
    row = '{0:06d}'.format(cell[0]) + '{0:06d}'.format(count[cell[0]])
    ans.append([row,cell[2]])
    count[cell[0]] += 1


ans.sort(key=lambda x:x[1])

for row in ans:
    print(row[0])

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

for i in range(1,M+1):
    PY[i-1].append(i)

PY.sort(key=lambda x:x[1])

count = [1 for _ in range(M)]

ans = []

for cell in PY:
    row = '{0:06d}'.format(cell[0]) + '{0:06d}'.format(count[cell[0]])
    ans.append([row,cell[2]])
    count[cell[0]] += 1


ans.sort(key=lambda x:x[1])

for row in ans:
    print(row[0])
Problem p02897 (python)

Fixed submission:
n = int(input())
count = 0
result = 0
for i in range(n+1):
  if i % 2 == 0:
    pass
  else:
    count +=1

result = count / n

print(result)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
ki = list(map(int,input().split()))
count = 0

for i in range(n):
  if ki[i] >= k:
    count += 1
  else:
    pass

print(count)
Problem p02682 (python)

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

#K枚の優先順位を選ぶ
#＋１の枚数分だけ選択、KからAを引く、総和のリストにA枚分の+1を追加
# K<Aのとき、K枚分だけリストにAを追加、KからKを引く
#0の枚数分だけ選択、KからBを引く、総和のリストにB枚分の0を追加

#・・・総和のリストないの総和を計算する
sum_num = []
card_num = [1,0,-1]
for i,card in enumerate(a[0:3]):
  if card > a[3]:
    sum_num.append(a[3] * card_num[i])
    a[3] -= a[3]
  else:
    sum_num.append(card * card_num[i])
    a[3] -= card
print(sum(sum_num))

Buggy submission (verdict: Runtime Error):
sum_num = []
card_num = [1,0,-1]
for i,card in enumerate(a[0:3]):
  if card > a[3]:
    sum_num.append(a[3] * card_num[i])
    a[3] -= a[3]
  else:
    sum_num.append(card * card_num[i])
    a[3] -= card
print(sum(sum_num))
Problem p02753 (python)

Fixed submission:
S = input()

if 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')
  
#ABA
#BBA
#BBB

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
box = ''
for i in range(n//(a+b)+1):
  box += ('b' * a)
  box += ('r' * b)
print(len([i for i in box[0:n] if i == 'b']))
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())
#aとbの合計値がnを割り切れるだけの個数 X aの個数分
ans = n // (a + b) * a
#aとbの合計値でnが余ってしまった時の個数
rem = n % (a + b)
#aだけ入れれた場合か、bも混ざっている場合か、どちらかをansに追加
ans += min(rem, a)
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
box = ''
for i in range(n//(a+b)+1):
  box += ('b' * a)
  box += ('r' * b)
print(len([i for i in box[0:n] if i == 'b']))

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
box = ''
for i in range(n//(a+b)+1):
  box += ('b' * a)
  box += ('r' * b)
print(box)
print(len([i for i in box[0:n] if i == 'b']))
Problem p02879 (python)

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

if A // 10 == 0 and B // 10 == 0:
  print(A * B)
else:
  print(-1)
# 2 5
#5 10
#9 9

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 'No'
 
for i in range(1, 10):
    if ans == 'Yes':
        break
 
    for j in range(1, 10):
        if N == i * j:
            ans = "Yes"
            break
        else:
            ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = "No"
for i in range (1,10):
  for j in range(1,10):
    if N == i * j:
      ans = "Yes"
      break
print(ans)
Problem p03326 (python)

Fixed submission:
N, M = map(int, raw_input().split(" "))

xyz = []
for i in range(N):
    xyz.append(map(int, raw_input().split(" ")))
result = -1
i = j = k = 1

def compare(x, y):
    if i*x[0]+j*x[1]+k*x[2]>i*y[0]+j*y[1]+k*y[2]:
        return 1
    elif i*x[0]+j*x[1]+k*x[2]<i*y[0]+j*y[1]+k*y[2]:
        return -1
    else:
        return 0

def calculate(x, y):
    return [x[0]+y[0], x[1]+y[1], x[2]+y[2]]

for i in [1,-1]:
    for j in [1,-1]:
        for k in [1,-1]:
            xyz.sort(compare)
            tmp = 0 if M==0 else sum(map(abs, reduce(calculate, xyz[:M])))
            result = max(tmp, result)

print result

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

xyz = []
for i in range(N):
    xyz.append(map(int, raw_input().split(" ")))
result = -1
i = j = k = 1

def compare(x, y):
    if i*x[0]+j*x[1]+k*x[2]>i*y[0]+j*y[1]+k*y[2]:
        return 1
    elif i*x[0]+j*x[1]+k*x[2]<i*y[0]+j*y[1]+k*y[2]:
        return -1
    else:
        return 0

def calculate(x, y):
    return [x[0]+y[0], x[1]+y[1], x[2]+y[2]]

for i in [1,-1]:
    for j in [1,-1]:
        for k in [1,-1]:
            xyz.sort(compare)
            tmp = sum(map(abs, reduce(calculate, xyz[:M])))
            if tmp > result:
                result = tmp
print result

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

xyz = []
for i in range(N):
    xyz.append(map(int, raw_input().split(" ")))
result = sum(map(abs, xyz[0]))
i = j = k = 1

def compare(x, y):
    if i*x[0]+j*x[1]+k*x[2]>i*y[0]+j*y[1]+k*y[2]:
        return 1
    elif i*x[0]+j*x[1]+k*x[2]<i*y[0]+j*y[1]+k*y[2]:
        return -1
    else:
        return 0

def calculate(x, y):
    return [x[0]+y[0], x[1]+y[1], x[2]+y[2]]

for i in [1,-1]:
    for j in [1,-1]:
        for k in [1,-1]:
            xyz.sort(compare)
            tmp = sum(map(abs, reduce(calculate, xyz[:M])))
            if tmp > result:
                result = tmp
print result
Problem p02546 (python)

Fixed submission:
s = input()
if s[-1] == "s":
    print(s + "es")
else:
    print(s + "s")

Buggy submission (verdict: Runtime Error):
s = input()
if s[-1] == "s":
    print(s + "es")
else:
    print(sa + "s")
Problem p02546 (python)

Fixed submission:
a = input()
 
if a[-1] == 's':
  print(a, end='es')
else:
  print(a, end='s')

Buggy submission (verdict: Runtime Error):
a = input()
 
if a[-1] == 's':
  print(a end='es')
else:
  print(a end='s')

Buggy submission (verdict: Runtime Error):
a = input()
 
if a[-1] = 's':
  print(a end='es')
else:
  print(a end='s')

Buggy submission (verdict: Runtime Error):
a = input()
 
if a(-1:) = 's':
  print(a end='es')
else:
  print(a end='s')

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

if a(:1) = 's':
  print(a end='es')
else:
  print(a end='s')
Problem p03835 (python)

Fixed submission:
K, S = map(int, input().split())
count = 0

for i in range(K+1):
    for j in range(K+1):
        if 0<=S-i-j<=K:
            count += 1
print(count)

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

for i in range(K+1):
    for j in range(K+1):
        if 0<=S-i-j<=K:
            count += 1
print(count
Problem p02622 (python)

Fixed submission:
s = input()
t = input()
ans = 0
 
for i in range(len(s)):
  if (s[i] != t[i]):
    ans = ans + 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
ans = 0

for i in range(len(s)):
  if (s[i] != t[i]):
    ans = ans + 1

print(ans)
Problem p02546 (python)

Fixed submission:
a = input()

if (a[-1] != "s"):
    a += "s"

else :
    a += "es"

print(a)

Buggy submission (verdict: Runtime Error):
a = int(input())
count = 0
for i in range(a):
    a,b = map(int,input().split())
    
    if (a==b):
        count += 1
        break
    else : 
        count = 0

if (count >= 3):
        
    print("Yes")
else :
    print("No")
Problem p02688 (python)

Fixed submission:
a,b = map(int,input().split())
lis = [0]*a
for i in range(b):
  c = int(input())
  d = input().split()
  
  for l in range(c):
    lis[int(d[l])-1] += 1
    
count = 0
for i in range(a):
  if(lis[i] == 0):
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
lis = [0]*b
for i in range(a):
  c = int(input())
  d = input().split()
  
  for l in range(c):
    lis[int(d[l])-1] += 1
    
count = 0
for i in range(b):
  if(lis[i] == 0):
    count += 1

print(count)
Problem p02629 (python)

Fixed submission:
N = int(input())
ans = ''
while N > 0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])

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

ch = ['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']


# def Base_10_to_n(X, n):
#     X_dumy = X
#     out = ''
#     while X_dumy > 0:
#         out = ch[X_dumy % n - 1] + out
#         X_dumy = int(X_dumy / n)
#     return out


# print(Base_10_to_n(N, 26))

keta = 0
max = 0
while max < N:
    keta += 1
    max += 26 ** keta

res = ""
while keta > 0:
    res += ch[N // (26 ** (keta - 1)) - 1]
    N = N - (26 ** (keta - 1))
    keta -= 1
print(res)

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

ch = ['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']


# def Base_10_to_n(X, n):
#     X_dumy = X
#     out = ''
#     while X_dumy > 0:
#         out = ch[X_dumy % n - 1] + out
#         X_dumy = int(X_dumy / n)
#     return out


# print(Base_10_to_n(N, 26))

keta = 0
max = 0
while max < N:
    keta += 1
    max += 26 ** keta

res = ""

while keta > 0:
    res += (ch[N // (26 ** (keta - 1)) - 1])
    N = N - (26 ** (keta - 1))
    keta -= 1

print(res)
Problem p02777 (python)

Fixed submission:
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())
if S == U:
    A -= 1
else:
    B -= 1
print("{0} {1}".format(A, B))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
print("YES") if len(A) == len(list(set(A))) else print("NO")
Problem p02833 (python)

Fixed submission:
N = int(input())

import math

if N % 2 == 1:
    print(0)
elif N == 0:
    print(0)
else:
    half = N // 2
    m = math.floor(math.log(half, 5))
    cnt = 0
    for i in range(m):
        cnt += half // (5 ** (i+1))
    print(cnt)

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

import math

if N % 2 == 1:
    print(0)
else:
    half = N // 2
    m = math.floor(math.log(half, 5))
    cnt = 0
    for i in range(m):
        cnt += half // (5 ** (i+1))
    print(cnt)
Problem p02862 (python)

Fixed submission:
import math
import sys

X, Y = map(int, input().split())

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

if X / 2 > Y or Y > X * 2:
    print(0)
    sys.exit()

x = X - ((X + Y) // 3)
y = Y - ((X + Y) // 3)

mod = 10 ** 9 + 7

numerater = 1
for i in range(1, x+y+1):
    numerater =  (numerater * i) % mod

denominator_x = 1
for i in range(1, x+1):
    denominator_x = (mod_inv(i, mod) * denominator_x) % mod

denominator_y = 1
for i in range(1, y+1):
    denominator_y = (mod_inv(i, mod) * denominator_y) % mod

res = (numerater * denominator_x * denominator_y) % mod

print(res)

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

X, Y = map(int, input().split())

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

x = X - ((X + Y) // 3)
y = Y - ((X + Y) // 3)

mod = 10 ** 9 + 7

numerater = math.factorial(x + y) % mod
denominator_x = math.factorial(x) % mod
denominator_y = math.factorial(x) % mod
denominator = (denominator_x * denominator_y) % mod

res = (numerater * mod_inv(denominator, mod)) % mod

print(res)
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
a = [int(input()) for j in range(M)]

#dp[i]:i段目までの上がり方

div = 1000000007

dp = [0] * (N+1)
dp[0] = 1
if not 1 in a:
    dp[1] = 1
else:
    del a[0]

def stairs():
    for i in range(N-1):
        if dp[i+1] == 0 and dp[i] == 0:
            break
        if a:
            if i+2 == a[0]:
                del a[0]
                continue
        dp[i+2] = (dp[i+1] + dp[i]) % div
    print(dp[N])

stairs()

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [int(input()) for j in range(M)]

#dp[i]:i段目までの上がり方

div = 1000000007

dp = [0] * (N+1)
dp[0] = 1
if not 1 in a:
    dp[1] = 1
else:
    del a[0]

def stairs():
    for i in range(N-1):
        if dp[i+1] == 0 and dp[i] == 0:
            break
        if i+2 != a[0]:
            del a[0]
        else:
            dp[i+2] = (dp[i+1] + dp[i]) % div
    print(dp[N])

stairs()
Problem p02623 (python)

Fixed submission:
from sys import stdin
import bisect

def main():
    input = stdin.readline
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = [0] * (n + 1)
    for i in range(n):
        c[i + 1] = c[i] + a[i]
    d = [0] * (m + 1)
    for i in range(m):
        d[i + 1] = d[i] + b[i]
    cnt = 0
    for i in range(n + 1):
        if c[i] > k:
            break
        e = bisect.bisect_right(d, k - c[i])
        if cnt < i + e - 1:
            cnt = i + e - 1
    print(cnt)
main()

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
arr0 = list(map(int,input().split()))
arr1 = list(map(int,input().split()))
acc0 = [0]

for i in range(n):
  acc0.append(acc0[-1] + arr0[i])
acc1 = [0]
for i in range(m):
  acc1.append(acc1[-1] + arr1[i])
ans = 0
j = m
for i in range(n+1):
  if acc0[i] > k:
    break
  while acc1[j] > k - acc0[i] and j > 0:
    j -= 1
  ans = max(i + j)

print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
arr0 = list(map(int,input().split()))
arr1 = list(map(int,input().split()))
acc0 = []

for i in range(n):
  acc0.append(acc0[-1] + arr0[i])
acc1 = []
for i in range(m):
  acc1.append(acc1[-1] + arr1[i])
ans = 0
j = m
for i in range(n+1):
  if acc0[i] > k:
    break
  while acc1[j] > k - acc0[i] and j > 0:
    j -= 1
  ans = max(ans, i + j)

print(ans)
Problem p02627 (python)

Fixed submission:
s = input()

if s == s.upper():
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from heapq import heappush, heappop
import sys


def main(K, N):
    P = 10 ** 9 + 7

    P25 = [1] * (K + 1)
    P26 = [1] * (K + 1)
    F = [1] * (N + K)
    INV = [1] * (N + K)
    INVF = [1] * (N + K)

    p25 = 1
    p26 = 1
    for i in range(1, K + 1):
        p25 *= 25
        p25 %= P
        P25[i] = p25

        p26 *= 26
        p26 %= P
        P26[i] = p26

    f = 1
    invf = 1
    for i in range(2, N + K):
        f *= i
        f %= P
        F[i] = f
        q, r = divmod(P, i)
        INV[i] = -INV[r] * q % P
        invf *= INV[i]
        invf %= P
        INVF[i] = invf

    def comb_rep(n, r):
        return (F[n + r - 1] * INVF[r] % P) * INVF[n - 1] % P

    ret = 0
    for i in range(K + 1):
        ret += (
            P25[i] *
            P26[K - i] % P *
            comb_rep(N, i) % P
        )
    return (ret % P)


if sys.argv[-1] == 'ONLINE_JUDGE':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8(i8,i8)')(main)
    cc.compile()
    exit()
else:
    from my_module import main
    K = int(input())
    S = input()
    print(main(K, len(S)))
Problem p02676 (python)

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

if len(S) > K:
  S = S[:K] + "..."

print(S)

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

if k < len(s):
  s = s[0,k]+"..."
print(s)

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

if k < len(s):
  s = s[0,k]+"..."
print(s)
Problem p02682 (python)

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

if k <= a:
  print(k)
elif k <= a + b:
  print(a)
else:
  print(a-(k - (a + b)))

Buggy submission (verdict: Runtime Error):
a, b, c, k = int(input())

if k <= a:
  print(k)
elif k <= a + b:
  print(a)
else:
  print(a-(k - (a + b)))

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  if(k <= a) cout << k << endl;
  else if(k <= a + b) cout << a << endl;
  else cout << a - (k - a - b) << endl;
  return 0;
}
Problem p02695 (python)

Fixed submission:
n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0

for i1 in range(1,m+1):
  for i2 in range(i1,m+1):
    for i3 in range(i2,m+1):
      for i4 in range(i3,m+1):
        for i5 in range(i4,m+1):
          for i6 in range(i5,m+1):
            for i7 in range(i6,m+1):
              for i8 in range(i7,m+1):
                for i9 in range(i8,m+1):
                  for i10 in range(i9,m+1):
                    tmp = 0
                    arrs = [0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10]
                    for a,b,c,d in arr:
                      if arrs[b] - arrs[a] == c:
                        tmp += d
                    ans = max(ans,tmp)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,q = map(int,input().split())
arr = [list(map(int,input().split())) for x in range(q)]
ans = 0

for i1 in range(1,m+1):
  for i2 in range(i1,m+1):
    for i3 in range(i2,m+1):
      for i4 in range(i4,m+1):
        for i5 in range(i4,m+1):
          for i6 in range(i5,m+1):
            for i7 in range(6,m+1):
              for i8 in range(i7,m+1):
                for i9 in range(i8,m+1):
                  for i10 in range(i9,m+1):
                    tmp = 0
                    arrs = [0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10]
                    for a,b,c,d in arr:
                      if arrs[b] - arrs[a] == c:
                        tmp += d
                    ans = max(ans,tmp)
print(ans)
Problem p02723 (python)

Fixed submission:
s = input()
ans = "No"

if s[2]==s[3] and s[4]==s[5]:
  ans = "Yes"
  
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = "No"

if s[2]==s[3]&&s[4]==s[5]:
  ans = "Yes"
  
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = No

if s[2]==s[3]&&s[4]==s[5]:
  ans = Yes
  
print(ans)
Problem p02725 (python)

Fixed submission:
k,n = map(int,input().split())
a = list(map(int,input().split()))
b = []

for i in range(1,n):
  b.append(a[i] - a[i - 1])
b.append(k - a[n-1] + a[0])

b = sorted(b)
print(sum(b[:n-1]))

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

for i in (1,n):
  b.append(a[i] - a[i-1])
b.append(k - a[n-1] + a[0])
b = sorted(b)

print(sum(b[:-1]))

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

for i in range(1,n):
  b.append(a[i]-a[i-1])
b.append(k-a[n-1]+a[0])

b.sorted(b)

print(sum(b[:-1]))

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

for i in range(1,n):
  b.append(a[i]-a[i-1])
b.append(k-a[n-1]-a[0])

b.sorted(b)

print(sum(b[:-1]))

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

for i in range(1,n+1):
  b.append(a[i] - a[i-1])
b.append(k - a[n] + a[0])
b = sorted(b)

print(sum(b[:n-1])

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

for i in range(1,n+1):
  b.append(a[i] - a[i-1])
b.append(k - a[n] + a[0])
b = sorted(b)

print(sum(b[:n])

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

for i in range(1,n+1):
  b.append(a[i] - a[i-1])
b.append(k - a[n] + a[0])
b = sorted(b)

print(sum(b:[:n])
Problem p02552 (python)

Fixed submission:
x = int(input())
 
if x == 0:
  print(1)
elif x == 1:
  print(0)

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

if x = 0:
  print(1)
elif x = 1:
  print(0)