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

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

def has_duplicates(seq):
    return len(seq) != len(set(seq))


if has_duplicates(A) == False:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

N = int(input())
A = list(map(int, input().split()))
print(A)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
def has_duplicates(seq):
    return len(seq) != len(set(seq))


if gcd_list(A)==1 and has_duplicates(A) == False:
    print("YES")
else:
    print("NO")
Problem p03042 (python)

Fixed submission:
S = input()
s_1 = int(S[:2])
s_2 = int(S[2:])

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")

Buggy submission (verdict: Runtime Error):
S = input()
s_1 = S[:2]
s_2 = S[2:]

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")
Problem p03107 (python)

Fixed submission:
S = list(input())
obj = min(S.count("0"),S.count("1"))
print(obj*2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**5//2)
S = list(input())
n = len(S)
def Remove(binList,lenList):
    for i in range(0,lenList-1):
        if (binList[i] == "0" and binList[i+1] == "1") or (binList[i] == "1" and binList[i+1] == "0"):
            del binList[i:i+2]
            return Remove(binList,lenList - 2)
    return binList
if n > 10**5:
    sys.exit()
S = Remove(S,n)
print(n-len(S))

Buggy submission (verdict: Runtime Error):
import sys
S = list(input())
n = len(S)
def Remove(binList,lenList):
    for i in range(0,lenList-1):
        if (binList[i] == "0" and binList[i+1] == "1") or (binList[i] == "1" and binList[i+1] == "0"):
            del binList[i:i+2]
            return Remove(binList,lenList - 2)
    return binList
if n > 10**5:
    sys.exit()
S = Remove(S,n)
print(n-len(S))

Buggy submission (verdict: Runtime Error):
S = list(input().strip())
n = len(S)
def Remove(binList,lenList):
    for i in range(0,lenList-1):
        if (binList[i] == "0" and binList[i+1] == "1") or (binList[i] == "1" and binList[i+1] == "0"):
            del binList[i:i+2]
            return Remove(binList,lenList - 2)
    return binList
S = Remove(S,n)
print(n-len(S))

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

def Remove(binList,lenList):
    for i in range(0,lenList-1):
        if (binList[i] == "0" and binList[i+1] == "1") or (binList[i] == "1" and binList[i+1] == "0"):
            del binList[i:i+2]
            return Remove(binList,lenList - 2)
    return binList
S = Remove(S,n)
print(n-len(S))
Problem p03137 (python)

Fixed submission:
import sys

n,m=input().split()
N = int(n)
M = int(m)
X = input().split()
#MはXの要素の数
X = [int(x) for x in X]

X.sort()
if M == 1:
    print(0)
    sys.exit()
elif M < 1:
    sys.exit()

minus = [X[i]-X[i-1] for i in range(1,M)]
#print(minus)

minus.sort()
#print(minus)
sum_num = 0
if N < M:
    for i in range(M-N):
        sum_num += minus[i]
    print(sum_num)
elif N >= M:
    print(0)

Buggy submission (verdict: Runtime Error):
import sys

n,m=input().split()
N = int(n)
M = int(m)
X = input().split()
#MはXの要素の数
X = [int(x) for x in X]

X.sort()
if M == 1:
    print(0)
    sys.exit()
elif M < 1:
    sys.exit()

minus = [X[i]-X[i-1] for i in range(1,M)]
#print(minus)

minus.sort()
#print(minus)
sum_num = 0
if N < M:
    for i in range(N+1):
        sum_num += minus[i]
    print(sum_num)
elif N >= M:
    print(0)

Buggy submission (verdict: Runtime Error):
import sys

n,m=input().split()
N = int(n)
M = int(m)
X = input().split()
#MはXの要素の数
X = [int(x) for x in X]

X.sort()
if M == 1:
    print(0)
    sys.exit()
elif M < 1:
    sys.exit()

minus = [X[i]-X[i-1] for i in range(1,M)]
#print(minus)

minus.sort()
#print(minus)
sum_num = 0
if N < M:
    for i in range(N+1):
        sum_num += minus[i]
    print(sum_num)
elif N >= M:
    print(0):

Buggy submission (verdict: Runtime Error):
import sys

n,m=input().split()
N = int(n)
M = int(m)
X = input().split()
#MはXの要素の数
X = [int(x) for x in X]

X.sort()
if M == 1:
    print(0)
    sys.exit()
elif M < 1:
    sys.exit()

minus = [X[i]-X[i-1] for i in range(1,M)]
#print(minus)

minus.sort()
#print(minus)
sum_num = 0
if N < M:
    for i in range(N+1):
        sum_num += minus[i]
    print(sum_num)
elif N >= M:
    print(0):

Buggy submission (verdict: Runtime Error):
import sys

n,m=input().split()
N = int(n)
M = int(m)
X = input().split()
#MはXの要素の数
X = [int(x) for x in X]

X.sort()
if M == 1:
    print(0)
    sys.exit()
elif M < 1:
    sys.exit()

minus = [X[i]-X[i-1] for i in range(1,M)]
#print(minus)

minus.sort()
#print(minus)
sum_num = 0
for i in range(N+1):
    sum_num += minus[i]
print(sum_num)

Buggy submission (verdict: Runtime Error):
import sys

n,m=input().split()
N = int(n)
M = int(m)
X = input().split()
#MはXの要素の数
X = [int(x) for x in X]

X.sort()
if M < 2:
    print(0)
    sys.exit()

minus = [X[i]-X[i-1] for i in range(1,M)]
#print(minus)

minus.sort()
#print(minus)
sum_num = 0
for i in range(N+1):
    sum_num += minus[i]
print(sum_num)
Problem p03803 (python)

Fixed submission:
def f(a, b):
    if a == b:
        return 'Draw'
    if a > b:
        return 'Alice'
    if a < b:
        return 'Bob'

a, b = map(int, input().split())
if a == 1:
    a += 100
if b == 1:
    b += 100
print(f(a, b))

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

def f(n, m, uu, vv):
    a = [[0] *n for _ in range(n)]
    for u, v in zip(uu, vv):
        a[u][v] = 1
        a[v][u] = 1
    res = 0
    for p in permutations(range(n)):
        if p[0] != 0:
            break
        ok = True
        for i in range(n - 1):
            if a[p[i]][p[i+1]] == 0:
                ok = False
                break
        if ok:
            res += 1
    return res

n , m = map(int, input().split())
a = []
b = []
for k in range(m):
    _a, _b = map(int, input().split())
    _a -= 1
    _b -= 1
    a.append(_a)
    b.append(_b)
print(f(n, m, a, b))
Problem p03806 (python)

Fixed submission:

n, ma, mb = map(int, input().split())
a = [0] * n
b = [0] * n
c = [0] * n
for i in range(n):
    a[i], b[i], c[i] = map(int, input().split())

M = 401
INF = 10 ** 15
min_cost = [[INF] * M for k in range(M)]
s = set()
min_cost[0][0] = 0
s.add((0, 0))

for k in range(n):
    ss = set(s)
    for i, j in reversed(sorted(s)):
        if i + a[k] < M and j + b[k] < M:
            cc = min_cost[i][j] + c[k]
            if cc < min_cost[i + a[k]][j + b[k]]:
                ss.add((i + a[k], j + b[k]))
                min_cost[i + a[k]][j + b[k]] = cc
    s = ss

res = INF
for i in range(1, M):
    for j in range(1, M):
        if i * mb == j * ma:
            if min_cost[i][j] < res:
                res = min_cost[i][j]

if res == INF:
    res = -1
print(res)

Buggy submission (verdict: Runtime Error):

n, ma, mb = map(int, input().split())
a = [0] * n
b = [0] * n
c = [0] * n
for i in range(n):
    a[i], b[i], c[i] = map(int, input().split())

M = 401
INF = 10 ** 15
min_cost = dict()
min_cost[0, 0] = 0

for k in range(n):
    keys = min_cost.keys()
    for i, j in reversed(sorted(keys)):
        if i + a[k] < M and j + b[k] < M:
            cc = min_cost[i][j] + c[k]
            if cc < min_cost[i + a[k]][j + b[k]]:
                min_cost[i + a[k]][j + b[k]] = cc

res = INF
for i in range(1, M):
    for j in range(1, M):
        if i * mb == j * ma:
            if min_cost[i][j] < res:
                res = min_cost[i][j]

if res == INF:
    res = -1
print(res)
Problem p03072 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
ans_index = [0]

for i in range(1, n):
    if h[i] >= max(h[:i]):
        ans_index.append(i)

print(len(ans_index))

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

ans_index = [0]
if h[1] >= h[0]:
    ans_index.append(1)
for i in range(2, n):
    if h[i] >= max(h[:i]):
        ans_index.append(i)
# print(ans_index)
print(len(ans_index))
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)

