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

Fixed submission:
n, m = map(int, input().split())
l = [[int(i) for i in input().split()] for _ in [0]*n]
ans = 0

def  getmm(k):
  f = lambda x: (x[0] if k & 1 else -x[0]) + (x[1] if k & 2 else -x[1]) + (x[2] if k & 4 else -x[2])
  al = [f(e) for e in l]
  al.sort(reverse=True)
  return sum(al[:m])

for i in range(8):
  ans = max(ans, getmm(i))
print(ans)

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

def  g(k):
  a = [x[0]if k&1 else -x[0])+(x[1]if k&2 else -x[1])+(x[2]if k&4 else -x[2])  for x in l]
  a.sort(reverse=True)
  return sum(a[:m])
print(max([g(i) for i range(8)]))
Problem p03327 (python)

Fixed submission:
s = print('AB' + ('D' if int(input()) > 999 else 'C'))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = n > 1000 if 'D' else 'C'
print('AB' + s + str(n % 1000))
Problem p03803 (python)

Fixed submission:
a,b=map(int,input().split())
h=[0,14]+list(range(2,14))
if a==b:
  print("Draw")
else:
  print("Alice"if h[a]>h[b]else"Bob")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
h=[14]+list(range(2,14))
ifa==b:
  print("Draw")
else:
  print("Alice"if h[a]>h[b]else"Bob")
Problem p03804 (python)

Fixed submission:
n,  m = map(int, input().split())
np = [input() for _ in range(n)]
mp = [input() for _ in range(m)]
for i in range(n-m+1):
  for j in range(n-m+1):
    f = True
    for k in range(m):
      if np[i+k][j:j+m] != mp[k]:
        f = False
    if f:
      print("Yes")
      exit(0)
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,  m = map(int, input().split())
np = [input() for _ in range(n)]
mp = [input() for _ in range(m)]
for i in range(n-m-1):
  for  j in range(n-m-1):
    f = True
    for k in range(m):
      if np[i+k][j:j+m] != mp[i+k]:
        f = False
    if f:
      print("Yes")
      exit(0)
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,  m = map(int, input().split())
np = [input() for _ in range(n)]
mp = [input() for _ in range(m)]
for i in range(n-m):
  for  j in range(n-m):
    f = True
    for k in range(m):
      if np[i+k][j:j+m] != mp[i+k]:
        f = False
    if f:
      print("Yes")
      exit(0)
else:
  print("No")
Problem p02766 (python)

Fixed submission:
N,R=map(int,input().split())
for i in range(1000000000):
	if R**i>N:
		print(i)
		break

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k=map(int,input().split())
print(len(np.base_repr(n,base=k)))
Problem p02879 (python)

Fixed submission:
n,m=map(int,input().split())
print(n*m if max(n,m)<10 else -1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input.split())
print(n*m if max(n,m)<10 else -1)
Problem p02987 (python)

Fixed submission:
S=list(input())
print("Yes" if len(set(S))==2 else "No")

Buggy submission (verdict: Runtime Error):
from collections import Counter
s=list(input())
L_1=Counter(s).most_common()
print("Yes" if L_1[0][1]==L_1[1][1]==2 else "No")
Problem p03329 (python)

Fixed submission:
import bisect as bi

li6 = [6 ** i for i in range(7)]
li9 = [9 ** i for i in range(6)]

