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

Fixed submission:
from fractions import gcd
A,B = map(int,input().split())
print((A*B) // gcd(A,B))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
A,B = int(input().split())
print((A*B) // gcd(A,B))
Problem p03137 (python)

Fixed submission:
n,m = map(int,input().split())
x = list(map(int,input().split()))
t_3 = max(x) - min(x)
t = []
t_2 = 0
x.sort()
if m == 1:
    print(0)
    exit()

for i in range(m-1):
    t.append(x[i+1]-x[i])

t.sort(reverse=True)
pp = min(n-1,m-1)
for i in range(pp):
    t_2 += t[i]

print(t_3-t_2)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = list(map(int,input().split()))
t_3 = max(x) - min(x)
t = []
t_2 = 0
x.sort()
if m == 1:
    print(0)
    exit()

for i in range(m-1):
    t.append(x[i+1]-x[i])

t.sort(reverse=True)
for i in range(n-1):
    t_2 += t[i]

print(t_3-t_2)
Problem p02580 (python)

Fixed submission:
h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)

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

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))

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

h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))

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

h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))

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

h, w, m = map(int, input().split())

l = np.array([0]*(h*w))

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))
    l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] += 1
    l[(h_input-1)*w+w_input-1] -= 1

print(max(l))
Problem p02594 (python)

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

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

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

Fixed submission:
import fractions
a,b=map(int, input().split())
f=fractions.gcd(a,b)
f2=a*b//f
print(f2)

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int, input().split())
f=math.gcd(a,b)
f2=a*b//f
print(f2)
Problem p03073 (python)

Fixed submission:
S = input()

n = len(S)
cnt = 0

for i in range(n):
  if int(S[i])%2 == i%2:
    cnt += 1
    
print(min(cnt, n-cnt))

Buggy submission (verdict: Runtime Error):
zero_one = [0 if i%2==0 else 1 for i in range(len(S))]
one_zero = [0 if i%2==1 else 1 for i in range(len(S))]

count_zero_one = 0
count_one_zero = 0

for i in range(length):
  if int(S[i]) != zero_one[i]:
    count_zero_one += 1
  if int(S[i]) != one_zero[i]:
    count_one_zero += 1

if count_zero_one <= count_one_zero:
  print(count_zero_one)
else:
  print(count_one_zero)
Problem p02762 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**5)

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n 
        self.size = [1] * n
    
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
            
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] = self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1
                
n, m, k = map(int, input().split())
friends = [[] for _ in range(n)]
blocks = [[] for _ in range(n)]

for i in range(m):
    x, y = map(lambda x: int(x) - 1, input().split())
    friends[x].append(y)
    friends[y].append(x)

for i in range(k):
    x, y = map(lambda x: int(x) - 1, input().split())
    blocks[x].append(y)
    blocks[y].append(x)

uf = UnionFind(n)
for i in range(n):
    for f in friends[i]:
        uf.union(i, f)

# 自分を除くUnionFind木の大きさ
ans = [uf.size[uf.find(i)] - 1 for i in range(n)]
# 直接的な友達を引く
for i in range(n):
    ans[i] -= len(friends[i])

for i in range(n):
    for b in blocks[i]:
        if uf.same(i, b):
            ans[i] -= 1

print(*ans)

Buggy submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n 
        self.size = [1] * n
    
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
            
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] = self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1
                
n, m, k = map(int, input().split())
friends = [[] for _ in range(n)]
blocks = [[] for _ in range(n)]

for i in range(m):
    x, y = map(lambda x: int(x) - 1, input().split())
    friends[x].append(y)
    friends[y].append(x)

for i in range(k):
    x, y = map(lambda x: int(x) - 1, input().split())
    blocks[x].append(y)
    blocks[y].append(x)

uf = UnionFind(n)
for i in range(n):
    for f in friends[i]:
        uf.union(i, f)

# 自分を除くUnionFind木の大きさ
ans = [uf.size[uf.find(i)] - 1 for i in range(n)]
# 直接的な友達を引く
for i in range(n):
    ans[i] -= len(friends[i])

for i in range(n):
    for b in blocks[i]:
        if uf.same(i, b):
            ans[i] -= 1

print(*ans)
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
print(int(input() ** 2))

Buggy submission (verdict: Runtime Error):
print(int(input() ** 2)
Problem p02880 (python)

Fixed submission:
n = int(input())

flag = 'No'
for i in range(1,10):
    if n % i == 0:
        if n // i < 10:
            flag = 'Yes'
            break
        else:
            continue

print(flag)

Buggy submission (verdict: Runtime Error):

flag = 'No'
for i in range(2,10):
    if n % i == 0:
        if n // i < 10:
            flag = 'Yes'
            break
        else:
            continue
        
if n == 0:
    flag = 'No'

print(flag)
Problem p02881 (python)

Fixed submission:
import numpy as np
n = int(input())

factor_a = 0
for i in range(1, int(np.sqrt(n)) + 1):
    if n % i == 0:
       factor_a = i
       
factor_b = n // factor_a

#print(factor_a)
#print(num, factor_b)
print(factor_a - 1 + factor_b - 1)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())

