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

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

def xorsum(m):
  if m==3:
    return 0
  if m==2:
    return 3
  if m==1:
    return 1
  if m==0:
    return 0
  if m==-1:
    return 0
  h=1
  while h<=m:
    h=h*2
  h=h//2
  return xorsum(m-h)^(((m-h+1)%2)*h)

print(xorsum(B)^xorsum(A-1))

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

def xorsum(m):
  if m==3:
    return 0
  if m==2:
    return 3
  if m==1:
    return 1
  if m==0:
    return 0
  h=1
  while h<=m:
    h=h*2
  h=h//2
  return xorsum(m-h)^(((m-h+1)%2)*h)

print(xorsum(B)^xorsum(A-1))

Buggy submission (verdict: Runtime Error):
import math

A, B = list(map(int, input().split()))

def xorsum(m):
  if m==3:
    return 0
  if m==2:
    return 3
  if m==1:
    return 1
  if m==0:
    return 0
  h = 2 ** math.floor(math.log2(m))
  return xorsum(m-h)^(((m-h+1)%2)*h)

print(xorsum(B)^xorsum(A-1))

Buggy submission (verdict: Runtime Error):

A, B = list(map(int, input().split()))

def xorsum(m):
  if m==3:
    return 0
  if m==2:
    return 3
  if m==1:
    return 1
  if m==0:
    return 0
  h = 2 ** math.floor(math.log2(m))
  return xorsum(m-h)^(((m-h+1)%2)*h)
print(xorsum(B)^xorsum(A-1))
Problem p03107 (python)

Fixed submission:
S = input()
s1 = S.count('1')
s0 = S.count('0')
print(2*min(s1, s0))

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

if len(S)==1:
  print(0)

print(min(S[::2].count(0), S[1::2].count(1)) + min(S[::2].count(1), S[1::2].count(0)))
Problem p03317 (python)

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

