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

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

def isOK(X):
    if X<=0:
        return False
    return sum([-a//X*-1-1 for a in A])<=K


ok=10**10
ng=-1
while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if isOK(mid):
        ok=mid
    else:
        ng=mid
print(ok)

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

def isOK(X):
    return sum([-a//X*-1-1 for a in A])<=K


ok=10**10
ng=-1
while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if isOK(mid):
        ok=mid
    else:
        ng=mid
print(ok)
Problem p02762 (python)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rnk = [0]*(n+1)

    def find_root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]
        
    def unite(self, x, y):
        x = self.find_root(x)
        y = self.find_root(y)
        if(x == y):
            return 
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
                
    def is_same_group(self, x, y):
        return self.find_root(x) == self.find_root(y)

    def count(self, x):
        return -self.root[self.find_root(x)]
    
f=lambda:map(int,input().split())
N,M,K=f()
uf=UnionFind(N)
bro=[0]*(N+1)
AB=[]
for _ in [0]*M:
    a,b=f()
    AB.append((a,b))
    uf.unite(a,b)
for a,b in AB:
    if uf.is_same_group(a,b):
        bro[a]+=1
        bro[b]+=1
for _ in [0]*K:
    c,d=f()
    if uf.is_same_group(c,d):
        bro[c]+=1
        bro[d]+=1
for i in range(1,N+1):
    print(uf.count(i)-1-bro[i])

Buggy submission (verdict: Runtime Error):
# Union Find

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rnk = [0]*(n+1)

    def find_root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]
        
    def unite(self, x, y):
        x = self.find_root(x)
        y = self.find_root(y)
        if(x == y):
            return 
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
                
    def is_same_group(self, x, y):
        return self.find_root(x) == self.find_root(y)

    def count(self, x):
        return -self.root[self.find_root(x)]
    
f=lambda:map(int,input().split())
N,M,K=f()
uf=UnionFind(N)
check=[[0]*(N+1) for _ in [0]*(N+1)]
bro=[0]*(N+1)
AB=[]
for _ in [0]*M:
    a,b=f()
    AB.append((a,b))
    check[b][a]==1
    uf.unite(a,b)
for a,b in AB:
    if uf.is_same_group(a,b):
        bro[a]+=1
        bro[b]+=1
for _ in [0]*K:
    c,d=f()
    check[d][c]==1
    if uf.is_same_group(c,d):
        bro[c]+=1
        bro[d]+=1
for i in range(1,N+1):
    print(uf.count(i)-1-bro[i])
Problem p02836 (python)

Fixed submission:
s=input();print(sum(s[i]!=s[len(s)-i-1] for i in range(len(s)))//2)

Buggy submission (verdict: Runtime Error):
s=input();n=len(s)-1;print(sum(s[i]!=s[n-i]for i in range(n+1))//2)s=input();n=len(s)-1;print(sum(s[i]!=s[n-i]for i in range(n+1))//2)
Problem p03326 (python)

Fixed submission:
# D Patisserie
import itertools as itl
#入力を取得
N,M=map(int,input().split())
check=M+10 if M+10<=N else N
xyz_list,x_list,y_list,z_list=[],[],[],[]
for i in range(N):
    xyz_list.append(input().split())
    
var_list=[x for x in itl.product([-1,1],repeat=3)]
sum_list=[]
for i in var_list:
    sort_list=[0,]*N
    for j in range(N):
        sort_list[j]=int(xyz_list[j][0])*i[0]+ int(xyz_list[j][1])*i[1]+ int(xyz_list[j][2])*i[2]
    sort_list.sort(reverse=True)
    sum_=0
    for j in range(M):
        sum_+=sort_list[j]
    sum_list.append(sum_)
    
sum_list.sort(reverse=True)
print(sum_list[0])

Buggy submission (verdict: Runtime Error):
# D Patisserie
#入力を取得
N,M=map(int,input().split())
check=M+10 if M+10<=N else N
xyz_list,x_list,y_list,z_list=[],[],[],[]
for i in range(N):
    xyz_list.append(input().split())
    
var_list=[x for x in itl.product([-1,1],repeat=3)]
sum_list=[]
for i in var_list:
    print(i,xyz_list)
    sort_list=[0,]*N
    for j in range(N):
        sort_list[j]=int(xyz_list[j][0])*i[0]+ int(xyz_list[j][1])*i[1]+ int(xyz_list[j][2])*i[2]
    sort_list.sort(reverse=True)
    sum_=0
    print(sort_list)
    for j in range(M):
        sum_+=sort_list[j]
    sum_list.append(sum_)
    
sum_list.sort(reverse=True)
print(sum_list[0])
Problem p03329 (python)

Fixed submission:
N=int(input())
numlist=[1, 6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049]
timeslis2=[0,]*(100001)
timeslis2[1]=1
numlist2=numlist[::-1]
def times2(N):
    if N!=0:
        if timeslis2[N]==0:
            mini2=[]
            i=0
            while i<=11 and len(mini2)<=2:
                if N-numlist2[i]>=0:
                    mini2.append(times2(N-numlist2[i]))
                #print(mini2,numlist2[i],i)
                i+=1
            mini2.sort()
            timeslis2[N]=mini2[0]+1
            return mini2[0]+1
        else:
            return timeslis2[N]
    return 0
print(times2(N))

Buggy submission (verdict: Runtime Error):
N=int(input())
numlist=[1, 6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049]
timeslis2=[0,]*(100000)
timeslis2[1]=1
numlist2=numlist[::-1]
def times2(N):
    if N!=0:
        if timeslis2[N]==0:
            mini2=[]
            i=0
            while i<=11 and len(mini2)<=2:
                if N-numlist2[i]>=0:
                    mini2.append(times2(N-numlist2[i]))
                #print(mini2,numlist2[i],i)
                i+=1
            mini2.sort()
            timeslis2[N]=mini2[0]+1
            return mini2[0]+1
        else:
            return timeslis2[N]
    return 0
print(times2(N))

Buggy submission (verdict: Runtime Error):
N=int(input())
timeslis2=[0,]*(100000)
timeslis2[1]=1
numlist2=numlist[::-1]
def times2(N):
    if N!=0:
        if timeslis2[N]==0:
            mini2=[]
            i=0
            while i<=11 and len(mini2)<=2:
                if N-numlist2[i]>=0:
                    mini2.append(times2(N-numlist2[i]))
                #print(mini2,numlist2[i],i)
                i+=1
            mini2.sort()
            timeslis2[N]=mini2[0]+1
            return mini2[0]+1
        else:
            return timeslis2[N]
    return 0
print(times2(N))
Problem p02597 (python)

Fixed submission:
n = int(input())
c = input()
rl = [ i for i,_ in enumerate(c) if _ == 'R' ]

cnt = 0
loc = 0
rid = -1
while True:
	try:
		if c[loc] == 'W':
			rloc = rl[rid]
			rid -= 1
			if rloc < loc:
				break
			else:
				cnt += 1
		loc += 1
		if loc == n:
			break
		#print(c,cnt)
	except:
		break
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = input()
rl = [ i for i,_ in enumerate(c) if _ == 'R' ]

cnt = 0
loc = 0
rid = -1
while True:
	if c[loc] == 'W':
		rloc = rl[rid]
		rid -= 1
		if rloc < loc:
			break
		else:
			cnt += 1
	loc += 1
	if loc == n:
		break
	#print(c,cnt)
print(cnt)
Problem p02623 (python)

Fixed submission:
na,nb,k = map(int, input().split())
ta = list(map(int, input().split()))
tb = list(map(int, input().split()))

a = [0]
for i in range(na):
  a.append( a[i] + ta[i] )
b = [0]
for i in range(nb):
  b.append( b[i] + tb[i] )

ans, j=0, nb
for i in range(na + 1):
  if a[i] > k:
    break
  while True:
    if a[i] + b[j] > k:
      j -= 1
    else:
      break
  ans = max(ans, i+j)
    
print(ans)

Buggy submission (verdict: Runtime Error):
na,nb,k = map(int, input().split())
ta = list(map(int, input().split()))
tb = list(map(int, input().split()))
 
def get_bcnt( usek,tb=tb ):
    t = 0
    cnt = 0
    try:
        while True:
            if t + tb[cnt] > usek:
                return cnt
            else:
                t += tb[cnt]
                cnt += 1
    except:
        return len(tb)
 
sumta = 0
readbook = [ i+1 + get_bcnt( k - sum( ta[:i] ) ) ) for i in range(na) if sum( ta[:i] ) <= k ]
readbook.append( get_bcnt(k) )

Buggy submission (verdict: Runtime Error):
na,nb,k = map(int, input().split())
ta = map(int, input().split())
tb = map(int, input().split())

def get_bcnt( usek,tb=tb ):
    t = 0
    cnt = 0
    try:
        while True:
            if t + tb[cnt] > usek:
                return cnt
            else:
                t += tb[cnt]
                cnt += 1
    except:
        return len(tb)

sumta = 0
readbook = [get_bcnt(k)] 
for i in range(na):
    sumta += ta[i]
    if sumta > k:
        break
    if ta[i] <= k:
        readbook.append( i+1 + get_bcnt( k - sumta ) )

print( max(readbook) )

Buggy submission (verdict: Runtime Error):
na,nb,k = map(int, input().split())
ta = map(int, input().split())
tb = map(int, input().split())

def get_bcnt( usek,tb=tb ):
    t = 0
    cnt = 0
    try:
        while True:
            if t + tb[cnt] > usek:
                return cnt
            else:
                t += tb[cnt]
                cnt += 1
    except:
        return len(tb)

sumta = 0
readbook = [get_bcnt(k)] #a0のとき
for i in range(na):
    sumta += ta[i]
    if sumta > k:
        break
    if ta[i] <= k:
        readbook.append( i+1 + get_bcnt( k - sumta ) )




print( max(readbook) )
Problem p02547 (python)

Fixed submission:
from sys import exit
N = int(input())
 
cnt = 0
for i in range(N):
    x,y = map(int,input().split())
    if cnt == 3:
        print("Yes")
        exit(0)
    if x == y:
        cnt += 1
    else:
        cnt = 0

if cnt == 3:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from sys import exit
N = int(input())
 
cnt = 0
for i in range(N):
    x,y = map(int,input().split())
    if cnt == 3:
        print("Yes")
        exit(0)
    if x == y:
        cnt += 1
    else:
        cnt = 0

if cnt == 3:
    print("Yes"
    
print("No")
Problem p02792 (python)

Fixed submission:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()

C = list2d(10, 10, 0)
for a in range(1, N+1):
    s = int(str(a)[0])
    t = int(str(a)[-1])
    C[s][t] += 1

ans = 0
for i in range(1, 10):
    for j in range(1, 10):
        ans += C[i][j] * C[j][i]
print(ans)

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

class BIT:
    """ Binary Indexed Tree """

    def __init__(self, n):
        # 0-indexed
        n += 1
        nv = 1
        while nv < n:
            nv *= 2
        self.size = nv
        self.tree = [0] * nv

    def sum(self, i):
        """ [0, i]を合計する """
        s = 0
        i += 1
        while i > 0:
            s += self.tree[i-1]
            i -= i & -i
        return s

    def add(self, i, x):
        """ 値の追加：添字i, 値x """
        i += 1
        while i <= self.size:
            self.tree[i-1] += x
            i += i & -i

    def get(self, l, r=None):
        """ 区間和の取得 [l, r) """
        # 引数が1つなら一点の値を取得
        if r is None: r = l + 1
        res = 0
        if r: res += self.sum(r-1)
        if l: res -= self.sum(l-1)
        return res

N = INT()
A = LIST()

bit = BIT(N)
ans = 0
for i in range(N):
    # 自分より左にある、自分より小さな数の個数
    if bit.sum(A[i]) == 0:
        ans += 1
    bit.add(A[i], 1)
print(ans)
Problem p03209 (python)

Fixed submission:
# -*- coding: utf-8 -*-

"""
解説参考
・必要な値を出してから再帰で場合分け
"""

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

# まず、それぞれのレベルについて全体の厚さとパティの枚数を求める
A = [1] * (N+1)
P = [1] * (N+1)
for i in range(1, N+1):
    A[i] = A[i-1] * 2 + 3
    P[i] = P[i-1] * 2 + 1

# レベルn、食べる厚さx
def dfs(n, x):
    # レベル0まで来て食べる厚さが残ってればパティ1枚
    if n == 0:
        if x >= 1:
            return 1
        else:
            return 0
    # ひとつ前の総数 + 左端バンズ = 真ん中のパティの手前まで
    if x <= A[n-1] + 1:
        # 前のレベルを調べる(食べる厚さは左端バンズを引く)
        return dfs(n-1, x-1)
    # 食べる厚さが真ん中のパティまでより多い
    else:
        # ひとつ前の総取り + 真ん中 + 前のレベルを調べる
        # (食べる厚さは前半のひとつ前の分と、左端バンズと真ん中パティを引く)
        # ※右端バンズを食べる場合でも、最終的にn == 0で1を返す時xの残数が1多いだけなので考慮しなくていい
        return P[n-1] + 1 + dfs(n-1, x-A[n-1]-2)

print(dfs(N, X))

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

"""
DP
"""

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

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

for i in range(1, N+1):
    dp[i] = 'B' + dp[i-1] + 'P' + dp[i-1] + 'B'

print(dp[N][:X].count('P'))

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

"""
再帰
"""

import sys

# 再帰呼び出しの回数制限(デフォルト1000)
sys.setrecursionlimit(10 ** 9)

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

def dfs(cur, L):
    if L == N:
        return cur
    return dfs('B' + cur + 'P' + cur + 'B', L + 1)

burger = dfs('P', 0)

print(burger[:X].count('P'))

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

"""
再帰
"""

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

def dfs(cur, L):
    if L == N:
        return cur
    return dfs('B' + cur + 'P' + cur + 'B', L + 1)

burger = dfs('P', 0)

print(burger[:X].count('P'))
Problem p03806 (python)

Fixed submission:
# -*- coding: utf-8 -*-

"""
参考：https://img.atcoder.jp/abc054/editorial.pdf
・3次元DP
・送るDP
"""
 
import sys
def input(): return sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
 
N, Ma, Mb = map(int, input().split())
l = [[0] * 3 for i in range(N)]
for i in range(N):
    l[i][0], l[i][1], l[i][2] = map(int, input().split())

# 不可能な組み合わせは0とは区別するのでINF初期化
dp = [[[INF] * 401  for i in range(401)] for i in range(N+1)]
dp[0][0][0] = 0
for i in range(N):
    for j in range(401):
        for k in range(401):
            # あり得ない組み合わせの時は送らない
            if dp[i][j][k] == INF: continue
            dp[i+1][j][k] = min(dp[i][j][k], dp[i+1][j][k])
            dp[i+1][j+l[i][0]][k+l[i][1]] = min(dp[i][j][k] + l[i][2], dp[i+1][j+l[i][0]][k+l[i][1]])

ans = INF
for j in range(1, 401):
    for k in range(1, 401):
        # j/k == Ma/Mb だと分母0が心配なので
        if j * Mb == k * Ma:
            ans = min(dp[N][j][k], ans)

if ans == INF:
    print(-1)
else:
    print(ans)

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

import sys
def input(): return sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, Ma, Mb = map(int, input().split())
l = [[0] * 3 for i in range(N)]
for i in range(N):
    l[i][0], l[i][1], l[i][2] = map(int, input().split())

memo = [[[INF] * 11  for i in range(11)] for i in range(N+1)]
def dfs(cur, a, b, c):
    if memo[cur][a][b] != INF:
        return memo[cur][a][b]
    if cur == N:
        return INF
    mn = INF
    if b != 0 and a / b == Ma / Mb:
        mn = min(c, mn)
    mn = min(dfs(cur+1, a+l[cur][0], b+l[cur][1], c+l[cur][2]), mn)
    mn = min(dfs(cur+1, a, b, c), mn)
    memo[cur][a][b] = mn
    return mn

ans = dfs(0, 0, 0, 0)
if ans == INF:
    print(-1)
else:
    print(ans)
Problem p02987 (python)

Fixed submission:
s=input()
h=set()
for i in range(0,len(s)):
	h.add(s[i])
if(len(h)==2):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
water=list(map(int,input().split()))
x=[]
temp=0
for i in range(1,n,2):
    temp+=water[i]
x.append(sum(water)-2*temp)
for j in range(n-1):
    x.append(2*water[j]-x[-1])
res=map(str,x)
print(' '.join(res))
Problem p02629 (python)

Fixed submission:
N = int(input())
ans=""
for i in range(1,99):
    if N <= 26**i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a')+ N % 26)
            #print(N, N % 26,ans)
            N //= 26
            
        break
    else:
        N -= 26**i
    #print(N)
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N =int(input())
S =N
count = 1
t = 13
for i in range(t):
    if S > 26**(t-i):
        a = S // 26**(t-i)
        S -= a*26**(t-i)
        count += 1


A=["*"]*count
#print(A)
for i in range(len(A)):
    a = N // 26**(len(A)-i-1) 
    if a ==27:
        A[i] = 26
        N-=26 * 26**(len(A)-i-1)
    else:
        A[i] = a
        N -= a * 26**(len(A)-i-1)
    
    
#print(A)
B =[]
for i in A:
    if i != "*":
        B.append(chr(96+i))
    
print("".join(B))
Problem p02629 (python)

Fixed submission:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

def main(N):
  A = [1]
  for _ in range(100):
    A.append(A[-1] * 26)
  for n in range(1, 100):
    if N > A[n]:
      N -= A[n]
      continue

    N -= 1
    ret = []
    
    for _ in range(n):
      N, r = divmod(N, 26)
      ret.append(r)
    break
  ret = [chr(ord('a') + x) for x in ret]
  return ''.join(reversed(ret))
 
print(main(N))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[26**i for i in range(1,10)]
ans=[]
for i in range(len(l)):
  if n-l[i]<=0:
    if n==l[i]:
      print('z'*(i+1))
      break
    else:
      for j in range(1,i+2):
        div,mod=divmod(n,26**(i+1-j))
        if div==0:
          ans.append(chr(ord('a')+mod-1))
        else:
          ans.append(chr(ord('a')+div-1))
          n=mod
      else:
        print(''.join(ans))
        exit()
  else:
    n-=l[i]
Problem p02659 (python)

Fixed submission:
a,b = input().split()

a = int(a)
b = int(float(b)*1000)
print(int(a*b)//1000)

Buggy submission (verdict: Runtime Error):
num = list(input().split())

A = int(num[0])
B = int(float(num[1])*100
print(A*B//100)
Problem p02699 (python)

Fixed submission:
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
S,W = map(int, readline().split())
 
 
if S > W:
  print('safe')
else:
  print('unsafe')

Buggy submission (verdict: Runtime Error):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S,W = map(int, readline())


if S > W:
  print('safe')
else:
  print('unsafe')
Problem p02707 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
ans=[0]*N

for i in range(N-1):
  ans[A[i]-1]+=1
 
for x in ans:
  print(x)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
ans=[0]*N
for _i in range(N):
  ans[A[i]-1]+=1

for x in ans:
  print(x)
Problem p02725 (python)

Fixed submission:
K,N=map(int,input().split())
A=list(map(int,input().split()))
temp=10**9
for i in range(N-1):
  temp=min(temp,A[i]+K-A[i+1])

print(min(A[-1]-A[0],temp))

Buggy submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
temp=0
for i in range(N):
  tmep+=min(A[i],K-A[i])
print(min(A[-1]-A[0],temp)
Problem p02829 (python)

Fixed submission:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A,B = map(int, read().split())
temp = [A,B]
 
for i in range(1,4):
  if i not in temp:
    print(i)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

temp = list(A,B)

for i in range(1,4):
  if i not in temp:
    print(i)
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
import math

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

Fixed submission:
a,b = map(int, input().split())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)
Problem p02881 (python)

Fixed submission:
import math
n = int(input())
l = [0]

for i in range(1, int(math.sqrt(n))+1):
  if n % i == 0:
    l[0] = i

print(l[0]+(n//l[0])-2)

Buggy submission (verdict: Runtime Error):
inport sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())

U = 10**6 + 100

div = np.arange(1, U, dtype=np.int64)
div = div[N%div==0]

div = np.union1d(div, N//div)

answer = (div + (N//div)).min() - 2
print(answer)
Problem p02933 (python)

Fixed submission:
a=int(input())
s=input()
if a >= 3200:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
a=int(input().split())
s=input().split()
if a >= 3200:
  print(s)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
if a >= 3200:
  print(s)
elif a < 3200:
  print('red')

Buggy submission (verdict: Runtime Error):
if a < 5000 && a >= 3200:
	print(s)
elif 2800 <= a && a < 3200:
	print('red')

Buggy submission (verdict: Runtime Error):
if a >= 3200:
	print(s)
else:
	print('red')

Buggy submission (verdict: Runtime Error):
if a < 3200:
	print(a)
else:
	print(s)
Problem p02970 (python)

Fixed submission:
n,d = map(int, input().split())
ans = 0
if n % (2 * d + 1) == 0:
  ans = n // (2 * d + 1)
else:
  ans = n // (2 * d + 1) + 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,d = map(int, input().split())
ans = 0
if n % (2d+1) == 0:
  ans = n//(2d+1)
else:
  ans = n//(2d+1) + 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,d = map(int, input().split())
ans = 0
if n % (2d+1) == 0:
  ans = n//(2d+1)
else:
  ans = n//(2d+1) + 1
Problem p02987 (python)

Fixed submission:
s = input()
dic = {}
for i in s:
  if i in dic:
    dic[i] += 1
  else:
    dic[i] = 1
if len(dic) == 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
dic = {}
for i in s:
  if i in dic:
    dic[i] = 1
  else:
    dic[i] += 1
if len(dic) == 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
dic = {}
for i in s:
  if i in dic:
    dic[i] = 1
  else:
    dic[i] += 1
Problem p03011 (python)

Fixed submission:
p = list(map(int, input().split()))
print(p[0] + p[1] + p[2] - max(p))

Buggy submission (verdict: Runtime Error):
p = list(map(int, input().split()))
print(p[0] + p[1] + [2] - max(p))