Buggy submission (verdict: Runtime Error):
import math
def comb(a, b):
  return math.factorial(a) / (math.factorial(a - b) * math.factorial(b))
print(comb(n + m, 2) - n * m)

Buggy submission (verdict: Runtime Error):
import math
def comb(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)

Buggy submission (verdict: Runtime Error):
  import math
  def comb(n, r):
  	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))
  base = comb(n+m, n * 2) + comb(n+m, m * 2)
  print(base)

Buggy submission (verdict: Runtime Error):
 import math
 def comb(n, r):
 	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 base = comb(n+m, n * 2) + comb(n+m, m * 2)
 print(base)
Problem p02723 (python)

Fixed submission:
ele =  input().strip()
if ele[2] == ele[3] and ele[4] == ele[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from heapq import heapify, heappush, heappop
X, Y, A, B, C = map(int, input().split())
ps = list(map(int, input().split()))
qs = list(map(int, input().split()))
rs = list(map(int, input().split()))


rs.sort(key=lambda x: -x)
hp = []
hq = []
for p in ps:
    heappush(hp, p)
    if len(hp) > X:
        heappop(hp)

for q in qs:
    heappush(hq, q)
    if len(hq) > Y:
        heappop(hq)

for r in rs:
    if len(hq) < Y:
        heappush(hq, r)
    elif len(hp) < X:
        heappush(hp, r)
    elif hp[0] < hq[0]:
        heappush(hp, r)
        heappop(hp)
    else:
        heappush(hq, r)
        heappop(hq)

print(sum(hq) + sum(hp))

Buggy submission (verdict: Runtime Error):
total, N = map(int, input().split())
nums = list(map(int, input().split()))
if N == 1:
    print(0)
else:
    ans = total - (total - nums[-1] + nums[0])
    prev = nums[0]
    for num in nums[1:]:
        ans = min(total-(num - prev), ans)
        prev = num
    print(ans)
Problem p02757 (python)

Fixed submission:
N, P = map(int, input().split())
num = input().strip()
ans = 0
if P == 2:
    for idx, nu in enumerate(num):
        if nu in '24680':
            ans += idx + 1
elif P == 5:
    for idx, nu in enumerate(num):
        if nu in '50':
            ans += idx + 1
else:
    nnum = [0] * N
    base = 1
    for i in range(N-1, -1, -1):
        nnum[i] = (int(num[i]) * base) % P
        base = (base * 10) % P
    for i in range(1, N):
        nnum[i] = (nnum[i] + nnum[i-1]) % P
    dp = [0] * P
    for i in range(N):
        if nnum[i] == 0:
            ans += 1 + dp[nnum[i]]
        else:
            ans += dp[nnum[i]]
        dp[nnum[i]] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())
