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

Fixed submission:
from sys import stdin

K = int(stdin.readline().rstrip())
[A, B] = [int(x) for x in input().rstrip().split()]


flag=0
K_temp=K
while(True):
    if(K_temp>B):
        break
    if(K_temp>=A and K_temp<=B):
        flag=1
        break
    else:
        K_temp+=K

if flag==1:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
from sys import stdin
import sympy as sp

K = int(stdin.readline().rstrip())
[A, B] = [int(x) for x in input().rstrip().split()]


flag=0
K_temp=K
while(True):
    if(K_temp>B):
        break
    if(K_temp>=A and K_temp<=B):
        flag=1
        break
    else:
        K_temp+=K

if flag==1:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
from sys import stdin
import sympy as sp
K = int(stdin.readline().rstrip())
[A, B] = [int(x) for x in input().rstrip().split()]


flag=0
K_temp=K
while(True):
    if(K_temp>B):
        break
    if(K_temp>=A and K_temp<=B):
        flag=1
        break
    else:
        K_temp+=K

if flag==1:
    print("OK")
else:
    print("NG")
Problem p02699 (python)

Fixed submission:
from sys import stdin

[S, W] = map(int, stdin.readline().rstrip().split())

if W>= S:
    print("unsafe")
else:
    print("safe")

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


def merge_sort(lst, low, high):
    if low >= high:
        return
    mid = int((low+high)/2)
    merge_sort(lst, low, mid)
    merge_sort(lst, mid+1, high)
    for i in range(low, mid+1):
        tmp_array[i] = lst[i]
    j = high
    for i in range(mid+1, high+1):
        tmp_array[i] = lst[j]
        j -= 1
    i = low
    j = high
    for k in range(low, high+1):
        if tmp_array[i] <= tmp_array[j]:
            lst[k] = tmp_array[i]
            i += 1
        else:
            lst[k] = tmp_array[j]
            j -= 1


S = stdin.readline().rstrip()
N = len(S)
Sp = S

res_map = [0 for _ in range(N)]

aa_list2 = [1]
for i in range(1,N):
    aa_list2.append((aa_list2[i-1]*10)%2019)

tmp_array = [None for _ in range(N)]
res_map[N-1] = int(S[N-1])
index=1
for i in range(N-2,-1,-1):
    res_map[i] = (int(S[i])*aa_list2[index] + res_map[i+1])%2019
    index+=1
#merge_sort(res_map,0,N-1)
#res_map = list(np.sort(np.array(res_map)))
res_map.sort()
temp_num=res_map[0]
index=1
tot = 0

for i in range(1,N):
    if temp_num==res_map[i]:
        index+=1
        continue
    else:
        if temp_num==0:
            tot += int(index*(index+1)/2)
        elif index>1:
            tot += int(index*(index-1)/2)
            #tot += index/2
        index=1
        temp_num=res_map[i]





print(tot)
Problem p02597 (python)

Fixed submission:
from collections import Counter

_ = int(input())
s = input()
counter = Counter(s)
red = counter.get('R', 0)
white = counter.get('W', 0)

mismatches = 0
for i in range(red):
    if s[i] != 'R':
        mismatches += 1

print(mismatches)

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

_ = int(input())
s = input()
counter = Counter(s)
red = counter.get('R')
white = counter.get('W')

mismatches = 0
for i in range(red):
    if s[i] != 'R':
        mismatches += 1

print(mismatches)
Problem p02757 (python)

Fixed submission:
n, p = map(int, input().split())
s = input()


def solve1(s, p):
    v = 0
    pow10 = 1
    ans = 0
    cnt = [0] * p
    cnt[0] = 1

    for i in range(n - 1, -1, -1):
        v = (pow10 * int(s[i]) + v) % p
        pow10 = (pow10 * 10) % p
        ans += cnt[v]
        cnt[v] += 1
    return ans


def solve25(s, p):
    cnt = 0
    ans = 0
    for i in range(len(s) - 1, -1, -1):
        if int(s[i]) % p == 0:
            cnt += 1
        ans += cnt
    return ans



if p in (2,5):
    print(solve25(s, p))
else:
    print(solve1(s, p))

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


  def solve1(s, p):
      v = 0
      pow10 = 1
      ans = 0
      cnt = [0] * p
      cnt[0] = 1

      for i in range(n - 1, -1, -1):
          v = (pow10 * int(s[i]) + v) % p
          pow10 = (pow10 * 10) % p
          ans += cnt[v]
          cnt[v] += 1
      return ans


  def solve25(s, p):
      cnt = 0
      ans = 0
      for i in range(len(s) - 1, -1, -1):
          if int(s[i]) % p == 0:
              cnt += 1
          ans += cnt
      return ans



  if p in (2,5):
      print(solve25(s, p))
  else:
      print(solve1(s, p))