def s69(n):
    if n < 6:
        return n
    else:
        s6 = li6[bi.bisect(li6, n) - 1]
        s9 = li9[bi.bisect(li9, n) - 1]
        return min(n // s6 + s69(n % s6), 1 + s69(n - s9))


print(s69(int(input())))

Buggy submission (verdict: Runtime Error):
li6 = [6 ** i for i in range(7)]
li9 = [9 ** i for i in range(6)]

def s69(n):
    if n < 6:
        return n
    else:
        s6 = li6[bi.bisect(li6, n) - 1]
        s9 = li9[bi.bisect(li9, n) - 1]
        return min(n // s6 + s69(n % s6), 1 + s69(n - s9))


print(s69(int(input())))
Problem p03073 (python)

Fixed submission:
s = input()
l = len(s)

s1 = [ ((-1)**i + 1)//2 for i in range(l)]
s2 = [ ((-1)**(i+1) + 1)//2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (int(s[i]) - s1[i])**2
  n += (int(s[i]) - s2[i])**2

print(min([m,n]))

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

s1 = [ ((-1)^i + 1)/2 for i in range(l)]
s2 = [ ((-1)^(i+1) + 1)/2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (s[i] - s1[i])^2
  n += (s[i] - s2[i])^2

print(min(m,n))

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

s1 = [ ((-1)^i + 1)/2 for i in range(l)]
s2 = [ ((-1)^(i+1) + 1)/2 for i in range(l)]

m = 0
n = 0
for i in range(l):
  m += (s[i] - s1[i])^2
  n += (s[i] - s2[i])^2

print(min(m,n))
Problem p03075 (python)

Fixed submission:
a = []
for i in range(5):
	a.append(int(input()))
k = int(input())
 
for i in range(4):
  for j in range(i+1, 5): 
    if a[j] - a[i] > k :
      print(":(")
      exit()
 
print("Yay!")

Buggy submission (verdict: Runtime Error):
a = []
for i in range(5):
	a.append(int(input().split()))
k = int(input().split())

for i in range(4):
  if a[i+1] - a[i] > k :
    print(": (")
    exit()

print("Yay!")
Problem p02594 (python)

Fixed submission:
X = int(input())
if X>=30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
if X>=30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x = int(input)
if x>=30:
  print('Yes')
else:
  print('No')
Problem p02951 (python)

Fixed submission:
a, b, c = map(int, input().split(" "))
print(max(0, c - (a - b)))

Buggy submission (verdict: Runtime Error):
input()
vs=list(map(int, input().split(" ")))
k = 0
for i in range(0, len(vs)-1):
	if vs[i] - vs[i+1] >= 2:
		k = 100
		break
	if vs[i] - vs[i+1] == 1:
		k += 1
		if k >= 2:
			break
	elif vs[i+1] - vs[i] >= 1:
		k = 0
if k > 1:
	print("No")
else:
	print("Yes")
Problem p02935 (python)

Fixed submission:
N=int(input())
v=[int(x) for x in input().split()]
cnt=0
while cnt<N-1:
    v.sort()
    v[0]=(v[0]+v.pop(1))/2
    cnt+=1
print(v[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
v=int(input()).split()
V=v.sort()
cnt=0
while cnt<N-1:
    v[0]=(int(v[0])+int(v[cnt+1]))/2
    cnt+=1
print(v[0])
Problem p02723 (python)

Fixed submission:

s = input()

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

Buggy submission (verdict: Runtime Error):
import random
from bisect import bisect_left, bisect_right
from typing import List
import collections
import bisect
import itertools
import functools
from fractions import gcd
import heapq
from math import ceil, sqrt, floor

# import sys
# sys.setrecursionlimit(50000)
from collections import defaultdict, deque

import collections

s = input()

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

Fixed submission:

S = input()

if len(set(S)) == 1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
from sortedcontainers import SortedList, SortedDict

s = input()

print('YES' if len(set(s)) == 2 else 'NO')
Problem p02682 (python)

Fixed submission:
from sys import stdin
A, B, C, K = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
if K <= A:
    ans = K
elif K <= A+B:
    ans = A
else:
    ans = A-K+A+B
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A, B, C, K = [int(_) for _ in stdin.readline().rstrip().split()]
L = [1]*A+[0]*B+[-1]*C
print(sum(L[:K]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
A, B, C, K = [int(_) for _ in stdin.readline().rstrip().split()]
L = [1]*A+[0]*B+[-1]*C
print(L[:K])
Problem p02723 (python)

Fixed submission:
from sys import exit, stdin
S = stdin.readline().rstrip()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
from sys import exit, stdin
S = stdin.readline().rstrip()
if S[3] == S[4] and S[5] == S[6]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
from sys import exit, stdin
S = stdin.readline().rstrip().split()
if S[3] == S[4] and S[5] == S[6]:
  print('Yes')
else:
  print('No')
Problem p02785 (python)

Fixed submission:
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
H = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True)
print(sum(H[K:]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
H = sorted([int(_) for _ in stdin.readline().rstrip().split()], reverse=True)
if K >= N:
    print(0)
else:
    for i in range(K):
        H.pop(i)
    print(sum(H))
Problem p02897 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
print(((N+1)//2)/N)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
print(((N+1)//2/N)
Problem p02915 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
print(N**3)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = [int(_) for _ in stdin.readline().rstrip().split()]
print(N**3)
Problem p03013 (python)

Fixed submission:
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
dp = [1 for i in range(N+1)]
MOD = 1000000007
for _ in range(M):
  a = int(stdin.readline().rstrip())
  dp[a] = 0
for i in range(2, N+1):
    if dp[i] == 0:
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[N] % MOD)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
dp = [1 for i in range(N+1)]
MOD = 1000000007
for _ in range(M):
  a = int(stdin.readline().rstrip())
  dp[a] = 0
for i in range(2, n+1):
    if dp[i] == 0:
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[N] % MOD)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
dp = [1 for i in range(N+1)]
MOD = 1000000007
for _ in range(M):
  a = int(stdin.readline().rstrip())
  dp[a] = 0
for i in range(2, n+1):
    if dp[i] == 0:
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n] % MOD)
Problem p03042 (python)

Fixed submission:
from sys import stdin
S = stdin.readline().rstrip()
zen, kou = int(S[:2]), int(S[2:])
if 13 <= zen <= 99 and 1 <= kou <= 12:
    print('YYMM')
elif zen == 0 and 1 <= kou <= 12:
    print('YYMM')
elif 1 <= zen <= 12 and 13 <= kou <= 99:
    print('MMYY')
elif 1 <= zen <= 12 and kou == 0:
    print('MMYY')
elif 1 <= zen <= 12 and 1 <= kou <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
zen, kou = S[:2], S[2:]
if 1 <= zen <= 12:
  if 1 <= kou <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 1 <= kou <= 12:
    print('YYMM')
  else:
    print('NA')

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
zen, kou = S[:2], S[2:]
if 1 <= zen <= 12:
  if 1 <= kou <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 1 <= kou <= 12:
    print('YYMM')
  else:
    print('NA')

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
zen, kou = S[:2], S[2:]
if 1 <= zen <= 12:
  if 1 <= kou <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 1 <= kou <= 12:
    print('YYMM')
  else:
    print('NA')
Problem p03127 (python)

Fixed submission:
import fractions
from functools import reduce
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
print(gcd_list(A))

Buggy submission (verdict: Runtime Error):
n=int(input())
a_list=list(map(int, input().split()))
a_list.sort()
 
a,b=a_list[:2][0], a_list[:2][1]
while 1:
  if a>b:
    a=a-b
  elif a<b:
    b=b-a
  elif a==b:
    print(a)
    break
n=int(input())
a_list=list(map(int, input().split()))
a_list.sort()

a,b=a_list[:2][0], a_list[:2][1]
while 1:
  if a>b:
    a=a-b
  elif a<b:
    b=b-a
  elif a==b:
    print(a)
    break
Problem p03265 (python)

Fixed submission:
from sys import stdin
x1, y1, x2, y2 = [int(x) for x in stdin.readline().rstrip().split()]
print(x2-(y2-y1), y2+(x2-x1), x1-(y2-y1), y1+(x2-x1))

Buggy submission (verdict: Runtime Error):
from sys import stdin
x1, y1, x2, y2 = [int(x) for x in stdin.readline.rstrip().split()]
print(x2-(y2-y1), y2+(x2-x1), x1-(y2-y1), y1+(x2-x1))
Problem p03821 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]
ans = 0
for i in range(N-1, -1, -1):
  a, b = AB[i]
  ans += (b - (a + ans) % b) % b
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N)]
ans = 0
for i in range(N-1, -1, -1):
  	a, b = AB[i]
	ans += (b - (a + ans) % b) % b
print(ans)
Problem p02595 (python)

Fixed submission:
import math
n,d=map(int,input().split(' '))
cnt=0
while n>0:
    x,y=map(int,input().split(' '))
    res=math.sqrt(x**2+y**2)
    if res<=d:
        cnt+=1
    n=n-1
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
n,d=map(int,input().split(' '))
cnt=0
while n>0:
    x,y=map(int,input().split(' '))
    res=math.sqrt(x**2+y**2)
    if res<=d:
        cnt+=1
print(cnt)
Problem p02594 (python)

Fixed submission:
X = int(input())

if X >= 30:
  print("Yes")
else:
  print("No")

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

if X >= 30:
  print("Yes")
else:
  print("No")

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

if X >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
int(input())
-40 <= X <= 40
if X >= 30:
  print("Yes")
else:
  print("No")
Problem p02688 (python)

Fixed submission:
N,K = map(int,input().split())
res = [0] * N
for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for j in A:
        res[j-1] +=1
print(res.count(0))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
d = int(input())
A = [list(map(int,input().split())) for _ in range(N)]
print(N-d)
Problem p02689 (python)

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

d = []
for i in range(M):
    A,B = map(int,input().split())
    d.append((A-1,B-1))

cnt = 0
res = {}
for i in range(N):
    res[i] = False
flag = {}
for i in range(N):
    flag[i] = True

for i in d:
    A = i[0]
    B = i[1]
    #print("H[A] > H[B]",H[A],H[B])
    if H[A] > H[B] and flag[A] == True:
        res[A] = True
    else:
        flag[A] = False
        res[A] = False
    #print("H[A] < H[B]",H[A],H[B])
    if H[B] > H[A] and flag[B] == True:
        res[B] = True
    else:
        flag[B] = False
        res[B] = False
print(list(flag.values()).count(True))

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

d = []
for i in range(M):
    A,B = map(int,input().split())
    d.append((A-1,B-1))

cnt = 0
#res = {}
#for i in range(N):
#    res[i] = False
flag = {}
for i in range(N):
    flag[i] = True

for i in d:
    A = i[0]
    B = i[1]
    #print("H[A] > H[B]",H[A],H[B])
    if H[A] > H[B] and flag[A] == True:
        #res[A] = True
    else:
        flag[A] = False
        #res[A] = False
    #print("H[A] < H[B]",H[A],H[B])
    if H[B] > H[A] and flag[B] == True:
        #res[B] = True
    else:
        flag[B] = False
        #res[B] = False
print(list(flag.values()).count(True))
Problem p02785 (python)

Fixed submission:
def main():
    N,K = list(map(int,input().split()))
    H = list(map(int,input().split()))

    sorted_H = sorted(H,reverse=True)

    for i in range(K):
        if(i < len(sorted_H)):
            sorted_H[i] = 0

    '''
    for _ in range(K):
        if(len(H) > 0):
            maximum = max(H)
            H.remove(maximum)
            '''

    print(sum(sorted_H))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N,K = list(map(int,input().split()))
    H = list(map(int,input().split()))

    sorted_H = sorted(H,reverse=True)

    for i in range(K):
        sorted_H[i] = 0
    '''
    for _ in range(K):
        if(len(H) > 0):
            maximum = max(H)
            H.remove(maximum)
            '''

    print(sum(sorted_H))

if __name__ == "__main__":
    main()
Problem p03013 (python)

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

MOD = 1000000007

d = [0] * (N+1)
OK = [True]*(N+1)
d[0] = 1

for i in range(M):
    OK[a[i]] = False

#print(OK)

if(OK[1]):
    d[1] = 1
else:
    d[1] = 0

for i in range(2,N+1):
    if(OK[i-1]):
        d[i] += d[i-1]
    if(OK[i-2]):
        d[i] += d[i-2]
    d[i] %= MOD
    '''
    if(i in a):
        d[i] = 0
    else:
        d[i] = d[i-1] + d[i-2]
    d[i] %= MOD
    '''

print(d[-1])

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

MOD = 1000000007

d = [0] * (N+1)
NG = [FALSE]*N
d[0] = 1
if(1 in a):
    d[1] = 0
else:
    d[1] = 1

for i in range(M):
    NG[i] = True


for i in range(2,N+1):
    if(NG[i-1] == False):
        d[i] = d[i-1] + d[i-2]
        d[i] %= MOD
    '''
    if(i in a):
        d[i] = 0
    else:
        d[i] = d[i-1] + d[i-2]
    d[i] %= MOD
    '''

print(d[-1])
Problem p03137 (python)

Fixed submission:
import sys

N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))

if N >= M:
    print(0)
    sys.exit()
    
s= [0]*(M-1)
for i in range(M-1):
    s[i] = X[i+1] - X[i]
s.sort(reverse=True)
res = sum(s)
if M == 1:
    res = 0
else:
    for i in range(N-1):
        res -= s[i]
print(res)

Buggy submission (verdict: Runtime Error):
import sys

N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))

if N >= M:
    print(0)
    
s= [0]*(M-1)
for i in range(M-1):
    s[i] = X[i+1] - X[i]
s.sort(reverse=True)
res = sum(s)
if M == 1:
    res = 0
else:
    for i in range(N-1):
        res -= s[i]
print(res)

Buggy submission (verdict: Runtime Error):
import sys

N,M = map(int,input().split())
X = sorted(list(map(int,input().split())))

s= [0]*(M-1)
for i in range(M-1):
    s[i] = X[i+1] - X[i]
s.sort(reverse=True)
res = sum(s)
if M == 1:
    res = 0
else:
    for i in range(N-1):
        res -= s[i]
print(res)
Problem p03804 (python)

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

def comp(x,y):
    for i in range(M):
        for j in range(M):
            if A[x+i][y+j] != B[i][j]:
                return False
    return True
flag = False
for i in range(N-M+1):
    for j in range(N-M+1):
        if comp(i,j):
            flag = True
            break
if flag:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

def comp(x,y):
    for i in range(M):
        for j in range(M):
            if A[x+i][y+j] != B[i][j]:
                return False
    return True

for i in range(N-M+1):
    for j in range(N-M+1):
        if comp(i,j):
            flag = True
            break
if flag:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

cnt = 0
if A < B:
    print('No')
    sys.exit()
else:
    for i in range(N):
        for j in range(M):
            if B[j] in A[i]:
                cnt+=1
                flag = True
            else:
                cnt = 0
                flag = False
        	if cnt == M:
            	break
if flag:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

cnt = 0
if A < B:
    print('No')
    sys.exit()
else:
    for i in range(N):
        for j in range(M):
            if B[j] in A[i]:
                cnt+=1
                flag = True
            else:
                cnt = 0
                flag = False
        	if cnt == M:
            	break
if flag:
    print('Yes')
else:
    print('No')

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

cnt = 0
if A < B:
    print('No')
else:
    for i in range(N):
        for j in range(M):
            if B[j] in A[i]:
                cnt+=1
                flag = True
            else:
                cnt = 0
                flag = False
        if cnt == M:
            break
if flag:
    print('Yes')
else:
    print('No')

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

cnt = 0
if A < B:
    print('No')
else:
    for i in range(M):
        if B[i] in A[i]:
            cnt+=1
            flag = True
        else:
            cnt = 0
            flag = False
        if cnt == M:
            break
if flag:
    print('Yes')
else:
    print('No')
Problem p02771 (python)

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

tmp_dic = {}
for n in lis:
    if n not in tmp_dic:
        tmp_dic[n] = 1
    else:
        tmp_dic[n] += 1
        
if len(tmp_dic) == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = [input() for i in range(N)]

 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]
Problem p02773 (python)

Fixed submission:
import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

max_v = max(cnt_dic.values())

ans_lis = [k for k, v in cnt_dic.items() if v == max_v]

for s in sorted(ans_lis):
  print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = [input() for i in range(N)]

 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = []
[lis.append(input()) for i in range(N)]
 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

Buggy submission (verdict: Runtime Error):
N = int(input())
lis = []
[lis.append(input()) for i in range(N)]

tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]
Problem p02707 (python)

Fixed submission:
from collections import Counter

n = int(input())
s = map(int, input().split(" "))
data = Counter(s)
for i in range(1, n+1):
    print(data.get(i, 0))

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

n = int(input())
s = mapt(int, input().split(" "))
data = Counter(s)
for i in range(1, n+1):
    print(data.get(i, 0))
Problem p02771 (python)

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

print("Yes" if len(set({a,b,c})) == 2 else "No")

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

print("Yes" if len(set({a,b,c})) == 2 else "No")