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

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

x = []
y = []
ans = [10]*n 

for i in range(m):
    s = input().split()
    x.append(int(s[0]))
    y.append(int(s[1]))

cnt = 0

q = 0

for i in x:
    if i == 1 and y[cnt] == 0 and n!=1:
        print(-1)
        q = 1
        break
    else:
        if ans[i-1] !=10:
            if ans[i-1]==y[cnt]:
                cnt += 1
            else:
                print(-1)
                q = 1
                break
        else:
            ans[i-1] = y[cnt]
            cnt += 1
            
cnt2 = 0

if q ==0:
    for i in ans:
        if i == 10:
            if cnt2 == 0:
                if n == 1:
                    ans[cnt] = 0
                else:
                    ans[cnt2] = 1
            else:
                ans[cnt2] = 0
        cnt2 += 1
    for i in ans:
        print(i,end = "")

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

x = []
y = []
ans = [10]*n 

for i in range(m):
    s = input().split()
    x.append(int(s[0]))
    y.append(int(s[1]))

cnt = 0

q = 0

for i in x:
    if i == 1 and y[cnt] == 0 and n!=1:
        print(-1)
        q = 1
        break
    else:
        if ans[i-1] !=10:
            if ans[i-1]==y[cnt]:
                cnt += 1
            else:
                print(-1)
                q = 1
                break
        else:
            ans[i-1] = y[cnt]
            cnt += 1
            
cnt2 = 0

if q ==0:
    for i in ans:
        if i == 10:
            if cnt2 == 0:
                ans[cnt2] = 1
                cnt2 += 1
            else:
                ans[cnt2] = 0
        cnt2 += 1
    for i in ans:
        print(i,end = "")
Problem p02765 (python)

Fixed submission:
deta = input().split()
n = deta[0]
r = deta[1]
if int(n)>=10:
    print(r)
else:
    rate = 100*(10-int(n))+int(r)
    print(rate)

Buggy submission (verdict: Runtime Error):
deta = input().split()
n = deta[0]
r = deta[1]
if n>=10:
    print(r)
else:
    rate = 100*(10-int(n))
    print(rate)
Problem p02797 (python)

Fixed submission:
n,k,s = map(int,input().split())
x = [0]*n
for i in range(k):
    x[i] = s
if s == 1000000000:
    for i in range(k,n):
        x[i] = s-1
else:
    for i in range(k,n):
        x[i] = s+1
for i in x:
    print(i,end = " ")

Buggy submission (verdict: Runtime Error):
n,k,s = map(int,input().split())
x = [0]*n
for i in range(k):
    x[i] = s
if s == 1000000000:
    for i in range(k,n+1):
        x[i] = s-1
else:
    for i in range(k,n+1):
        x[i] = s+1
for i in x:
    print(i,end = " ")
Problem p02802 (python)

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

pro = [0]*n

ac = set([])

ans = 0

pen = 0

for _ in range(m):
    l = input().split()
    s = l[1]
    p = int(l[0])    
    if s == "AC":
        if p not in ac:
            ans += 1
            pen += pro[p-1]
            ac.add(p)
            
    else:
        if p not in ac:
            pro[p-1] += 1
            
print(ans,pen)

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

ans = 0

def prime(x):
    y = x//2+1
    cnt = 0
    for i in range(2,y+1):
        if x%i==0:
            cnt += 1
            
    if cnt == 0:
        return x
    else:
        return 0
        
while ans == 0:
    ans = prime(x)
    x += 1
    
if x == 2:
    print(2)
else:
    print(ans)
Problem p02923 (python)

Fixed submission:
n = int(input())

h = list(map(int,input().split()))

ans = 0

cnt= 0

for i in range(n-1):
    if h[i]>=h[i+1]:
        cnt +=1
        if cnt > ans:
            ans = cnt
    else:
        cnt = 0
            
print(ans)

Buggy submission (verdict: Runtime Error):

h = list(map(int,input().split()))

ans = 0

cnt= 0

for i in range(n-2):
    if h[i]>=h[i+1]:
        cnt +=1
        if cnt > ans:
            ans = cnt
        else:
            cnt = 0
            
print(ans)
Problem p02969 (python)

Fixed submission:
x = int(input())
print(3*(x**2))

Buggy submission (verdict: Runtime Error):
x = int(input())
print(3(*x**2))
Problem p02981 (python)

Fixed submission:
n , a , b = map(int,input().split())
t = n*a
if t>b:
    print(b)