factor_a = 0
for i in reversed(range(1, int(np.sqrt(n)))):
    if n % i == 0:
       factor_a = i
       break

factor_b = n // factor_a

print(factor_a - 1 + factor_b - 1)
Problem p03137 (python)

Fixed submission:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, M] = [long(input_raw[0]), long(input_raw[1])]
    input_raw = read_func().strip().split()
    X = []
    for i in range(M):
        X.append(int(input_raw[i]))

    if len(X) <= N:
        print 0
        return
    if N == 1:
        print max(X) - min(X)
        return

    X.sort()

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

    subX.sort(reverse = True)

    count = 0
    for i in range(N):
        if i == N - 1:
            count += X[M - 1] - X[subX[i - 1][1]]
        elif i != 0:
            count += X[subX[i][1] - 1] - X[subX[i - 1][1]]
        else:
            count += X[subX[i][1] - 1] - X[0]
    print count


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, M] = [long(input_raw[0]), long(input_raw[1])]
    input_raw = read_func().strip().split()
    X = []
    for i in range(M):
        X.append(int(input_raw[i]))

    if len(X) == 1:
        print 0
        return
    if N == 1:
        print max(X) - min(X)
        return

    X.sort()

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

    subX.sort(reverse = True)

    count = 0
    for i in range(N):
        if i == N - 1:
            count += X[M - 1] - X[subX[i - 1][1]]
        elif i != 0:
            count += X[subX[i][1] - 1] - X[subX[i - 1][1]]
        else:
            count += X[subX[i][1] - 1] - X[0]
    print count


if __name__ == '__main__':
    main()
Problem p02623 (python)

Fixed submission:
n,m,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A = [0]
B = [0]
for i in range(n):
    A.append(A[i] + a[i])
for i in range(m):
    B.append(B[i] + b[i])
ans = 0
for i in range(n+1):
    if A[i] > k:
        break
    while B[m] > k-A[i]:
        m -= 1
    ans = max(ans,i+m)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_num = 0
b_num = 0
while True:
    if a_num == len(a) and b_num == len(b):
        break
    elif b_num == len(b) and a[b_num] <= k and a_num < len(a):
        k -= a[a_num]
        a_num += 1
        continue
    elif a_num == len(a) and b[b_num] <= k and b_num < len(b):
        k -= b[b_num]
        b_num += 1
        continue
    elif a[a_num] <= k and a[a_num] <= b[b_num] and a_num < len(a):
        k -= a[a_num]
        a_num += 1
        continue
    elif b[b_num] <= k and b[b_num] < a[a_num] and b_num < len(b):
        k -= b[b_num]
        b_num += 1
        continue
    else:
        break
print(a_num + b_num)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_num = 0
b_num = 0
while True:
    if a_num == len(a) and b_num == len(b):
        break
    elif a[b_num] <= k and b_num == len(b) and a_num < len(a):
        k -= a[a_num]
        a_num += 1
        continue
    elif b[b_num] <= k and a_num == len(a) and b_num < len(b):
        k -= b[b_num]
        b_num += 1
        continue
    elif a[a_num] <= k and a[a_num] <= b[b_num] and a_num < len(a):
        k -= a[a_num]
        a_num += 1
        continue
    elif b[b_num] <= k and b[b_num] < a[a_num] and b_num < len(b):
        k -= b[b_num]
        b_num += 1
        continue
    else:
        break
print(a_num + b_num)
Problem p02625 (python)