print((N-1)//(K-1) + bool((N-1)%(K-1)))

Buggy submission (verdict: Runtime Error):
import math
N, K = list(map(int, input().split()))
A = list(map(int, input().split())) #A[0]〜A[N-1]

m = min(A)
answer = N

for i in range(N-K+1): #A[i:i+K]〜A[N-K:N]
  if not k in A[i:i+K]:
    continue
  answer = min(answer,
              (1 + math.ceil(i/(K-1)) + math.ceil((N-K-i)/(K-1))))
print(answer)
Problem p03464 (python)

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

def winner_count(N, A=A):
    for a in A:
        N = a*(N//a)
    return N

def bisect_left(func, l, r, target):
    # n>=i ⇒ func(n) <= targetを満たす最小のi
    # l=1, r=sum(A)+2
    # func(l)<= target, target<=func(r)
    if l==r:
        return 0
    if l+1==r:
        if func(l)< target:
            return r
        else:
            return l
    c = (l+r)//2
    if target <= func(c):
        return bisect_left(func, l, c, target)
    else:
        return bisect_left(func, c, r, target)

def bisect_right(func, l,r, target):
    if l==r:
        return 0
    if l+1==r:
        if target < func(r):
            return l
        else:
            return r
    c = (l+r)//2
    if target < func(c):
        return bisect_right(func, l, c, target)
    else:
        return bisect_right(func, c, r, target)

_min = bisect_left(winner_count, 1, sum(A)+2, 2)
_max = bisect_right(winner_count, 1, sum(A)+2, 2)


if _min > _max:
	print(-1)
else:
	print(_min, _max)

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

def winner_count(N, A=A):
    for a in A:
        N = a*(N//a)
    return N

class lazy_eval_list(list):
    def __init__(self, func, a):
        super().__init__(a)
        self._func = func
        
    def __getitem__(self, key):
        return self._func(super().__getitem__(key))

lazy_winner_count_N = lazy_eval_list(winner_count, range(1,2+sum(A)))

import bisect
_min = bisect.bisect_left(lazy_winner_count_N, 2)
_max = bisect.bisect_right(lazy_winner_count_N, 2)-1

if _min > _max:
	print(-1)
else:
	print(_min, _max)

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

def winner_count(N, A=A):
    for a in A:
        N = a*(N//a)
    return N

class lazy_eval_list(list):
    def __init__(self, func, a):
        super().__init__(a)
        self._func = func
        
    def __getitem__(self, key):
        return self._func(super().__getitem__(key))

lazy_winner_count_N = lazy_eval_list(winner_count, range(2+sum(A)))

# x = [winner_count(i) for i in range(2+sum(A))]

import bisect
_min = bisect.bisect_left(lazy_winner_count_N, 2)
_max = bisect.bisect_right(lazy_winner_count_N, 2) -1

if _min > _max:
    print(-1)
    exit()

print(_min, _max)

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

def winner_count(N, A=A):
    for a in A:
        N = a*(N//a)
    return N

class lazy_eval_list(list):
    def __init__(self, func, a):
        super().__init__(a)
        self._func = func
        
    def __getitem__(self, key):
        return self._func(super().__getitem__(key))

lazy_winner_count_N = lazy_eval_list(winner_count, range(sum(A)))

import bisect
_min = bisect.bisect_left(lazy_winner_count_N, 2)
_max = bisect.bisect_right(lazy_winner_count_N, 2) -1

if _min > _max:
    print(-1)
    exit()

print(_min, _max)
Problem p02596 (python)

Fixed submission:
K = int(input())

n = 1
x = 7


if (K % 2 == 0)or(K % 5 == 0):
  print( -1 )
  exit( 0 )
#

while 1:
  if x % K == 0:
    print( n )
    break
  x = (x * 10 + 7) % K
  n += 1
#

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

n = 1
x = 7


if K % 2 == 0:
  peint( -1 )
  exit( 0 )
#

while 1:
  if x % K == 0:
    print( n )
    break
  x = (x % K) * 3 + 7
  n += 1
#

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

n = 1
x = 7


if K % 2 == 0:
  peint( -1 )
  exit( 0 )
#

while 1:
  if x % K == 0:
    print( n )
    break
  x = (x % K) * 10 + 7
  n += 1
#
Problem p02633 (python)

Fixed submission:
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360
#
print(K)

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

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360
#
print(k)
Problem p02685 (python)

Fixed submission:
#factorial
MOD = 998244353 

N, M, K = map(int, input().split()) 

modinv_t = [0, 1]
modfact_t = [1, 1]
modfactinv_t = [1, 1]
for i in range(2,N+1):
  modfact_t.append(modfact_t[-1] * i % MOD)
  modinv_t.append(modinv_t[MOD%i] * (MOD-(MOD//i)) % MOD)
  modfactinv_t.append(modfactinv_t[-1] * modinv_t[-1] % MOD)
# permutation
def nPr(n, r):
  return  modfact_t[n] * modfactinv_t[n-r] % MOD
# combination
def nCr(n, r):
  return  modfact_t[n] * modfactinv_t[n-r] * modfactinv_t[r] % MOD
#
def nHr(n, r):
  return  nCr(n+r-1,r)
#


t = M*pow(M-1,N-1,MOD)
for i in range(1,K+1):
  t += M*pow(M-1,N-1-i,MOD)*nCr((N-1),i)
  t %= MOD
#
t %= MOD
print(t)

Buggy submission (verdict: Runtime Error):
#factorial
mod = 998244353 
N = 1000000
modinv_t = [0, 1]
modfact_t = [1, 1]
modfactinv_t = [1, 1]
for i in range(2,N+1):
  modfact_t.append(modfact_t[-1] * i % MOD)
  modinv_t.append(modinv_t[MOD%i] * (MOD-(MOD//i)) % MOD)
  modfactinv_t.append(modfactinv_t[-1] * modinv_t[-1] % MOD)
# permutation
def nPr(n, r):
  return  modfact_t[n] * modfactinv_t[n-r] % MOD
# combination
def nCr(n, r):
  return  modfact_t[n] * modfactinv_t[n-r] * modfactinv_t[r] % MOD
#
def nHr(n, r):
  return  nCr(n+r-1,r)
#

N, M, K = map(int, input().split()) 

t = M*pow(M-1,N-1,mod)
for i in range(1,K+1):
  t += M*pow(M-1,N-1-i,mod)*nCr((N-1),i)
  t %= mod
#
print(t)
Problem p02695 (python)

Fixed submission:
import itertools
import numpy as np

N,M,Q = map(int, input().split())

a = range(1,M+1)
arr = np.asarray(list(itertools.combinations_with_replacement(a,N))) #重複組み合わせ
#print(arr)

sc = np.zeros(arr.shape[0],dtype=int)
#print(sc)

for i in range(Q):
  abcd = list(map(int, input().split()))
  f = (arr[:,abcd[1]-1]-arr[:,abcd[0]-1])==abcd[2]
  sc += abcd[3]*f 
#
print(sc.max())

Buggy submission (verdict: Runtime Error):
import itertools
import numpy as np

N,M,Q = map(int, input().split())

a = range(1,M+1)
arr = np.asarray(list(itertools.combinations_with_replacement(a,M))) #重複組み合わせ
#print(arr)

sc = np.zeros(arr.shape[0],dtype=int)
#print(sc)

for i in range(Q):
  abcd = list(map(int, input().split()))
  f = (arr[:,abcd[1]-1]-arr[:,abcd[0]-1])==abcd[2]
  sc += abcd[3]*f 
#
print(sc.max())

Buggy submission (verdict: Runtime Error):
import itertools
import numpy as np

N,M,Q = map(int, input().split())

a = range(1,M+1)
arr = np.asarray(list(itertools.combinations_with_replacement(a,M))) #重複組み合わせ
#print(arr)

sc = np.zeros(arr.shape[0],dtype=int)
#print(sc)

for i in range(Q):
  abcd = list(map(int, input().split()))
  f = (arr[:,abcd[1]]-arr[:,abcd[0]])==abcd[2]
  sc += abcd[3]*f 
#
print(sc.max())
Problem p03327 (python)

Fixed submission:
a=int(input())
if (a>999):
    print('ABD')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print((b-a-1)*(b-a)/2-a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print((b-a-1)*(b-a)//2-a)

Buggy submission (verdict: Runtime Error):
a=input()
if a>999:
    print('ABD')
else:
    print('ABC')
Problem p03055 (python)

Fixed submission:
from sys import stdin
def main():
    n = int(stdin.readline())
    e = [[] for _ in xrange(n)]
    for line in stdin:
        x, y = map(int, line.split())
        x -= 1
        y -= 1
        e[x].append(y)
        e[y].append(x)
    d = [None] * n
    st = []
    pu = st.append
    po = st.pop
    pu(0)
    d[0] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    y = -1
    for i, x in enumerate(d):
        if y < x:
            y = x
            j = i
    d = [None] * n
    pu(j)
    d[j] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    x = max(d)
    print 'Second' if x % 3 == 1 else 'First'
main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
def main():
    n = int(stdin.readline())
    e = [[] for _ in xrange(n)]
    for line in stdin:
        x, y = map(int, line.split())
        x -= 1
        y -= 1
        e[x].append(y)
        e[y].append(x)
    d = [None] * n
    st = []
    pu = st.append
    po = st.pop
    pu(0)
    d[0] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    y = 0
    for i, x in enumerate(d):
        if y < x:
            y = x
            j = i
    d = [None] * n
    pu(j)
    d[j] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    x = max(d)
    print 'Second' if x % 3 == 1 else 'First'
main()
Problem p03724 (python)

Fixed submission:
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    c = [0] * (n + 1)
    for x in dat:
        c[x] += 1
    f = 0
    for i in xrange(n + 1):
        if c[i] & 1:
            print "NO"
            return
    print "YES"
main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin().readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    c = [0] * (n + 1)
    for x in dat:
        c[x] += 1
    for i in xrange(n + 1):
        if c[i] == 1:
            print "NO"
            return
    print "YES"
main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin().readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    c = [0] * (n + 1)
    for x in dat:
        c[x] += 1
    for i in xrange(n + 1):
        if c[i] == 1:
            print "NO"
            return
    print "YES"
main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin().readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    c = [0] * (n + 1)
    for x in dat:
        c[x] += 1
    for i in xrange(n + 1):
        if c[i] == 1:
            print "NO"
            return
    print "YES"
main()
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin().readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 2 * m))
    c = [0] * (n + 1)
    for x in dat:
        c[x] += 1
    for i in xrange(n + 1):
        if c[i] == 1:
            print "NO"
            return
    print "YES"
main()
Problem p04037 (python)

Fixed submission:
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"

Buggy submission (verdict: Runtime Error):
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"
from sys import stdin
from collections import deque
n = int(stdin.readline())
a = map(int, stdin.readline().split())
a.sort()
f = 1
q = deque(a)
t = 1
while 1:
    if len(q) == 1:
        f = (q[0] - t + 1) & 1 ^ 1
        break
    if t == q[0] == q[-1]:
        f = len(q) & 1 ^ 1
        break
    x = q.pop()
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.append(x)
    while q and q[0] == t:
        q.popleft()
    t += 1
    if len(q) == 1 and (q[0] - t + 1) & 1:
        f = 1
        break
    if t == q[0] == q[-1] and len(q) & 1:
        f = 1
        break
    q.pop()
    if not q:
        f = 0
        break
print "First" if f else "Second"

Buggy submission (verdict: Runtime Error):
a = map(int, stdin.readline().split())
a.sort()
def f(j, t):
    global n
    for i in xrange(j, n):
        if a[i] != a[j]:
            break
    else:
        i = n
    x = (a[j] - t) & 1
    y = (i - j) & 1
    if i == n:
        return x ^ y
    elif (a[j] - t) == 1:
        return not f(i, a[j])
    else:
        return x ^ y ^ ((n - i) & 1)
print "First" if f(0, 0) else "Second"
Problem p02597 (python)

Fixed submission:
input()
a=input()
if 'W'not in a:print(0);exit()
a=a[a.index('W'):]
b=a.count('R')
print(b-a[:b].count('R'))

Buggy submission (verdict: Runtime Error):
input()
a=input()
a=a[a.index('W'):]
b=a.count('R')
print(b-a[:b].count('R'))
Problem p02970 (python)

Fixed submission:
a,b=map(int,input().split(' '))
print(-(-a//(1+2*b)))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print(0--a//b)
Problem p03075 (python)

Fixed submission:
a=int(input())
input()
input()
input()
e=int(input())
k=int(input())
print(':('if e-a>k else 'Yay!')

Buggy submission (verdict: Runtime Error):
a,*_,e,k=eval('int(input()),'*6);print(':('*(e-a>k)|'Yay!')
Problem p02633 (python)

Fixed submission:
X= int(input())
max_test = 100000
for i in range(1,max_test):
  if i * X % 360 == 0:
    break

print(i)

Buggy submission (verdict: Runtime Error):
max_test = 100000
for i in range(max_test):
  if i * X % 360 == 0:
    break

return I+1
Problem p02712 (python)

Fixed submission:
N=int(input())
k=0
for i in range(N):
  j=i+1
  if (j%3!=0)and(j%5!=0):
    k=k+j
print(k)

Buggy submission (verdict: Runtime Error):
N=int(input())
k=0
for i in range(N):
  j=i+1
  if (j%3!=0)&&(j%5!=0):
    k=k+j
print(k)

Buggy submission (verdict: Runtime Error):
N=int(input())
k=0
for i in range(N):
  if (i%3!=0)&&(i%5!=0):
    k=k+i
print(k)

Buggy submission (verdict: Runtime Error):
N=int(input())
k=0
for i in range(N):
  if ((i+1)%3!=0)&&((i+1)%5!=0):
    k=k+i
print(k)
Problem p02594 (python)

Fixed submission:
x = int(input())
# print(x)

if x >=30:
  print('Yes')
else:
  print('No')

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

if x >=30:
  print('Yes')
else:
  print('No')
Problem p02753 (python)

Fixed submission:
print("YNeos"[2-len(set(input()))::2])

Buggy submission (verdict: Runtime Error):
N=int(input());R,d,f,s,x=sorted(list(map(int,input().split()))for i in range(N))+[(2e9,0)],[0]*N+[1],[0]*N,1,N
for i in range(N-1,-1,-1):
	while R[x][0]<sum(R[i]):x=f[x]
	d[i]=s=(s+d[x])%998244353;f[i],x=x,i
print(s)
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split());B+=A;print(N//B*A+min(N%B,A))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split());print(N/B*A+min(N%B,A))
Problem p02757 (python)

Fixed submission:
N,P=map(int,input().split());S,a,i,j,c=list(map(int,input())),0,0,1,[1]+[0]*P
if 10%P:
	for v in S[::-1]:i=(i+v*j)%P;j=j*10%P;a+=c[i];c[i]+=1
else:
	for i,v in enumerate(S):
		if v%P<1:a+=i+1
print(a)

Buggy submission (verdict: Runtime Error):
N,P=map(int,input().split());S,a,i,j,c=[*map(int,input())],0,0,1,[1]+[0]*P
if 10%P:
	for v in S[::-1]:i=(i+v*j)%P;j=j*10%P;a+=c[i];c[i]+=1
else:
	for i,v in enumerate(S):
		if v%P<1:a+=i+1
print(a)
Problem p02777 (python)

Fixed submission:
(s,t),(a,b),u=input().split(),map(int,input().split()),input();print(a-(s==u),b-(t==u))

Buggy submission (verdict: Runtime Error):
(s,t),(a,b),u=input().split(),map(int,input().split()),input();print(a-(s==u),b-(t--u))
Problem p02779 (python)

Fixed submission:
input();A=list(map(int,input().split()));print("YNEOS"[len(A)>len(set(A))::2])

Buggy submission (verdict: Runtime Error):
input();a=list(map(int,input().split()));print("YNEOS"[len(A)>len(set(A))::2])
Problem p03326 (python)

Fixed submission:
n,m = map(int, input().split())
x = [tuple(map(int, input().split())) for _ in range(n)]
from itertools import *
res = 0
for a in product([-1, 1], [-1, 1], [-1, 1]):
  res = max(res, sum(sorted((sum(i*j for i,j in zip(a,t)) for t in x),reverse=True)[:m]))
print(res)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
x = [tuple(map(int, input().split())) for _ in range(n)]
from itertools import *
res = 0
for a in product([-1, 1], [-1, 1], [-1, 1]):
  res = max(res, sum(sorted(((sum(i*j for i,j in zip(a,t)) for t in x),reverse=True)[:m]))
print(res)
Problem p02629 (python)

Fixed submission:
n = int(input())
h = []
tmp = ["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"]
name = ""

while n != 0:
    mod = n % 26
    h.append(mod)
    n //= 26
    if mod == 0:
        n -= 1
h.reverse()
for i in h:
    name += tmp[i - 1]
print(name)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = []
na = ["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"]
name = ""

if n < 26:
    h.append(n)
else:
    while n >= 27:
        tmp = n%26
        n //= 26
        h.append(tmp)
        print(n)

    print(n)
    if n != 0:
        h.append(n)

h = h[::-1]
if h[-1] == 0:
    h.pop(-1)
    for i in h:
        name += na[-i]
else:
    for i in h:
        name += na[-i-1]

print(name)
Problem p02753 (python)

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

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split(' ')))
tmp = 0
count = 0
if a == 0:
    print(0)
while count < 10**100:
    n -= a
    tmp += a
    if n <= 0:
        print(tmp + n)
        break
    n -= b
    if n <= 0:
        print(tmp)
        break
Problem p02773 (python)

Fixed submission:
import collections

n = int(input())
s_list = []
for _ in range(n):
    s_list.append(input())
s_data = list(collections.Counter(s_list).most_common())
s_count = int(s_data[0][1])
s_index = 0
for s in s_data:
    if int(s[1]) == s_count:
        s_index += 1
    else:
        break
output = []
for i in range(s_index):
    output.append(s_data[i][0])
output.sort()
for s in output:
    print(s)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
s_list = []
for _ in range(n):
    s_list.append(input())
s_data = collections.Counter(s_list).most_common()
s_count = s_data[0][1]
s_index = 1
for s in s_data:
    if s[1] == s_count:
        s_index += 1
    else:
        break
    

for i in range(s_index):
    print(s_data[i][0])
Problem p02879 (python)

Fixed submission:
A, B = input().split(" ")
A = int(A)
B = int(B)
if A>=1 and A<=9 and B>=1 and B<=9:
    r = A*B
    print(r)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
b = False
i=1
while i<=9:
    j=1
    while j<=i:
        if j*i==n:
            print('Yes')
            b = True
            break
		j+=1
    if j*i>n:
        break
    i+=1
if b==False:
    print('No')

Buggy submission (verdict: Runtime Error):
    n = int(input())
    b = False
    i=1
    while i<=9:
        j=1
        while j<=i:
            if j*i==n:
                print('Yes')
                b = True
                break
            j+=1
        i+=1
    if b==False:
        print('No')

Buggy submission (verdict: Runtime Error):
    n = int(input())
    b = False
    i=1
    while i<=9:
        j=1
        while j<=9:
            if j*i==n:
                print('Yes')
                b = True
                break
            if j*i>n:
                break
            j+=1
        i+=1
    if b==False:
        print('No')
Problem p02595 (python)

Fixed submission:
import numpy as np
N, D = map(int, input().split())
cnt =0
for _ in range(N):
    a, b = map(int, input().split())
    if np.sqrt(a**2+b**2)<=D:
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
cnt =0
for _ in range(N):
    a, b = map(int, input().split())
    if np.sqrt(a**2+b**2)<=D:
        cnt+=1
print(cnt)
Problem p03242 (python)

Fixed submission:
n=list(input())
for i in range(len(n)):
    if n[i]=='9':
        n[i]=1
    if n[i]=='1':
        n[i]=9
for i in range(len(n)):
    print(n[i],end='')

Buggy submission (verdict: Runtime Error):
n=int(input())
N=list(map(int,input().split()))
even=[]
odd=[]
for i in range(len(N)):
    if i%2==0:
        even.append(N[i])
    if i%2==1:
        odd.append(N[i])
import collections
c = collections.Counter(even)
x=c.most_common()[0][0]
o=even.count(x)
d= collections.Counter(odd)
y=d.most_common()[0][0]
p=odd.count(y)
s=len(even)-even.count(x)
t=len(odd)-odd.count(y)
if x!=y and o==len(even) and p==len(odd):
    print(0)
elif x!=y:
    print(s+t)
elif x==y and o==len(even) and p==len(odd):
    print(n/2)
else:
    if o>p:
        y=d.most_common()[1][0]
        s=len(even)-even.count(x)
        t=len(odd)-odd.count(y)
        print(s+t)
    else:
        x=c.most_common()[1][0]
        s=len(even)-even.count(x)
        t=len(odd)-odd.count(y)
        print(s+t)