else:
    print(t)

Buggy submission (verdict: Runtime Error):
n ,a , b = map(int,input(),split())
t = n*a
if t>b:
    print(b)
else:
    print(t)
Problem p03001 (python)

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

if w/2 == x and h/2 == y:
    print(w*h/2,1)
else:
    print(w*h/2,0)

Buggy submission (verdict: Runtime Error):
 
s = w*h
 
if (w-x)*h > (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(0)
elif (w-x)*h == (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(1)
else:
    print(float((h-y))*w,end = " ")
    print(0)
Problem p03059 (python)

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

print(b*(t//a))

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

print(b*(a//t))
Problem p03074 (python)

Fixed submission:
n,k = map(int,input().split())
s = list(map(int,list(input())))
x = [-1]
for i in range(n-1):
    if s[i] != s[i+1]:
        x.append(i)
x.append(n-1)
t = len(x)
ans = 1

for i in range(t-1):
    if i%2 == s[0]:
        ans = max(ans,x[min(t-1,i+2*k)]-x[i])
    else:
        ans = max(ans,x[min(t-1,i+2*k+1)]-x[i])

print(ans)

Buggy submission (verdict: Runtime Error):

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

s = list(map(int,input()))

ans = 0

x = []

f = s[0]

z = 0
o = 0
ans = 0

for i in s:
    if i == 0:
        if f == 1:
            x.append(o)
            o = 0
            z += 1
            f = 0
        else:
            z += 1
    else:
        if f == 0:
            x.append(z)
            z = 0
            o += 1
            f = 1
        else:
            o += 1
    
if s[-1] != s[-2]:
    x.append(1)
else:
    x[-1] += 1
    
    
    
if k > len(x):
    print(sum(x))
else:
    for i in range(len(x)-k):
        ans = max(ans,sum(x[i:i+k+1]))
    print(ans)
Problem p03109 (python)

Fixed submission:
s = input()
if int(s[5]) == 1:
    print("TBD")
else:
    if int(s[6])<5:
        print("Heisei")
    else:
        print("TBD")

Buggy submission (verdict: Runtime Error):
s = input()
if s[5] == 1:
    print("TBD")
else:
    if s[6]>4:
        print("Heisei")
    else:
        print("TBD")
Problem p03273 (python)

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

f = []

for i in range(h):
    f.append(list(input()))
    
a = []
    
for i in range(len(f)):
    if f[i] == ["."]*len(f[i]):
        a.append(i)
        
for i in a:
    del f[i]
    for s in range(len(a)):
        a[s] -= 1
        
f2 = []

for i in range(w):
    s = []
    
    for k in f:
        s.append(k[i])
        
    f2.append(s)
    
b = []
    
for i in range(len(f2)):
    if f2[i] == ["."]*len(f2[i]):
        b.append(i)
        
for i in b:
    del f2[i]
    for s in range(len(b)):
        b[s] -= 1
        
ff = []

for i in range(len(f2[0])):
    s = []
    
    for k in f2:
        s.append(k[i])
        
    ff.append(s)
        
for i in ff:
    for s in range(len(i)-1):
        print(i[s],end = "")
    
    print(i[-1])

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

f = []

for i in range(h):
    f.append(list(input()))
    
a = []
    
for i in range(len(f)):
    if f[i] == ["."]*len(f[i]):
        a.append(i)
        
for i in a:
    del f[i]
    for s in range(len(a)):
        a[s] -= 1
        
f2 = []

for i in range(w):
    s = []
    
    for k in f:
        s.append(k[i])
        
    f2.append(s)
    
b = []
    
for i in range(len(f2)):
    if f2[i] == ["."]*len(f2[i]):
        b.append(i)
        
for i in b:
    del f2[i]
    for s in range(len(b)):
        b[s] -= 1
        
ff = []

for i in range(len(f2)):
    s = []
    
    for k in f2:
        s.append(k[i])
        
    ff.append(s)
        
for i in ff:
    for s in range(len(i)-1):
        print(i[s],end = "")
    
    print(i[-1])
Problem p03282 (python)

Fixed submission:

s = list(input())

k = int(input())

cnt = 0

if len(s) == 1:
    print(s[0])
else:
    if s[0] == "1":
        
        while s[0] == "1":
            cnt += 1
            del s[0]
            if cnt>=k:
                print(1)
                break
            
        if cnt<k:
            print(s[0])
            
    else:
        print(s[0])

Buggy submission (verdict: Runtime Error):
s = list(input())

k = int(input())

cnt = 0

if len(s) == 1:
    print(s[0])
else:
    if s[0] == "1":
        while s[0] == "1":
            cnt += 1
            del s[0]
        if cnt>=k:
            print(1)
        else:
            print(s[0])
            
    else:
        print(s[0])

Buggy submission (verdict: Runtime Error):
s = list(input())

if s[0] != "1":
    print(int(s[0]))
else:
    print(int(s[1]))
Problem p03289 (python)

Fixed submission:
s = list(input())
al = list("abcdefghijklmnopqrstuvwxyz")
if s[0] == "A" and s[-1] in al and s[1] in al:
    del s[0]
    del s[0]
    del s[-1]
    f = 0
    for i in s:
        if i == "C":
            if f == 1:
                print("WA")
                break
            else:
                f = 1
                continue
        else:
            if i in al:
                continue
            else:
                print("WA")
                break
    else:
        if f == 1:
            print("AC")
        else:
            print("WA")
else:
    print("WA")

Buggy submission (verdict: Runtime Error):
s = list(input())
al = list("abcdefghijklmnopqrstuvwxyz")
if s[0] == "A" and s[-1] in al and s[1] in al:
    del s[0]
    del s[0]
    del s[-1]
    f = 0
    for i in s:
        if i == "C":
            if f == 1:
                print("WA")
                break
            else:
                f = 1
                continue
        else:
            if i in al:
                continue
            else:
                print("WA")
                break
    else:
        if f = 1:
            print("AC")
        else:
            print("WA")
else:
    print("WA")
Problem p03456 (python)

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

x = int(str(a)+str(b))

for i in range(x):
    if i**2 == x:
        print("Yes")
        break
    elif i**2<x:
        continue
    else:
        print("No")
        break

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

x = int(str(a)+str(b))

for i in x:
    if i**2 == x:
        print("Yes")
        break
    elif i**2<x:
        continue
    else:
        print("No")
        break
Problem p03478 (python)

Fixed submission:
n,a,b = map(int,input().split())
ans = 0
for i in range(1,n+1):
    s = 0
    for t in str(i):
        s += int(t)
    if a-1< s < b+1:
        ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
ans = 0
for i in range(1,n+1):
    s = 0
    for t in str(i):
        s　 += int(t)
    if a-1< s < b+1:
        ans += str(i)
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
ans = 0
for i in range(1,n+1):
    if a-1 < sum(list(str(i))) < b+1:
        ans += i
print(ans)
Problem p03598 (python)

Fixed submission:
n = int(input())
k = int(input())
x = list(map(int,input().split()))
ans = 0

for i in x:
  ans += min(abs(i-k),i)*2
  
print(ans)

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

for i in x:
  ans += min(abs(x-k),x)
  
print(ans)
Problem p03611 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = [0]*(max(a)+4)
for i in a:
    s[i] += 1
    s[i+1] += 1
    s[i+2] += 1

print(max(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input(),split()))
s = [0]*max(a)+2
for i in a:
    i += 1
    s[i-1] += 1
    s[i] += 1
    s[i+1] += 1
Problem p03624 (python)

Fixed submission:
al = list("abcdefghijklmnopqrstuvwxyz")

s = list(input())
for i in s:
    if i in al:
        del al[al.index(i)]
        
if len(al) == 0:
    print("None")
else:
    print(al[0])

Buggy submission (verdict: Runtime Error):
al = list("abcdefghijklmnopqrstuvwxyz")

s = list(input())
for i in s:
    if i in al:
        del al[al.index(i)]
        
if len(s) == 0:
    print("None")
else:
    print(al[0])
Problem p03712 (python)

Fixed submission:
y,x = map(int,input().split())
for i in range(x+1):
    print("#",end = "")
print("#")
for i in range(y):
    print("#"+input()+"#")
for i in range(x+1):
    print("#",end = "")
print("#")

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
for i in range(x+1):
    print("#",end = "")
print("#")
for i in range(y):
    print("#"+input()+"#")
for i in range(x+1):
    print("#",end = "")
print("#")
Problem p03963 (python)

Fixed submission:
n,k = map(int,input().split())
print(k*((k-1)**(n-1)))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
print(k*((k-1)**(n-1))
Problem p03140 (python)

Fixed submission:
N=int(input())
A,B,C=[input() for i in range(3)]
ans=0
for i in range(N):
    if A[i]!=B[i] and A[i]!=C[i] and B[i]!=C[i]:
        ans+=2
    elif A[i]!=B[i] or A[i]!=C[i]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,A,B,C=[input() for i in range(4)]
ans=0
for i in range(N):
    if A[i]!=B[i] and A[i]!=C[i] and B[i]!=C[i]:
        ans+=2
    elif A[i]!=B[i] or A[i]!=C[i]:
        ans+=1
print(ans)
Problem p03155 (python)

Fixed submission:
N,H,W=[int(input()) for i in range(3)]
print((N-H+1)*(N-W+1))

Buggy submission (verdict: Runtime Error):
N,H,W=[input() for i in range(3)]
print((N-H+1)*(N-W+1))
Problem p03160 (python)

Fixed submission:
import sys
sys.setrecursionlimit(int(3e6))
N=int(input())
h=list(map(int,input().split()))

memo=[-1 for i in range(N)]
memo[0]=0
def dp(i):
    if memo[i]!=-1:
        return memo[i]
    cos=dp(i-1)+abs(h[i]-h[i-1])
    if i-2>=0:
        cos=min(cos,dp(i-2)+abs(h[i]-h[i-2]))
    memo[i]=cos
    return cos
print(dp(N-1))

Buggy submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
memo=[-1 for i in range(N)]
memo[0]=0
def dp(i):
    if memo[i]!=-1:
        return memo[i]
    cos=dp(i-1)+abs(h[i]-h[i-1])
    if i-2>=0:
        cos=min(cos,dp(i-2)+abs(h[i]-h[i-2]))
    memo[i]=cos
    return cos
print(dp(N-1))
Problem p02690 (python)

Fixed submission:
# 2020/05/03
# AtCoder Beginner Contest 166 - D

# Input
x = int(input())

# Calc
eflg = False
for a in range(200):
    wk_a = a ** 5
    for b in range(200):
        if wk_a - (b ** 5) == x:
            ans1 = a
            ans2 = b
            eflg = True
            break

        if wk_a - (-b ** 5) == x:
            ans1 = a
            ans2 = -b
            eflg = True
            break

    if eflg == True:
        break

# Output
print(ans1, ans2)

Buggy submission (verdict: Runtime Error):
# 2020/05/03
# AtCoder Beginner Contest 166 - D

# Input
x = int(input())

# Calc
eflg = False
for a in range(200):
    wk_a = a ** 5
    b = 0
    sav = 10 ** 10
    for b in range(200):
        val_1 = wk_a - (b ** 5)
        val_2 = wk_a - (-b ** 5)

        if val_1 == x:
            ans1 = a
            ans2 = b
            eflg = True
            break

        if val_2 == x:
            ans1 = a
            ans2 = -b
            eflg = True
            break
        
        sav = abs(val_2) - x

        if sav > x:
            break

    if eflg == True:
        break

# Output
print(ans1, ans2)

Buggy submission (verdict: Runtime Error):
# 2020/05/03
# AtCoder Beginner Contest 166 - D

# Input
x = int(input())

# Calc
eflg = False
for a in range(10**6):
    wk_a = a ** 5
    b = 0
    sav = 10 ** 10
    for b in range(10**6):
        val_1 = wk_a - (b ** 5)
        val_2 = wk_a - (-b ** 5)

        if val_1 == x:
            ans1 = a
            ans2 = b
            eflg = True
            break

        if val_2 == x:
            ans1 = a
            ans2 = -b
            eflg = True
            break
        
        sav = abs(val_2) - x

        if sav > x:
            break

    if eflg == True:
        break

# Output
print(ans1, ans2)
Problem p02718 (python)

Fixed submission:
# 2020/04/04
# AtCoder Beginner Contest 161 - B

# Input
n, m = map(int,input().split())
a = list(map(int,input().split()))

# Init
sump = 0
sump_m = 0

# Calc
for i in range(n):
    sump = sump + a[i]

a.sort()
a.reverse()

ans = 'Yes'
for i in range(m):
    if a[i] < sump / (4 * m):
        ans = 'No'

# Output
print(ans)

Buggy submission (verdict: Runtime Error):
# 2020/04/04
# AtCoder Beginner Contest 161 - B

# Input
n, m = map(int,input().split())
a = list(map(int,input().split()))

# Init
sump = 0
sump_m = 0

# Calc
for i in range(n):
    sump = sump + a[i]

a.sort()
a.reverse()

ans = 'Yes'
for i in range(m):
    if a[m] < sump / (4 * m):
        ans = 'No'

# Output
print(ans)
Problem p02854 (python)

Fixed submission:
# 2019/11/23
# DISCO presents ディスカバリーチャンネル コードコンテスト2020 予選 - B

# Binary Search
def binSearch (tlis, tval):
    lf = 0
    rg = len(tlis)
    while(lf <= rg):
        ct = int((lf + rg) / 2)
        if tlis[ct] < tval:
            lf = ct + 1
        elif tlis[ct] > tval:
            rg = ct - 1
        else:
            return ct
    return ct

# Input
n = int(input())
a = list(map(int,input().split()))
acm_a = list()
acm_a.append(0)

# Sum
for i in range(len(a)):
    acm_a.append(a[i] + acm_a[i])

acm_a.append(acm_a[len(a)])
# Calc Center
center = acm_a[len(a)] / 2
ctidx = binSearch(acm_a, center)

ans = min(abs((acm_a[len(a)] - acm_a[ctidx-1]) - acm_a[ctidx-1]), abs((acm_a[len(a)] - acm_a[ctidx]) - acm_a[ctidx]), abs((acm_a[len(a)] - acm_a[ctidx+1]) - acm_a[ctidx+1]))

# Output
print(ans)

Buggy submission (verdict: Runtime Error):
# 2019/11/23
# DISCO presents ディスカバリーチャンネル コードコンテスト2020 予選 - B

# Binary Search
def binSearch (tlis, tval):
    lf = 0
    rg = len(tlis)
    while(lf <= rg):
        ct = int((lf + rg) / 2)
        if tlis[ct] < tval:
            lf = ct + 1
        elif tlis[ct] > tval:
            rg = ct - 1
        else:
            return ct
    return ct

# Input
n = int(input())
a = list(map(int,input().split()))
acm_a = list()
acm_a.append(0)

# Sum
for i in range(len(a)):
    acm_a.append(a[i] + acm_a[i])

# Calc Center
center = acm_a[len(a)] / 2
ctidx = binSearch(acm_a, center)

if (center - acm_a[ctidx]) < (acm_a[ctidx] - center):
    ans = (acm_a[len(a)] - acm_a[ctidx + 1]) - acm_a[ctidx+1]
elif (center - acm_a[ctidx]) > (acm_a[ctidx] - center):
    ans = acm_a[ctidx+1] - (acm_a[len(a)] - acm_a[ctidx + 1])
else:
    ans = 0

# Output
print(ans)
Problem p03087 (python)

Fixed submission:
# 2019/04/28
# AtCoder Beginner Contest 122 - C

# Input
n, q = map(int,input().split())
s = input()

acgt = ["A", "C", "G", "T"]
acgtl = list()
acgtl.append(0)

# Search AC and make Accumed sum
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        acgtl.append(acgtl[i]+1)
    else:
        acgtl.append(acgtl[i])
        
# Calc AC count
for x in range(q):
    l, r = map(int,input().split())
    ans = acgtl[r-1] - acgtl[l-1]
    print(ans)

Buggy submission (verdict: Runtime Error):
# 2019/03/24
# AtCoder Beginner Contest 122 - C

# Input
n, q = map(int,input().split())
s = input()
sab = list()
aclist = list()

for j in range(0, n-1, 1):
    if s[j] == "A" and s[j+1] == "C":
        aclist.append(j+1)

for k in range(q):
    l, r = map(int,input().split())
    ans = 0
    
    t_idx = 0
    b_idx = len(aclist)
    search_idx = int(len(aclist) / 2)

    while(b_idx + 1 < t_idx and aclist[search_idx] == l):
        if aclist[search_idx] > l:
            t_idx = search_idx
            search_idx = int((t_idx + b_idx) / 2)
        elif aclist[search_idx] < l:
            b_idx = search_idx
            search_idx = int((t_idx + b_idx) / 2)

    for i in range(search_idx-1, len(aclist), 1):
        if aclist[i] >= l:
            if aclist[i] < r:
                ans += 1
            else:
                break
        else:
            continue

    # Output
    print(ans)
Problem p03095 (python)

Fixed submission:
# 2019/03/17
# AtCoder Grand Contest 031 - A

# Input
n = int(input())
s = input()

aprcnt = [1] * 26

# Count up Alphabets
for idx in range(n):
    w_idx = ord(s[idx]) - 97
    aprcnt[w_idx] += 1

# Calc Combination count
ans = 1
for idx in range(26):
    ans = ans * aprcnt[idx]

# Reduces 1 in choose nothing case
ans -= 1
ans = ans % (10**9 + 7)

# Output
print(ans)

Buggy submission (verdict: Runtime Error):
# 2019/03/16
# AtCoder Grand Contest 031 - A

# Input
n = int(input())
s = input()

aprcnt = [1] * 26

# Count up Alphabets
for idx in range(n):
    w_idx = ord(s[idx]) - 97
    aprcnt[w_idx] += 1

# Calc Combination count
ans = 1
for idx in range(n):
    ans = ans * aprcnt[idx]

# Reduces 1 in choose nothing case
ans -= 1

# Output
print(ans)
Problem p03150 (python)

Fixed submission:
# 2019/01/13
# KEYENCE Programming Contest 2019 - B

# Input
s = input()

# Init
key_str = "keyence"
ans = "NO"
search_idx = 0

# Search
if s[0] == key_str[0]:
    # Pattern 2 or 3
    for idx in range(len(s)):
        if s[idx] == key_str[search_idx]:
            search_idx += 1
            if search_idx == len(key_str):
                # Pattern 3
                ans = "YES"
                break

        else:
            # Pattern 2
            for idx2 in range(len(s) - len(key_str) + search_idx, len(s)):
                if s[idx2] == key_str[search_idx]:
                    search_idx += 1
                    if search_idx == len(key_str):
                       ans = "YES"
            break
else:
    # Pattern 1
    for idx in range(len(s) - len(key_str), len(s)):
        if s[idx] == key_str[search_idx]:
            search_idx += 1
            if search_idx == len(key_str):
                ans = "YES"
                break

# Output
print(ans)

Buggy submission (verdict: Runtime Error):
# 2019/01/13
# KEYENCE Programming Contest 2019 - B

# Input
s = input()

# Init
key_str = "keyence"
search_idx = 0
okflg = 0
ngcnt = 0

# Search
for idx in range(len(s)):
    if s[idx] == key_str[search_idx]:
        search_idx += 1
        okflg = 1
    else:
        if okflg == 1:
            ngcnt += 1
            okflg = 0
        if ngcnt > 1:
            break

# Check
if search_idx == len(key_str):
    ans = "YES"
else:
    ans = "NO"

# Output
print(ans)
Problem p03294 (python)

Fixed submission:
# 2020/02/11
# AtCoder Beginner Contest 103 - C

import math
import fractions

# Greatest Common Divisor(GCD)  
def gcd_fgf(a, b):
    return fractions.gcd(a, b)

# Least Common Multiple(LCM)
def lcm_fgf(a, b):
    return int(a * b // fractions.gcd(a, b))

# Input
n = int(input())
a = list(map(int,input().split()))

# Calc Co-LCM
work_lcm = a[0]
for i in range(1, len(a)):
    work_lcm = lcm_fgf(work_lcm, a[i])

m = work_lcm - 1

# Sum remains
fm = 0
for i in range(len(a)):
    fm = fm + (m % a[i])

ans = fm    
# Output
print(ans)

Buggy submission (verdict: Runtime Error):
# 2020/02/11
# AtCoder Beginner Contest 103 - C

import math
import fractions

# Greatest Common Divisor(GCD)  
def gcd_fgf(a, b):
    return fractions.gcd(a, b)

# Least Common Multiple(LCM)
def lcm_fgf(a, b):
    return int(a * b / fractions.gcd(a, b))

# Input
n = int(input())
a = list(map(int,input().split()))

# Calc Co-LCM
work_lcm = a[0]
for i in range(1, n):
    work_lcm = lcm_fgf(work_lcm, a[i])

m = work_lcm - 1

# Sum remains
fm = 0
for i in range(n):
    fm = fm + (m % a[i])

ans = fm    
# Output
print(ans)
Problem p03386 (python)

Fixed submission:
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())
cnt = b - a + 1

vals = list()
if cnt < k:
    wk = cnt
else:
    wk = k

# small
for i in range(a, a + wk):
    print(i)

if k * 2 > cnt:
    wk = cnt - wk

# large
for i in range(b - wk + 1, b+1):
    print(i)

Buggy submission (verdict: Runtime Error):
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())

vals = list()
for i in range(a, b+1):
    vals.append(i)

vals.sort()
# small
for i in range(k):
    print(vals[i])

# large
for i in range(len(vals)-k, len(vals)):
    print(vals[i])