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

Fixed submission:
numbers = list(map(lambda x: int(x), input().split(" ")))

sq1 = numbers[0] * numbers[1]
sq2 = numbers[2] * numbers[3]

if sq1 > sq2:
    print(sq1)
else:
    print(sq2)

Buggy submission (verdict: Runtime Error):
s = raw_input("Please enter your numbers: ")
p= int(s[0]) 
q= int(s[1])
r= int(s[2])
s= int(s[3])
def area(a,b,c, d):
    if a*b > c*d:
        print a*b
    elif c*d > a*b:
        print c*d
    else:
        print a*b
x = area(p,q,r,s)
Problem p03827 (python)

Fixed submission:
n=int(input())
s=input()
x=0
maxx=0
for char in s:
  if char =='I':
    x+=1
  else:
    x-=1
  if maxx<x:
    maxx=x
print (maxx)

Buggy submission (verdict: Runtime Error):
n = raw_input()
S = raw_input()

N = int(n)
x=0 
y = str(x)
for i in range(0,N):
    if S[i] == "I":
        x = x+1 
        y = y + str(x)
    elif S[i]=="D":
        x = x - 1 
        y = y + str(x)
        
print max([int(c) for c in y])
Problem p03844 (python)

Fixed submission:
# python
my_input = str(input())
print(str(eval(my_input)))

Buggy submission (verdict: Runtime Error):

a=input()
res=0
if a[1]=="+":
    res=int(a[0])+int(a[2])
else:
    res=int(a[0])-int(a[2])
print(res)

Buggy submission (verdict: Runtime Error):
input = input().split(" ")
output = 0;
if input[1] == "+":
    output = input[0] + input[2]
else:
    output = input[0] - input[2]

print(output)

Buggy submission (verdict: Runtime Error):
input = raw_input().split(" ")
output = 0;
if input[1] == "+":
    output = input[0] + input[2]
else
    output = input[0] - input[2]

print(output)

Buggy submission (verdict: Runtime Error):
# Python
user_input = input("Input in format A op B")
input_sep = user_input.split()
input_a = input_sep[0]
operator = input_sep[1]
input_b = input_sep[2]

if operator is '+':
    print(int(input_a + input_b))
elif operator is '-':
    print(int(input_a - input_b))

Buggy submission (verdict: Runtime Error):
 line = input()
 b=line.split()
if b[1]=='+':
      print(int(b[0])+int(b[2]))
else:
      print(int(b[0])-int(b[2]))
Problem p03845 (python)

Fixed submission:
#!/usr/bin/env python
num_of_pro = raw_input()
problems = raw_input()
num_of_drinks = raw_input()
drinks_lines = []
count = 0 
while count < int(num_of_drinks):
	count += 1
	each_line = raw_input()
	drinks_lines.append(each_line)
for each_line in drinks_lines:
	problem_num = [int(each_num) for each_num in problems.split()]
	problem_num[int(each_line.split()[0]) -1] = int(each_line.split()[1])
	print sum(problem_num)

Buggy submission (verdict: Runtime Error):
num_of_pro = raw_input()
problems = raw_input()
num_of_drinks = raw_input()
drinks_lines = []
count = 0
while count < int(num_of_drinks):
count += 1
each_line = raw_input()
drinks_lines.append(each_line)
for each_line in drinks_lines:
problem_num = [int(each_num) for each_num in problems.split()]
problem_num[int(each_line.split()[0]) -1] = int(each_line.split()[1])
print sum(problem_num)
Problem p03860 (python)

Fixed submission:
str_words = raw_input()
after_split = ''.join([each_str[0] for each_str in str_words.split()])
print(after_split)

Buggy submission (verdict: Runtime Error):
content = input().split()
abbrev = [letter[0] for letter in content if letter[0].isupper() ]
abbrev = "".join(abbrev)
print(abbrev)
Problem p03861 (python)

Fixed submission:
a, b, x = [int(x) for x in input().split()]
print(b // x - (a - 1) // x)

Buggy submission (verdict: Runtime Error):
import sys
veces= list()
lines = sys.stdin.readlines()
for linea in lines:
    c = linea.split()
    c = list(map(int,c))
list(c)

rango = range(c[0],c[1]+1)
j = list(rango)
for l in range(len(j)):
  division = j[l]%c[2]
  if division == 0:
    veces.append(division)

print(int(len(veces)))
Problem p03947 (python)

Fixed submission:
ls=input().strip()
a=ls[0]
b=0
for i in ls[1:]:
     if i!=a:
          b+=1
          a=i
print(b)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
    ios::sync_with_stdio(false);
    cin >> s;
    cout << unique(s.begin(), s.end()) - s.begin() - 1 << endl;
    return 0;
}
Problem p03962 (python)