num = input().strip()
dp = [0] * N
ans = 0
last = 0
for i in range(N):
    last = (10 * last + int(num[i])) % P
    if last == 0:
        ans += 1 + dp[last]
        dp[last] += 1
    else:
        ans += dp[last]
        dp[last] += 1
print(ans)
Problem p02723 (python)

Fixed submission:
# 1行、1変数を受け取るとき
s = list(input())

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

Buggy submission (verdict: Runtime Error):
import bisect
import copy

X, Y, A, B, C = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
clear = list(map(int, input().split()))

red.sort()
green.sort()
clear.sort()

red = red[-X:]
green = green[-Y:]

def ins(a, x):
    insert_index = bisect.bisect_left(a,x)
    a.insert(insert_index,x)
    return a[1:]

while clear[-1] > min(red[0], green[0]):
    red_tmp = ins(copy.copy(red), clear[-1])
    green_tmp = ins(copy.copy(green), clear[-1])
    
    if (sum(red_tmp) + sum(green)) >= (sum(red) + sum(green_tmp)):
        # 赤に追加
        red = red_tmp
    else:
        # 緑に追加
        green = green_tmp
        
    if len(clear) == 1:
        break
    else:
        clear = clear[:-1] #clearを消去

print(sum(red) + sum(green))

Buggy submission (verdict: Runtime Error):
import bisect

X, Y, A, B, C = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
clear = list(map(int, input().split()))

red.sort()
green.sort()
clear.sort()

red = red[-X:]
green = green[-Y:]

def ins(a, x):
    insert_index = bisect.bisect_left(a,x)
    a.insert(insert_index,x)
    return a[1:]

while clear[-1] > min(red[0], green[0]):
    red_tmp = ins(red.copy(), clear[-1])
    green_tmp = ins(green.copy(), clear[-1])
    
    if (sum(red_tmp) + sum(green)) >= (sum(red) + sum(green_tmp)):
        # 赤に追加
        red = red_tmp
    else:
        # 緑に追加
        green = green_tmp
        
    if len(clear) == 1:
        break
    else:
        clear = clear[:-1] #clearを消去