Problem p02571 (python)

Fixed submission:
s=input()
t=input()
sz=len(t)
ans=100000000000
c=0
if len(s)==sz:
    c=0
    for j in range(sz):
        if s[j]==t[j]:
            c+=1
        else:
            ans=min(ans,sz-c)
else:
    for i in range(0,len(s)-sz):
        k=s[i:i+sz]
        c=0
        for j in range(sz):
            if k[j]==t[j]:
                c+=1
            else:
                ans=min(ans,sz-c)
        # print(c)
ans=min(ans,sz-c)
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
sz=len(t)
ans=100000000000
for i in range(0,len(s)-sz):
    k=s[i:i+sz]
    c=0
    for j in range(sz):
        if k[j]==t[j]:
            c+=1
        else:
            ans=min(ans,sz-c)
    # print(c)
ans=min(ans,sz-c)
print(ans)
Problem p02623 (python)

Fixed submission:
n,m,k=map(int,input().split())
al=[int(i) for i in input().split()]
bl=[int(i) for i in input().split()]
aa,bb=[0],[0]
for i in range(n):
    aa.append(aa[i]+al[i])
for i in range(m):
    bb.append(bb[i]+bl[i])
ans=0
j=m
for i in range(n+1):
    if aa[i]>k:
        break
    while bb[j]>k-aa[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
al=[int(i) for i in input().split()]
bl=[int(i) for i in input().split()]
for i in range(1,n):
    al[i]+=al[i-1]
for i in range(1,m):
    bl[i]+=bl[i-1]
ans=0
j=m-1
for i in range(n):
    if al[i]>k:
        break
    while bl[j]>k-al[i]:
        j-=1
    ans=max(ans,i+j+2)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
al=[int(i) for i in input().split()]
bl=[int(i) for i in input().split()]
for i in range(1,n):
    al[i]+=al[i-1]
for i in range(1,m):
    bl[i]+=bl[i-1]
ans=0
j=m-1
for i in in range(n):
    if al[i]>k:
        break
    while bl[j]>al[i]-k:
        j-=1
    ans=max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
al=[int(i) for i in input().split()]
bl=[int(i) for i in input().split()]
for i in range(1,n):
    al[i]+=al[i-1]
for i in range(1,m):
    bl[i]+=bl[i-1]
ans=0
j=m
for i in in range(n):
    if al[i]>k:
        break
    while bl[j]>al[i]-k:
        j-=1
    ans=max(ans,i+j)
print(ans)
Problem p02623 (python)

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

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0]
d = [0]
for i in range(n):
    c.append(a[i]+c[i])
for i in range(m):
    d.append(b[i]+d[i])
e = 0
for i in range(n+1):
    if a[i] > k:
        break;
    while b[m] > k-a[i]:
        m -= 1
    e = max(e, i+m)
print(e)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0]
d = [0]
for i in range(n):
    c.append(a[i]+c[i])
for i in range)m:
    d.append(b[i]+d[i])
e = 0
for i in range(n+1):
    if a[i] > k:
        break;
    while b[m] > k-a[i]:
        m -= 1
    e = max(e, i+m)
print(e)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
for i in range(1, n):
    a[i] += a[i-1]
for i in range(1, m):
    b[i] += b[i-1]
for i in range(n):
    if a[i] > k:
        break;
    while a[i]+b[m-1] > k:
        m -= 1    
        if m == 0:
            break;
    c = max(c, i+m+1)
print(c)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
for i in range(1, n):
    a[i] += a[i-1]
for i in range(1, m):
    b[i] += b[i-1]
for i in range(n):
    if a[i] > k:
        break;
    while a[i]+b[m-1] > k:
        m -= 1
    c = max(c, i+m+1)
print(c)
Problem p02682 (python)

Fixed submission:
a, b, c, k = map(int, input().split())
if k <= a+b:
    print(min(a, k))
else:
    print(2*a+b-k)

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if k <= a+b:
    print(min(a, k)
else:
    print(2*a+b-k)
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
print(int(n*(n-1)/2+m*(m-1)/2))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
a = 0
for m in range(n):
    k = l.count(m+1)
    a += int(k*(k-1)/2)
for m in range(n):
    print(a-l.count(l[m])+1)
Problem p02753 (python)

Fixed submission:
s = input()
if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))
Problem p03053 (python)