Fixed submission:
def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 5*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N, M = map(int, input().split())
ans = 0
for i in range(N+1):
    ans += cmb(N,i,mod)*((-1)**i)*g1[M]*g2[M-i]*((g1[M-i]*g2[M-N])**2)
    ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1,n+1):
    ans += (n//i)*(n//i + 1)/2*i
print(int(ans))
Problem p02627 (python)

Fixed submission:
α = input()
if α in['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']:
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
#print(p)
s= sum(p[:k])
print(s)

Buggy submission (verdict: Runtime Error):
α = (input())
if α ='A'or'B'or'C'or'D'or'E'or'F'or'G'or'H'or'I'or'J'or'K'or'L'or'M'or'N'or'O'or'P'or'Q'or'R'or'S'or'T'or'U'or'V'or'W'or'X'or'Y'or'Z':
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
α = (input())
if α = A or B or C or D or E or F or G or H or I or J or K or L or M or N or O or P or Q or R or S or T or U or V or W or X or Y or Z:
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
α = (input())
if α = A or B or C or D or E or F or G or H or I or J or K or L or M or N or O or P or Q or R or S or T or U or V or W or X or Y or Z:
    print(A)
else:
    print(a)
Problem p02659 (python)

Fixed submission:
A,B = input().split()
A = int(A)
B = int(''.join(B.split('.')))
print(A*B//100)

Buggy submission (verdict: Runtime Error):
A,B = input().split()
A = int(A)
B = int(100*B)
print(A*B//100)
Problem p02835 (python)

Fixed submission:

a = input().split()
# print(a)

result = int(a[0]) + int(a[1]) + int(a[2])
if result >= 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):

a1 = int(input())
a2 = int(input())
a3 = int(input())


result = a1 + a2 + a3
if result >= 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):

a1 = int(input())
a2 = int(input())
a3 = int(input())


result = a1 + a2 + a3
if result >= 22:
    print("bust")
else:
    print("win")
Problem p02623 (python)

Fixed submission:
#!/usr/bin/python3
import bisect
# from collections import Counter, deque, OrderedDict, defaultdict
# from copy import copy, deepcopy # pythonのみ．copyは1次元，deepcopyは多次元．
# from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import statistics # Pythonのみ
# import string
import unittest
from io import StringIO
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():

    n, m, k = map(int, input().split())
    A = [0]+list(map(int, input().split()))
    B = [0]+list(map(int, input().split()))

    from itertools import accumulate

    AA = [0] + A
    BB = [0]+B
    # 累積和を格納したリスト．A[l:r]の総和はB[r] - B[l]
    AA = list(accumulate(A))
    BB = list(accumulate(B))

    ans = 0
    for i in range(n+1):
        s = AA[i]
        if s > k:
            break
        rem = k-s
        idx = bisect.bisect_right(BB, rem)-1
        ans = max(ans, i+idx)
    print(ans)


resolve()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# import bisect
# from collections import Counter, deque, OrderedDict, defaultdict
# from copy import copy, deepcopy # pythonのみ．copyは1次元，deepcopyは多次元．
# from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import statistics # Pythonのみ
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n,m,k=map(int,input().split())
    A=[0]+list(map(int,input().split()))
    B=[0]+list(map(int,input().split()))

    from itertools import accumulate
    
    
    AA = [0] + A
    BB=[0]+B
    # 累積和を格納したリスト．A[l:r]の総和はB[r] - B[l]
    AA = list(accumulate(A))
    BB=list(accumulate(B))

    ans=0
    v=0
    for i in range(n+1):
        for j in range(v,m+1):
            if AA[i]+BB[j]<=k:
                ans=max(ans,i+j)
            else:
                v=j-1
                break
    print(ans)

    
resolve()
Problem p02624 (python)

Fixed submission:
#!/usr/bin/python3
# import bisect
# from collections import Counter, deque, OrderedDict, defaultdict
# from copy import copy, deepcopy # pythonのみ．copyは1次元，deepcopyは多次元．
# from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import statistics # Pythonのみ
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    ll=[0]*(n+1)
    for i in range(1,n+1):
        for j in range(i,n+1,i):
            ll[j]+=1
    

    ans=0
    for i in range(1,n+1):
        ans+=i*ll[i]

    print(ans)
        

    
resolve()

Buggy submission (verdict: Runtime Error):
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4"""
        output = """23"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """100"""
        output = """26879"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """10000000"""
        output = """838627288460105"""
        self.assertIO(input, output)


if __name__ == "__main__":
    unittest.main()
Problem p02629 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    ans=''
    
    while n>0:
        n-=1
        a,b=divmod(n,26)
        n//=26
        ans+=chr(ord('a')+b)
    for i in ans[::-1]:
        print(i,end='')
    print()
        

    
resolve()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    
    while n>0:
        n-=1
        a,b=divmod(n,26)
        n//=26
        ans+=chr(ord('a')+b)
    for i in ans[::-1]:
        print(i,end='')
    print()
        

    
resolve()
Problem p02711 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        n=str(input())
        for i in n:
            if int(i)==7:
                return 'Yes'
        return 'No'
    print(main())

resolve()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    S=str(input())
    R=[]
    G=[]
    B=[]
    for i in range(N):
        if S[i]=='R':
            R.append(i)
        if S[i]=='G':
            G.append(i)
        if S[i]=='B':
            B.append(i)
    lr=len(R)
    lg=len(G)
    ans=lr*lg*(N-lr-lg)

    for i in R:
        for j in G:
            for k in B:
                L=sorted([i,j,k])
                if L[-1]-L[1]==L[1]-L[0]:
                    ans-=1
    print(ans)




resolve()
Problem p02766 (python)

Fixed submission:
# coding: utf-8
# Your code here!
# coding: utf-8
# Your code here!
N,K=map(int,input().split())

########関数部分##############
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
x10 = N
x2 = Base_10_to_n(x10, K)
print(len(list(x2)))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
ans=0
while N>0:
    N//M
    ans+=1
print(ans)
Problem p02771 (python)

Fixed submission:
# coding: utf-8
# Your code here!
s=set(map(int,input().split()))
if len(s)==2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=set(map(int,input().split()))
if len(s)==2:
    print('Yes'):
else:
    print('No')
Problem p02829 (python)

Fixed submission:
sol=[1,2,3]
ch_1=int(input())
ch_2=int(input())
sol.remove(ch_1)
sol.remove(ch_2)
print(sol[0])

Buggy submission (verdict: Runtime Error):
import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    A,B=map(int,input().split())
    val=A* B // math.gcd(A, B)
    print(val)

resolve()