Fixed submission:
l = list(map(int, input().split()))
s = set(l)

print(len(s))

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split())
return len(set(a))

Buggy submission (verdict: Runtime Error):
    #!/usr/bin/env python3
    #
    # FILE: 2138-AtCoDeer_and_Paint_Cans.py
    #
    # @author: Arafat Hasan Jenin <opendoor.arafat[at]gmail[dot]com>
    #
    # LINK: https://abc046.contest.atcoder.jp/tasks/abc046_a?lang=en
    #
    # DATE CREATED: 17-06-18 00:09:52 (+06)
    # LAST MODIFIED: 17-06-18 00:19:32 (+06)
    #
    # VERDICT: Accepted
    #
    # DEVELOPMENT HISTORY:
    # Date         Version     Description
    # --------------------------------------------------------------------
    # 17-06-18     1.0         Deleted code is debugged code.
    #
    #               _/  _/_/_/_/  _/      _/  _/_/_/  _/      _/
    #              _/  _/        _/_/    _/    _/    _/_/    _/
    #             _/  _/_/_/    _/  _/  _/    _/    _/  _/  _/
    #      _/    _/  _/        _/    _/_/    _/    _/    _/_/
    #       _/_/    _/_/_/_/  _/      _/  _/_/_/  _/      _/
    #
    ##############################################################################
     
    print(len(set(map(int, input().split()))))
Problem p04019 (python)

Fixed submission:
def backhome():
	s = input()
	if (('N' in s) and ('S' in s)) and not (('W' in s) or ('E' in s)):
		print("Yes")
	elif (('W' in s) and ('E' in s)) and not (('N' in s) or ('S' in s)):
		print("Yes")
	elif (('W' in s) and ('E' in s)) and (('N' in s) and ('S' in s)):
		print("Yes")
	else:
		print("No")

backhome()

Buggy submission (verdict: Runtime Error):
def back_home():
    r=input()
    print(r)
    l = dict()
    for i in r:
        if i in l:
            l[i]=int(l[i])+1
        else:
            l[i]=1
    if (len(l)==1):
        return('NO')
    elif(len(l)==2):
        if (l['S']>0 and l['N']>0):
            return ("yes")
        elif(l['E']>0 and l['W']>0):
            return("yes")
        else:
            return("NO")
    elif(len(l)==3):
        return("NO")
    else:
        return("YES")
        
back_home()
Problem p04030 (python)

Fixed submission:
s = input()

r = ""
for c in s:
    if c == "B":
        r = r[:-1]
    else:
        r += c
print(r)

Buggy submission (verdict: Runtime Error):
s=input()
l=[]
for i in s:
    if i=='0':
        l.append('0')
    elif i=='1':
        l.append('1')
    elif i=='B':
        l.pop()
    
for i in l:
    print(i,end='')
Problem p04043 (python)

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

b = [0]*10

for i in arr:
    b[i-1] += 1

if (b[4]==2 and b[6]==1):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A=int(input("Enter A:"))
B=int(input("Enter B:"))
C=int(input("Enter C:"))
if((A==5 or B==5 or C==7) and(A==5 or C==5 or B==7) and(B==5 or C==5 or A==7)):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A=int(input("Enter A:"))
B=int(input("Enter B:"))
C=int(input("Enter C:"))
if ((A==5 or B==5 or C==7) and(A==5 or C==5 or B==7) and(B==5 or C==5 or A==7)):
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
a1=input()
a2=input()
a3=input()
a=[a1,a2,a3]
a.sort()
flag=0
for i in range(2):
    if a[i]!='5':
        flag=flag+1
if a[2]!='7':
    flag=flag+1
 
if flag==0:
    print("YES")
else:
    print("NO")
Problem p04044 (python)

Fixed submission:
n,l=map(int,input().split())
a=[]
for i in range(n):
	a.append(str(input()))

a.sort()
ans=''
for i in a:
	ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = int(input())
l=[]
for _ in range(0,N):
    s=input()
    l.append(s)
s=""
l.sort()

for i in l:
    s = s+i