Fixed submission:
h, w = map(int, input().split())
a = [input() for i in range(h)]
b = [-1]*h*w; c = []; d = 0
for i in range(h):
    for j in range(w):
        if a[i][j] == "#": b[i*w+j] = 0; c.append(i*w+j)
while len(c) < h*w:
    if c[d]//w != 0:
        if b[c[d]-w] == -1: b[c[d]-w] = b[c[d]]+1; c.append(c[d]-w)
    if c[d]%w != 0:
        if b[c[d]-1] == -1: b[c[d]-1] = b[c[d]]+1; c.append(c[d]-1)
    if c[d]%w != w-1:
        if b[c[d]+1] == -1: b[c[d]+1] = b[c[d]]+1; c.append(c[d]+1)
    if c[d]//w != h-1:
        if b[c[d]+w] == -1: b[c[d]+w] = b[c[d]]+1; c.append(c[d]+w)
    d += 1
print(max(b))

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [input() for i in range(h)]
b = [-1]*h*w; c = []; d = 0
for i in range(h):
    for j in range(w):
        if a[i][j] == "#": b[i*w+j] = 0; c.append(i*w+j)
while len(c) < h*w:
    if c[d]//w != 0:
        if b[c[d]-w] == -1: b[c[d]-w] = b[c[d]]+1; c.append(c[d]-w)
    if c[d]%w != 0:
        if b[c[d]-1] == -1: b[c[d]-1] = b[c[d]]+1; c.append(c[d]-1)
    if c[d]%w != w-1:
        if b[c[d]+1] == -1: b[c[d]+1] = b[c[d]]+1; c.append(c[d]+1)
    if c[d]//w != w-1:
        if b[c[d]+w] == -1: b[c[d]+w] = b[c[d]]+1; c.append(c[d]+w)
    d += 1
print(max(b))
Problem p02693 (python)

Fixed submission:
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
    if i % K == 0:
        print( 'OK' )
        quit()
else:
    print( 'NG' )

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1)
    if i % K == 0:
        print('OK')
        quit()
else : 
    print('NG')

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1)
    if i % K == 0:
        print('OK')
else : 
    print('NG')

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
    if i % K == 0:
        print( 'OK' )
        stop()
else:
    print( 'NG' )
Problem p02711 (python)

Fixed submission:
n = input()
for ni in n:
    if ni == '7' :
        print( 'Yes' )
        quit()
print( 'No' )

Buggy submission (verdict: Runtime Error):
n = input()
for ni in n:
    if ni == '7'
        print( 'Yes' )
        quit()
print( 'No' )

Buggy submission (verdict: Runtime Error):
N = int( input() )
if 7 in input :
    print( 'Yes' )
else :
    print( 'No' )
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):
S = input()
if S[3] == S[4] and S[5] == S[6] :
    print( 'Yes' )
else :
    print( 'No' )
Problem p02729 (python)

Fixed submission:
N,M = map( int,input().split() )
print(int( N*(N-1)/2 + M*(M-1)/2))

Buggy submission (verdict: Runtime Error):
N,M = map( int,input().split() )
print(int( N*(N-1)/2 + M*(M-1)/2)
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
maxi = 0
cnt = 0
for i in range( N ) :
    if H[i] >= maxi :
        cnt += 1
        maxi = H[i]
print( cnt )

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
maxi = 0
cnt = 0
for H[i] in range( N ) :
    if H[i] >= maxi :
        cnt += 1
        maxi = H[i]
print( cnt )
Problem p03073 (python)

Fixed submission:
S = input()
S1 = ''
S2 = ''
for i in range(len(S)):
    if i % 2 ==0 :
        S1 += '0'
        S2 += '1'
    else :
        S1 += '1'
        S2 += '0'
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S2[i]:
        min2 += 1 
print(min(min1,min2))

Buggy submission (verdict: Runtime Error):
S = input()
S1 = ''
S2 = ''
if i in range(len(S)):
    if i % 2 ==0 :
        S1 += '0'
        S2 += '1'
    else :
        S1 += '1'
        S2 += '0'
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S2[i]:
        min2 += 1 
print(min(min1,min2))

Buggy submission (verdict: Runtime Error):
S = input()
S1 = ''
S2 = ''
if i in range(len(S)):
    if i % 2 ==0 :
        S1 += '0'
        S2 += '1'
    else :
        S1 += '1'
        S2 += '0'
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min2 += 1 
print(min(min1,min2))

Buggy submission (verdict: Runtime Error):
S = list(input())
S1 = []
S2 = []
if i in range(len(S)):
    if i % 2 ==0 :
        S1.append('0')
        S2.append('1')
    else :
        S1.append('1')
        S2.append('0')
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min2 += 1 
print(min(min1,min2))

Buggy submission (verdict: Runtime Error):
S = list(input())
S1 = []
S2 = []
if i in range(len(S)):
    if i % 2 ==0 :
        S1.append('0')
        S2.append('0')
    else :
        S1.append('1')
        S2.append('2')
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min2 += 1 
print(min(min1,min2))
Problem p03723 (python)

Fixed submission:
A,B,C = list(map(int,input().split()))
if A == B == C and A%2 == 0 :
    print(-1)
elif A == B == C and A%2 == 1 :
    print(0)
else :
    cnt=0
    while A%2==B%2==C%2==0:
        total=A+B+C
        A=total//2-A//2
        B=total//2-B//2
        C=total//2-C//2
        cnt+=1
    print(cnt)

Buggy submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))
if A == B == C and A%2 == 0 :
    print(-1)