print(sum(red) + sum(green))
Problem p02753 (python)

Fixed submission:
str = input()
 
if (str[0] == str[1]) & (str[1] == str[2]):
  	print("No")
else:
  	print("Yes")

Buggy submission (verdict: Runtime Error):
flag = 1

if (S[0] == S[1]) & (S[1] == S[2]):
  	print("No")
else: 
	print("Yes")

Buggy submission (verdict: Runtime Error):
S
Problem p02754 (python)

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

ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

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

n = s[0]
blue = s[1]
red = s[2]

temp = ""

while len(temp) < n:
    temp += "b" * blue + "r" * red

print(temp[:n].count('b'))
Problem p02753 (python)

Fixed submission:
a=list(input())
if a[0]==a[1]==a[2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a=list(input())
if a[1]==a[2]==a[3]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a=list(input().split())
if a[1]==a[2]==a[3]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
if a[1]==a[2]==a[3]:
  print('No')
else:
  print('Yes')
Problem p02987 (python)

Fixed submission:
s = input()
if s[0] == s[1] == s[2] == s[3]:
  print('No')
else:
  if s[0] == s[1]:
    if s[2] == s[3]:
      print('Yes')
    else:
      print('No')
  elif s[0] == s[2]:
    if s[1] == s[3]:
      print('Yes')
    else:
      print('No')
  elif s[0] == s[3]:
    if s[1] == s[2]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if s[0] == s[1] == s[2] == s[3]:
  print('No')
  break
if s[0] == s[1]:
  if s[2] == s[3]:
    print('Yes')
  else:
    print('No')
elif s[0] == s[2]:
  if s[1] == s[3]:
    print('Yes')
  else:
    print('No')
elif s[0] == s[3]:
  if s[1] == s[2]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Problem p03011 (python)

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

Buggy submission (verdict: Runtime Error):
def fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int,input().split())
if m != 0:
  a = [int(input()) for i in range(m)]
  ans = fib(a[0])
  for j in range(1,m):
    if m == 1:
        continue
    elif a[j] == a[j-1]+1:
        ans = 0
    else:
        ans *= fib(a[j]-a[j-1]-1)
  ans *= fib(n-a[m-1])
else:
  ans = fib(n+1)
print(ans%1000000007)

Buggy submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
ans = float('inf')
for j in range(n):
  ans = min(ans,abs(sum(w[0:j])-sum(w[j:n])))
print(ans)
Problem p03012 (python)

Fixed submission:
n = int(input())
w = list(map(int,input().split()))
ans = float('inf')
for j in range(n):
  ans = min(ans,abs(sum(w[0:j])-sum(w[j:n])))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
w = [0]*n
for i in range(n):
  w[i] = map(int,input().split())
ans = float('inf')
for j in range(n):
  ans = min(ans,abs(sum(w[0:i]-w[i:n])))
print(ans)
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
x= n //(a+b) * a
r= n % (a+b)
x+=min(r,a)
print(x)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
x= n //(a+b)
print(x//a)
Problem p02723 (python)

Fixed submission:
string = list(input());
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Buggy submission (verdict: Runtime Error):
string = list(input());
if (string[2] == string[3] && string[4] == string[5]):
	print("Yes");
else:
    print("No");

Buggy submission (verdict: Runtime Error):
string = list(input());
if (string[2] == string[3] and string[4] == string[5]):
	print("Yes");
  else:
    print("No");

Buggy submission (verdict: Runtime Error):
string = list(input());
if (string[2] == string[3] && string[4] == string[5]):
	print("Yes");
  else:
    print("No");

Buggy submission (verdict: Runtime Error):
string = list(input("");
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");

Buggy submission (verdict: Runtime Error):
string = input().split();
if (string[2] == string[3]):
  if (string[4] == string[5]):
    print("Yes");
  else:
    print("No");
else:
  print("No");
Problem p02729 (python)

Fixed submission:
x = input().split()
n = int(x[0])
m = int(x[1])
if n == 0:
  print(int(m * (m -1) /2))
elif m == 0:
  print(int(n * (n - 1) / 2))
else:
  k = m * (m -1) /2 + n * (n - 1) / 2
  print(int(k))

Buggy submission (verdict: Runtime Error):
x = input().split
n = int(x[0])
m = int(x[1])
if n == 0:
  print(m * (m -1) /2)
elif m == 0:
  print(n * (n - 1) / 2)
else:
  k = m * (m -1) /2 + n * (n - 1) / 2
  print(k)
Problem p03075 (python)

Fixed submission:
li = []
for l in range(6):
    li.append(input())

t = 0
s = li.pop()
for i in li:
    for k in li:
        if int(k) - int(i) > int(s):
            t = 1
        elif int(i) - int(k) > int(s):
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
li = input("lkdfkgkfg").split()
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")

while True:
    s += 1

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

li = input().split("")
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")

while True:
    s += 1

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

li = input("lkdfkgkfg").split()
t = 0
s = int(li.pop(5))
for i in li:
    for k in li:
        if int(k) - int(i) >= s:
            t = 1

if t == 0:
    print("Yay!")
else:
    print(":(")
Problem p02835 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    A = list(map(int, input().split()))

    if sum(A) > 21:
        print("bust")
    else:
        print("win")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from https://github.com/kmyk/online-judge-tools

## Login
oj login URL

## DownLoad
oj dl URL

## test
oj test [-c COMMAND]
* Write the following in the first line of the python script
```python
#!/usr/bin/env python3
```
Problem p02831 (python)

Fixed submission:
import sys
import fractions
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())
print(int(A * B / fractions.gcd(A, B)))

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

A, B = map(int, input().split())
print(int(A * B / math.gcd(A, B)))
Problem p02912 (python)

Fixed submission:
from heapq import heappop,heappush,heapify
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))
a_minus = [-x for x in a]
heapify(a_minus)