print(s)

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
S = [input() for i in range(N)]
S.sort()
for s in S:
  print(s,end=“”)

Buggy submission (verdict: Runtime Error):
n,l=map(int, input())
s=[list(input()) for i in range(n)]
s.sort()
for i in s:
    print(i,end="")
print()
Problem p02658 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
cnt=1
for i in range(N):
    cnt*=A[i]
    if cnt>10**18:
        cnt=-1
        break
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
cnt=1
for i in range(N):
    cnt*=A[i]
pritn(cnt)
Problem p02660 (python)

Fixed submission:
N=int(input())

def divisor(x):
    div=[]
    for i in range(1,int(x**(1/2))+1):
        if x%i==0:
            div.append(i)
            if i!=x//i:
                div.append(x//i)
    return sorted(div)

def factorization(n):
    arr=[]
    temp=n
    for i in range(2,int(n**(1/2))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp//=i
            arr.append([i,cnt])
        
    if temp!=1:
        arr.append([temp,1])

    if arr==[]:
        arr.append([n,1])
    
    return arr

zt=[1]
ans=0
while N>1:
    for i in divisor(N):
        if i not in zt:  
            if len(factorization(i))==1:
                z=i
                zt.append(z)
                break
    if z==0:
        break
    N=N//z
    ans+=1
    z=0

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())

#約数出す
def divisor(x):
    div=[]
    for i in range(1,int(x**(1/2))+1):
        if x%i==0:
            div.append(i)
            if i!=x//i:
                div.append(x//i)
    return sorted(div)

#累乗数判定
def is_perfect_power(x):
    size=int(math.log2(x)+1)
    for b in range(2,size):
        a=int(math.pow(x,1/b))
        if a**b==x or (a+1**b==x): return a
    return 0
    

A=divisor(N)
z=[]
for i in range(len(A)):
    if len(divisor(A[i]))==2:
        z.append(A[i])
    else:
        x=is_perfect_power(A[i])
        if x!=0:
            if len(divisor(x))==2:
                z.append(A[i])
z=sorted(z)
cnt=0
for i in range(N):
    if N>=z[i]:
        if N%z[i]==0:
            N=N//z[i]
            cnt+=1
    else:
        break
print(cnt)
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
y=2*x/(a**2)-b
z=2*x/(a*b)
phai=0
ans=90
if x==b*a**2:
   ans=0
else:
    if z>a:
        phai=math.atan(a/(b-y))
        phai=math.degrees(phai)
        ans-=phai
    else:
        phai=math.atan(z/b)
        phai=math.degrees(phai)
        ans-=phai
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
y=2*x/(a**2)-b
z=2*x/(a*b)
phai=0
ans=90
if z>a:
    phai=math.atan(a/(b-y))
    phai=math.degrees(phai)
    ans-=phai
else:
    phai=math.atan(z/b)
    phai=math.degrees(phai)
    ans-=phai
print(ans)
Problem p02947 (python)

Fixed submission:
N=int(input())
P=[]
for i in range(N):
    s=input()
    s=sorted(s)
    P.append(s)

P=sorted(P)
last=P[0]
cnt=0
ans=0
for i in range(1,N):
    if P[i]==last:
        cnt+=1
        ans+=cnt
    else:
        last=P[i]
        cnt=0
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A={}
ans=0
for i in range(N):
    s=input()
    s=sorted(s)
    if A.get(s,"Not")=="Not":
        A[s]=1
    else:
        ans+=A[s]
        A[s]+=1
print(ans)
Problem p02995 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
gcdc=[]
gcdd=[]
for i in range(1,int(c**(1/2))+1):
  if c%i==0:
    gcdc.append(i)
    if i!=c//i:
      gcdc.append(c//i)
for i in range(1,int(d**(1/2))+1):
  if d%i==0:
    gcdd.append(i)
    if i!=d//i:
      gcdd.append(d//i)
E=[]
for i in range(len(gcdc)):
  if gcdc[i] in gcdd:
    E.append(gcdc[i])
e=max(E)
f=c*d//e
if a%c==0:
  g=b//c-a//c+1
else:
  g=b//c-a//c
if a%d==0:
  h=b//d-a//d+1
else:
  h=b//d-a//d
if a%f==0:
  i=b//f-a//f+1
else:
  i=b//f-a//f
print(b-a+1-g-h+i)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
gcdc=[]
gcdd=[]
for i in range(1,int(c**(1/2))+1):
  if c%i==0:
    gcdc.append(i)
    if i!=c//i:
      gcdc.append(c//i)
for i in range(1,int(d**(1/2))+1):
  if d%i==0:
    gcdd.append(i)
    if i!=d//i:
      gcdd.append(d//i)
E=[]
for i in range(len(gcdc)):
  if gcdc[i] in gcdd:
    E.append(gcdc[i])
e=1
for i in range(len(E)):
  e*=E[i]
f=c*d//e
g=0
h=0
i=0
if a%c==0:
  g=b//c-a//c+1
else:
  g=b//c-a//c
if a%d==0:
  h=b//d-a//d+1
else:
  h=b//d-a//d
if a%f==0:
  i=b//f-a//f+1
else:
  i=b//f-a//f
print(b-a+1-g-h+i)
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=1
D=0
for i in range(n):
  D=D+L[i]
  if D<=x:
    count+=1
  else:
    break
print(count)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=1
D=0
for i in range(n+1):
  D=D+L[i]
  if D<=x:
    count+=1
  else:
    break
print(count)
Problem p03086 (python)

Fixed submission:
s=input()
b=[]
count=0
for i in range(len(s)):
  if s[i] in "ATCG":
    count+=1
  else:
    b.append(count)
    count=0
b.append(count)
print(max(b))

Buggy submission (verdict: Runtime Error):
s=input()
b=[]
count=0
for i in range(len(s)):
  if s[i] in "ATCG":
    count+=1
  else:
    b.append(count)
    count=0
print(max(b))
Problem p03103 (python)

Fixed submission:
n,m=map(int,input().split())
AB=[]
for i in range(n):
  a,b=map(int,input().split())
  AB.append([a,b])
AB=sorted(AB)
i=0
amount=0
cost=0
while True:
  if amount+AB[i][1]<m:
    amount+=AB[i][1]
    cost+=AB[i][0]*AB[i][1]
    i+=1
  else:
    cost+=(m-amount)*AB[i][0]
    print(cost)
    break

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
AB=[]
for i in range(n):
  a,b=map(int,input().split())
  AB.append([a,b])
AB=sorted(AB)
i=0
amount=0
cost=0
while True:
  if amount+AB[i][1]<=m:
    amount+=AB[i][1]
    cost+=AB[i][0]*AB[i][1]
    i+=1
  else:
    cost+=(m-amount)*AB[i][0]
    print(cost)
    break
Problem p03352 (python)

Fixed submission:
x=int(input())
if x==1:
  print(1)
else:
  beki=[]
  for b in range(1,x+1):
    for p in range(2,x+1):
      if b**p<=x:
        beki.append(b**p)
      else:
        break
  print(max(beki))

Buggy submission (verdict: Runtime Error):
x=int(input())
beki=[]
for b in range(1,x+1):
  for p in range(2,x+1):
    if b**p<=x:
      beki.append(b**p)
    else:
      break
print(max(beki))
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
A=[]
if k>=b-a:
  for i in range(b-a+1):
    print(a+i)
else:
  for i in range(k):
    A.append(a+i)
    if a+i!=b-i:
      A.append(b-i)
  for i in range(len(A)):
    print(sorted(A)[i])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=[int(i) for i in range(a,b+1)]
for i in range(k):
  print(sorted(l)[i])
for i in range(k):
  print(sorted(l)[-k:][i])
Problem p03393 (python)

Fixed submission:
S=list(input())
m=list('abcdefghijklmnopqrstuvwxyz')[::-1]

if len(S)<26:
    for i in m[::-1]:
        if i not in S:
            S.append(i)
            break
    print(''.join(S))
else:
    x=S[-1]
    for i in range(25)[::-1]:
        if x>S[i]:
            y=m.index(S[i])
            S=S[:i]
            for j in range(y)[::-1]:
                if m[j] not in S:
                    S.append(m[j])
                    break
            break
        else:
            x=S[i]
        
        if i==0:
            print(-1)
            exit()
    print(''.join(S))

Buggy submission (verdict: Runtime Error):
S=list(input())
m=list('abcdefghijklmnopqrstuvwxyz')[::-1]

if len(S)<26:
  for i in m[::-1]
        if i not in S:
            S.append(i)
            break
    print(''.join(S))
else:
    x=S[-1]
    for i in range(24,-1,-1):
        if x>S[i]:
            y=m.index(S[i])
            S=S[:i]
            for j in range(y-1,-1,-1):
                if m[j] not in S:
                    S.append(m[j])
                    break
            break
        else:
            x=S[i]
        
        if i==0:
            print(-1)
            exit()
    print(''.join(S))
Problem p03695 (python)

Fixed submission:
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
if min==0:min=1
max=len(memo)+count
#if max>8: max=8
print(min,max)

Buggy submission (verdict: Runtime Error):
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
if min=0:min=1
max=len(memo)+count
if max>8: max=8
print(min,max)
Problem p03737 (python)

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

a=a[0].upper()
b=b[0].upper()
c=c[0].upper()

print(a+b+c)

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

a=a[0].upper()
b=b[0].upper()
c=c[0].upper()

print(a+b+c)
Problem p03747 (python)

Fixed submission:

# アリ１からNまでの前後関係は不変。つまり、アリ１からNまでの順番は保たれる。
# アリの最終座標の昇順リストを用意して、アリ１からNに対応させればよい。

n,l,t=map(int,input().split())
x=[]
w=[]
ans=[]

crash=0
for i in range(n):
    xx,ww=map(int,input().split())
    x.append(xx); w.append(ww)
    if w[i]==1: anss=(x[i]+t)%l
    else: anss=(x[i]-t+l)%l
    ans.append(anss)
    if i!=0 and w[i] != w[0]:
        if w[0] == 1: crash += (t-((x[i]-x[0])/2)) // (l/2) + 1
        else: crash += (t-(l-(x[i]-x[0]))/2) // (l/2) + 1

# あり１の現在のゼッケン番号num0
if w[0]==1: num0 =int(crash)%n
else: num0 =int(-crash)%n
# あり１の現在地点に対応する昇順リストの番号num
nowplace = ans[0]
ans.sort()
num = ans.index(nowplace)
if w[0]==1 and ans.count(nowplace)==2: num += 1 # ２つ該当する場合の処理
# numがnum0の位置であるように調整したい
gap = num0-num
for i in range(n):
    i = (i-gap)%n
    print(ans[i])

Buggy submission (verdict: Runtime Error):

# アリ１からNまでの前後関係は不変。つまり、アリ１からNまでの順番は保たれる。
# アリの最終座標の昇順リストを用意して、アリ１からNに対応させればよい。

n,l,t=map(int,input().split())
x=[0 for i in range(n+1)]
w=[0 for i in range(n+1)]
ans=[]　# アリの最終座標リスト
w1=[]　# w=1のアリの初期座標リスト
w2=[]　# w=2のアリの初期座標リスト

for i in range(1,n+1):
    x[i],w[i]=map(int,input().split())
    if w[i]==1: a=(x[i]+t)%l; w1.append(x[i])
    if w[i]==2: a=(x[i]-t+l)%l; w2.append(x[i])
    ans.append(a)

# kはアリ同士がすれ違った数
k=0
for i in range(n):
    if w[i]==1:　# もしw=1のアリがいないならk=0のままで問題なし。
        if (x[i]+2*t)>=l:
            for j in range(x[i],x[i]+2*t+1): k+=w2.count(j)
            for j in range((x[i]+2*t+1)%l,x[i]): k+=w2.count(j)
        else:
            for j in range(x[i],x[i]+2*t+1): k+=w2.count(j)
        break　# １つw=1のアリ見つけたらそこで終了。

# ansをソートしてkだけ円順列的にずらして出力
ans.sort()
for i in range(n): print(ans[(i+k)%n])
Problem p03773 (python)

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

ans = (a+b)%24

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
ans = len(str(n/nn))
print(ans)
Problem p03944 (python)

Fixed submission:

wo=0
ho=0
w,h,n=map(int, input().split())

for i in range(n):
    x,y,a=map(int, input().split())
    if a==1:
        if x>wo: wo=x
    if a==2:
        if x<w: w=x
    if a==3:
        if y>ho: ho=y
    if a==4:
        if y<h: h=y

ans=(w-wo)*(h-ho)

if wo>=w or ho>=h: print(0)
else: print(ans)

Buggy submission (verdict: Runtime Error):

wo=0
ho=0
w,h,n=map(int, input().split())

for i in range(n):
    x,y,a=map(int, input().split())
    if a==1: wo=x
    if a==2: w=x
    if a==3: ho=y
    if a==4: h=y

ans=(w-wo)*(h-ho)

if wo>=w or h0>=h: print(0)
else: print(ans)
Problem p03945 (python)

Fixed submission:

s=input()

count=0
for i in range(len(s)-1):
    if s[i]!=s[i+1]: count+=1

print(count)

Buggy submission (verdict: Runtime Error):

s=input()

count=0
for i in range(len(s)):
    if s[i]!=s[i+1]: count+=1

print(count)

Buggy submission (verdict: Runtime Error):

s=input()

count=0
for i in range(len(s)):
    if s[i]!=s[i+1]: count+=1

print(count)
Problem p03957 (python)

Fixed submission:
s=str(input())
p=[chr(i) for i in range(65, 65+26)]
p.remove("C")
p.remove("F")
for i in p:
    s=s.replace(i,'')
 
if 'CF' in s:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=str(input())
p=list('ABDEGHIJKLMNOPQRSTUVWXYZ')
p.remove("C")
p.remove("F")
for i in p:
    s=s.replace(i,'')
 
if 'CF' in s:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=input()
l=["a:z"]
l.remove(c)
l.remove(f)

for i in l:
  s.replace(i, "")

if "CF" in l:
   print("yes")
else:
   print("NO")
Problem p03962 (python)

Fixed submission:

def penki(a, b, c):
  if a==b and b==c:
    return 1
  elif a!=b and b!=c and c!=a:
    return 3
  else:
    return 2

a,b,c=map(int, input().split())
print(penki(a, b, c))

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

ans=k*(k-1)**(n-1)

print(ans)

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

ans=(k-1)**(n-1)

print(ans*k)

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

ans=k*(k-1)**(n-1)

print(ans)

Buggy submission (verdict: Runtime Error):

n, k=mat(int, input().split())

ans=(k-1)**(n-1)

print(ans*k)

Buggy submission (verdict: Runtime Error):

n,k=mat(int, input().split())

ans=k*(k-1)**(n-1)

print(ans)

Buggy submission (verdict: Runtime Error):

n, k=map(int, input().split())

ans=k*((k-1)**(n-1))

print(ans)

Buggy submission (verdict: Runtime Error):

n, k=mat(int, input().split())

ans=k*((k-1)**(n-1))

print(ans)

Buggy submission (verdict: Runtime Error):
def penki(n, k):
    return k*(k-1)**(n-1)

n, k=mat(int, input().split())

print(penki(n, k))

Buggy submission (verdict: Runtime Error):
シカのAtCoDeerくんはペンキをこれまでに3つ買いました。おととい買ったペンキの色は a , 昨日買ったペンキの色は b , 今日買ったペンキの色は c です。各ペンキの色は1以上100以下の整数で表されます。 AtCoDeerくんはわすれんぼうなため、同じ色のペンキを買ってしまっていることがあります。AtCoDeerくんが買ったペンキの色の種類の個数を教えてあげてください。

a,b,c=map(int, input().split())
Problem p02628 (python)

Fixed submission:
N = list(map(int,input().split()))
value = list(map(int,input().split()))
sum = 0
newValue = sorted(value)
for i in range(N[1]):
    sum = sum + newValue[i]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
value = []
sum = 0

for i in range(N):
    value.append(int(input())) 
newValue = sorted(value)

for j in range(K):
    sum = sum + newValue[j]

print(sum)
Problem p02675 (python)

Fixed submission:
N = input()
N_list = list(N)
if N_list[-1] == "2" or N_list[-1] == "4" or N_list[-1] == "5" or N_list[-1] == "7" or N_list[-1] == "9":
    print("hon")
elif N_list[-1] == "0" or N_list[-1] == "1" or N_list[-1] == "6" or N_list[-1] == "8":
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
N = int(input())
N_list = list(N)
if N_list[0] = 2 or N_list[0] = 4 or N_list[0] = 5 or N_list[0] = 7 or N_list[0] = 9:
    print(hon)
elif N_list[0] = 0 or N_list[0] = 1 or N_list[0] = 6 or N_list[0] = 8:
    print(pon)
else:
    print(bon)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
if S == T[:-1]:
  print("Yes")
else:
  print("No")

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

t = 0
now = 1
footprint = [1]

while t < K:
  if A[now-1] not in footprint:
    footprint.append(A[now-1])
    now = A[now-1]
    t += 1
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = (K-s) % l
    now = footprint[i+e]
    break

print(now)

Buggy submission (verdict: Runtime Error):
a