elif A == B == C and A%2 == 1 :
    print(0)
else :
    cnt=0
    while a%2==b%2==c%2==0:
        total=a+b+c
        a=total//2-a//2
        b=total//2-b//2
        c=total//2-c//2
        cnt+=1
    print(cnt)
Problem p02552 (python)

Fixed submission:
# AtCoder Beginner Contest 178
# A - Not

x=int(input())
if x==1:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):

print(input()^1)
Problem p02578 (python)

Fixed submission:
# AtCoder Beginner Contest 176
# C - Step

N=int(input())
Als=list(map(int,input().split()))

ans=0

for i in range (1,N):
    if Als[i]>=Als[i-1]:
        pass
    else :
        step=abs(Als[i]-Als[i-1])
        ans+=step
        Als[i]+=step
print(ans)

Buggy submission (verdict: Runtime Error):
# AtCoder Beginner Contest 176
# C - Step

N=int(input())
Als=list(map(int,input().split()))

ans=0

for i in range (1,N):
    if Als[i]>=max(Als[0:i]):
        pass
    else :
        ans+= max(Als[0:i])-Als[i]
        print(i,Als[0:i],max(Als[0:i])-Als[i])
print(ans)

Buggy submission (verdict: Runtime Error):
# AtCoder Beginner Contest 176
# C - Step

N=int(input())
Als=list(map(int,input().split()))

ans=0

for i in range (1,N):
    if Als[i]>=Als[i-1]:
        pass
    else :
        ans+= max(Als[0:i]-Als[i])
print(ans)
Problem p02623 (python)

Fixed submission:
import bisect


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

# print(K)
# print(a)
# print(b)
# N,M=3,4
# K=240
# a=[60, 90, 120]
# b=[80, 150, 80, 150]

ans=0

accum_a=[0]
for i in a:
    _a=accum_a[-1]+i
    if _a>K:
        break
    else:
        accum_a.append(_a)
accum_a.append(K)

accum_b=[0]
for i in b:
    accum_b.append(accum_b[-1]+i)

ans=0

for j in range (len(accum_a)-1):
    Kb=K-accum_a[j]
    bookB=bisect.bisect_right(accum_b,Kb)-1
    if j+bookB>ans:
        ans=j+bookB
    else:
        pass

print(ans)

Buggy submission (verdict: Runtime Error):
import bisect

N,M,K=map(int,inp().split())
list_a=list(map(int,inp().split()))
list_b=list(map(int,inp().split()))


totaltame_a=[0]
for a in list_a:
    temp_a=totaltame_a[-1]+a
    if temp_a>K:
        break
    else:
        totaltame_a.append(temp_a)


totaltime_b=[0]
for b in list_b:
    totaltime_b.append(totaltime_b[-1]+b)

ans=0

for i in range (len(totaltame_a)):
    Kb=K-totaltame_a[i]
    j=bisect.bisect_right(totaltime_b,Kb)-1
    if i+j>ans:
        ans=i+j
    else:
        pass

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()))

# print(K)
# print(a)
# print(b)

# K=2
# a=[60, 90, 120]
# b=[80, 150, 80, 150]

ans=0
inf=K*2

for i in range (N+M):
    if a==[]:
        a.append(inf)
    if b==[]:
        b.append(inf)
    A=a[0]
    B=b[0]
    if min(A,B)<=K:
        ans+=1
        K-=min(A,B)
        if A<B:
            a.pop(0)
        elif A>B:
            b.pop(0)
        else:
            if a[0]+a[1]<=b[0]+b[1]:
                a.pop(0)
            else:
                b.pop(0)
    else:
        break
print(ans)
Problem p02659 (python)

Fixed submission:
inputs= list(input().split())
A=int(inputs[0])
B=float(inputs[1])
B=int(B*100+0.5)
Ans=A*B//100
print(Ans)