pop = lambda: -heappop(a_minus)
push = lambda x: heappush(a_minus,-x)

for _ in range(m):
    x = pop()
    push(x//2)

print(-sum(a_minus))

Buggy submission (verdict: Runtime Error):
from heapq import heappop,heappush,heapify
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))
a_minus = [-x for x in a]
heapq.heapify(a_minus)

pop = lambda: -heappop(a_minus)
push = lambda x: heappush(a_minus,-x)

for _ in range(m):
    x = pop()
    push(x//2)

print(-sum(a_minus))
Problem p03013 (python)

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

MOD = 1000000007

dp = [0] * (N + 1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2, N + 1):
    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= MOD

print(dp[N])

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

MOD = 1000000007

dp = [0] * (N + 1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2, N + 1):
    print(f"i: {i}, dp: {dp}")

    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= MOD
print(f"i: {i}, dp: {dp}")

print(dp[N])
Problem p02723 (python)

Fixed submission:
s = list(input())

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

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

if s[3] == s[4] and s[5] == s[6]:
  print("Yes")
else:
  print("No")

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

if s[3] == s[4] and s[5] == s[6]:
  print("Yes")
else:
  print("No")
Problem p02771 (python)

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

if a==b and b==c or (a != b and b != c and c != a):
  ans = "No"
  
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
ans="Yes"

if a=b=c or (a != b and b != c):
  ans = "No"
  
print(ans)
Problem p02773 (python)

Fixed submission:
n=int(input())
arr=list(input() for _ in range(n))
dic={}

for i in range(n):
  if arr[i] not in dic:
    dic[arr[i]]=1
  else:
    dic[arr[i]]+=1
     
largest=max(dic.values())
ans=[]
for keys in dic.keys():
  if dic[keys]==largest:
    ans.append(keys)
ans=sorted(ans)

for words in ans:
  print(words)

Buggy submission (verdict: Runtime Error):
n=int(input())
arr=list(input() for _ in range(n)
dic={}

for i in range(n):
 if arr[i] not in dic:
  dic[arr[i]]=1
 else:
  dic[arr[i]]+=1
     
largest=max(dic.values())
ans=[]
for keys in dic.keys():
 if dic[keys]==largest:
  ans.append(keys)
ans=sorted(ans)

for words in ans:
 print(words)
Problem p02711 (python)

Fixed submission:

def main():
    # -*- coding: utf-8 -*-
    # 整数の入力
    # a = int(input())
    # スペース区切りの整数の入力
    # b, c = map(int, input().split())
    # b, c = map(int, input())

    # # 文字列の入力
    a = input()
    # 出力
    # print("{} {}".format(a+b+c, s))

    # mul = a

    if '7' in a:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    # main('123')
    main()

Buggy submission (verdict: Runtime Error):

def main():
    # -*- coding: utf-8 -*-
    # 整数の入力
    a = int(input())
    # スペース区切りの整数の入力
    # b, c = map(int, input().split())
    # b, c = map(int, input())

    # # 文字列の入力
    # a = input()
    # 出力
    # print("{} {}".format(a+b+c, s))

    # mul = a

    if '7' in a:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    # main('123')
    main()