Buggy submission (verdict: Runtime Error):
inputs= list(input().split())
A=int(inputs[0])
B=int(float(inputs[1]+0.5)*100)
Ans=A*B/100//1
print(int(Ans))

Buggy submission (verdict: Runtime Error):
inputs= list(input().split())
A=int(inputs[0])
B=int(inputs[1]+0.5)*100
Ans=A*B/100
print(Ans)

Buggy submission (verdict: Runtime Error):
inputs= list(input().split())
A=int(inputs[0])
B=int(float(inputs[1]+0.5)*100)
Ans=A*B/100
print(Ans)

Buggy submission (verdict: Runtime Error):
A,B= map(int,input().split())
Ans=A*B//1
print(Ans)
Problem p02701 (python)

Fixed submission:
N=int(input())
S=[]
for i in range(N):
    _=input()
    S.append(_)
Set=set(S)
print(len(Set))

Buggy submission (verdict: Runtime Error):
N=int(input())
S={}
for i in range(N):
    S.add(i)
print(len(S))
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):
S=input()
if S.index(2)==S.index(3) and S.index(4)==S.index(5):
  print('Yes')
else:
  print('No')
Problem p02725 (python)

Fixed submission:
K,N=map(int,input().split())
A=list(map(int,input().split()))
A.append(A[0]+K)

D=[]
for i in range(len(A)-1):
    d=A[i+1]-A[i]
    D.append(d)

print(K-max(D))

Buggy submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
A.append(A[0]+K)

D=[]
for i in range(len(A)-1):
    d=A[i+1]-A[i]
    D.append(D)

print(K-max(D))
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split())
full=N//(A+B)
rest=N%(A+B)
if rest <=A:
    print(full*A+rest)
    exit()
else:
    print(full*A+A)
    exit()

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
ab='u'*A+'r'*B
S=ab*10**100
S4ans=S[:N]
print(S4ans.count('u'))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
ab='u'*A+'r'*B
S=ab*1000
S4ans=S[:N]
print(S4ans.count('u'))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
ab='u'*A+'r'*B
S=ab*1000
S4ans=S[:N-1]
print(S4ans.count('u'))
Problem p02771 (python)

Fixed submission:
a,b,c=map(int,input().split())
S=[a,b,c]
s=set(S)
if len(s)==2:
  print('Yes')
else:
  print('No')

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

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

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

Fixed submission:
from collections import Counter

N=int(input())
S=[]

for _ in range(N):
    s=input()
    S.append(s)

c=Counter(S)
arr=c.most_common()

maxnum=arr[0][1]
ans=[]

for i in range(len(arr)):
    if arr[i][1]==maxnum:
        ans.append(arr[i][0])        
    else:
        break
FA=sorted(ans)
for j in FA:
    print(j)

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

N=int(input())
S=[]

for _ in range(N):
    s=input()
    S.append(s)

c=OrderedDict(sorted(S))

max_s_list= [kv[0] for kv in c.items() if kv[1]==max(c.values())]

for a in max_s_list:
    print(a)
Problem p02790 (python)

Fixed submission:
a,b=map(int,input().split())
if a<b:
    print(str(a)*b)
else:
    print((str(b)*a))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
A=str(a)*b
B=str(b)*a
print(min(int(A),int(B)))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
A=int(str(a)*b)
B=int(str(b)*a)
print(min(A,B))
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
print(math.gcd(A,B))
Problem p02847 (python)

Fixed submission:
S=input()
D=['SUN','MON','TUE','WED','THU','FRI','SAT']
Today=D.index(S)
print(7-Today)

Buggy submission (verdict: Runtime Error):
S=input()
D=[SUN,MON,TUE,WED,THU,FRI,SAT]
Today=D.index(S)
print(7-Today)
Problem p02879 (python)

Fixed submission:
A,B=map(int,input().split())
if A>9 or B>9:
  print(-1)
  exit()
print(A*B)

Buggy submission (verdict: Runtime Error):

#素因数分解
def prime_factorization(N):
    n=N
    a=2
    prime_factor=[]
    while a**2<=n:
        while n%a==0:
            prime_factor.append(a)
            n//=a
        a+=1
    if n>1:
        prime_factor.append(n)
    return prime_factor


N=int(input())

a=1
b=N//a
dis=abs(b-a)

for i in range(1,int(N**0.5)+1):
    if N%i==0:
        _a=i
        _b=N//i
        _dis=abs(_b-_a)
        if _dis<dis:
            a=_a
            b=_b
            dis=_dis

print(a-1+b-1)