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

Fixed submission:
li = list(input())
c = 0
for i in [0,1,2]:
  if li[i]=='1':
    c = c +1
    
print(c)

Buggy submission (verdict: Runtime Error):
li = input().split()
c = 0
for i in range(0,3):
  if li[i]=='1':
    c++
    
print(c)

Buggy submission (verdict: Runtime Error):
li = input()
c = 0
for i in range(0,3):
  if li[i]=='1':
    c++
    
print(c)

Buggy submission (verdict: Runtime Error):
li = map(input())
c = 0
for i range 3:
  if li[i]=='1':
    c++
    
print(c)
Problem p03555 (python)

Fixed submission:
l = list(input())
m = list(input())
if int(l[0]==m[2]) & int(l[1]==m[1]) & int(l[2]==m[0]):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
li = list(input())
if li[0]==li[5] && li[1]==li[4] && li[2]==li[3]:
  print("YES")
else:
  print("NO")
Problem p03573 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b:
  print(c)
elif a==c:
  print(b)
elif b==c:
  print(a)

Buggy submission (verdict: Runtime Error):
a,b,c=stdin.readline().rstrip().split()
if a==b:
  print(c)
elif a==c:
  print(b)
elif b==c:
  print(a)
Problem p02848 (python)

Fixed submission:
n=int(input())
s=input()
a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s=list(s)
a=list(a)
for i in range(len(s)):
    if a.index(s[i]) + n >= 26:
        s[i]=a[int(a.index(s[i])+n-26)]
    else:
        s[i]=a[int(a.index(s[i])+n)]
s="".join(s)
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
for i in range(len(s)):
  s[i]=str(int(s[i])+n)
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
for i in range(len(s)):
  s[i]+=n
print(s)
Problem p02909 (python)

Fixed submission:
S=input()
if S=='Sunny':
  print('Cloudy')
elif S=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
S=input()
if S==Sunny:
  print(Cloudy)
elif S==Cloudy:
  print(Rainy)
else:
  print(Sunny)
Problem p02947 (python)

Fixed submission:
N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))

Buggy submission (verdict: Runtime Error):
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        count.append()
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

Buggy submission (verdict: Runtime Error):
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        u.append(0)
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

Buggy submission (verdict: Runtime Error):
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        u.append(0)
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

Buggy submission (verdict: Runtime Error):
N=int(input())
count=0
s=[input() for i in range(N)]
n=['a' for t in range(N) for i in range(t+1,N) if s[t].sort==s[i].sort]
print(len(n))
Problem p02953 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
F=H
T=True
B=max(H)
C=H.index(max(H))
if B-H[N-1]>1 and B!=H[N-1]:
    T=False
if C==N-1 and N!=1:
    del H[N-1]
    B=max(H)
    H=F
    C=H.index(B)
if T:
    for i in range(N-1):
        if i>C:
            if H[i]+1<H[C]:
                T=False
if T:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
F=H
T=True
B=max(H)
C=H.index(max(H))
if B-H[N-1]>1 and B!=H[N-1]:
    T=False
if C==N-1:
    del H[N-1]
    B=max(H)
    H=F
    C=H.index(B)
if T:
    for i in range(N-1):
        if i>C:
            if H[i]+1<H[C]:
                T=False
if T:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
F=H
T=True
B=max(H)
C=H.index(max(H))
if B-H[N-1]>1 and B!=H[N-1]:
    T=False
if C==N-1:
    del H[N-1]
    B=max(H)
    H=F
    C=H.index(B)
if T:
    for i in range(N-1):
        if i>C:
            if H[i]+1<H[C]:
                T=False
if T:
    print('Yes')
else:
    print('No')
Problem p02982 (python)

Fixed submission:
import math
N=list(map(int,input().split()))
a=['X' for _ in range(int(N[0]))]
A=0
for i in range(int(N[0])):
    a[i]=list(map(int,input().split()))
    for t in range(int(i)):
        if i!=t:
            Y=[]
            for s in range(int(N[1])):
                Y+=[(a[i][s]-a[t][s])**2]
            Z=sum(Y)
            if (math.sqrt(Z))- int(math.sqrt(Z))==0:
                A+=1
        else:
            continue
print(A)

Buggy submission (verdict: Runtime Error):
import math
N=list(map(int,input().split()))
a=['X' for _ in range(int(N[0]))]
A=0
for i in range(int(N[0])):
    a[i]=list(map(int,input().split()))
    for t in range(int(i)):
        if i!=t:
            for s in range(int(N[1])):
                Y=[(a[i][s]-a[t][s])**2]
                Z=sum(Y)
                if (math.sqrt(Z))- int(math.sqrt(Z))==0:
                    A+=1
        else continue
print(A)
Problem p02983 (python)

Fixed submission:
l,r=list(map(int,input().split()))
f=True
C=2019
if (r-l)<2019:
    for i in range(l,r+1):
        if C==0:
            break
        for t in range(i+1,r+1):
            if t*i%2019<C:
                C=t*i%2019
                if C==0:
                    break
else:
    C=0
print(C)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
t=True
C=2019
if t:
    for i in range(A[1]):
        for t in range(A[1]+1):
            if t>i and i>=A[0]:
                if i-t>2019:
                  	C=0
                    t=False
                    break
                else:
                    if t*i%2019<C:
                        C=t*i%2019
print(C)
Problem p02994 (python)

Fixed submission:
N,L=list(map(int,input().split()))
taste=[]
taste1=[]
memo=[]
sum=0
for i in range(N):
    tasty=abs(L+i)
    if L+i<=0:
        memo.append(L+i)
    taste.append(tasty)
    taste1.append(L+i)
    sum+=taste1[i]
tasteab=sorted(taste)
memo=sorted(memo)
if memo!=[]:
    pie=(sum-memo[-1])
else:
    pie=(sum-tasteab[0])
print(pie)

Buggy submission (verdict: Runtime Error):
N,L=list(map(int,input().split()))
taste=[]
taste1=[]
memo=[]
sum=0
for i in range(N):
    tasty=abs(L+i)
    if L+i<0:
        memo.append(L+i)
    taste.append(tasty)
    taste1.append(L+i)
    sum+=taste1[i]
tasteab=sorted(taste)
memo=sorted(memo)
pie=(sum-memo[-1])
print(pie)
Problem p03068 (python)

Fixed submission:
n=int(input())
s=list(input())
k=int(input())
ss = s[k-1]
for i in range(0,n):
  if s[i] != ss:
    s[i]='*'
print("".join(s))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
k=int(input())
ss = s[k-1]
for i in range(1,n):
  if s[i] != ss:
    s[i]='*'
print(s)
Problem p03109 (python)

Fixed submission:
S=input()
S=S.split('/')
A=S[0]
if int(S[1])>=5:
    print('TBD')
else:
    if int(A)<=2019:
        print('Heisei')
    else:
        print('TBD')

Buggy submission (verdict: Runtime Error):
S=input()
A=S[0]+S[1]+S[2]+S[3]
if int(S[5])!=0 and int(S[6]>5):
    print('TBD')
else:
    if int(A)<=2019:
        print('Heisei')
    else:
        print('TBD')
Problem p03434 (python)

Fixed submission:
N=input()
a=list(map(int,input().split()))
alice=0
bob=0
a=sorted(a,reverse=True)
for i in range(int(N)):
    if i%2==0:
        alice+=a[i]
    else:
        bob+=a[i]
print(alice-bob)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(int,input().split())
al=[a[2*i] for i in range(n//2)]
bo=[a[2*i+1] for i in range(n//2)]
print(sum(al)-sum(bo))
Problem p03448 (python)

Fixed submission:
A=input()
B=input()
C=input()
X=input()
sum=0
for a in range(int(A)+1):
    for b in range(int(B)+1):
        for c in range(int(C)+1):
            if 500*a+100*b+50*c==int(X):
                sum+=1
print(sum)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
aa=x//a
bb=x//b
cc=c//c
ans=0
for ai in range(aa):
  for bi in range(bb):
    for ci in range(cc):
      y=500*ai+100*bi+50*ci
      if x == y:
        ans+=1
      if y>x:
        break
print(ans)
Problem p03455 (python)

Fixed submission:
a,b=list(map(int,input().split()))
if a%2==0 or b%2==0:
	print('Even')
else:
	print('Odd')

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
a*=b
print("Even" if a%2 == 0 else "Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())*int(input())
print("Even" if a%2 == 0 else "Odd")
Problem p03478 (python)

Fixed submission:
a=list(map(int,input().split()))
sumy=0
for i in range(int(a[0]+1)):
    b=[]
    b+=str(i)
    c=0
    for t in range(len(b)):
        c+=int(b[t])
    if c>=a[1] and c<=a[2]:
        sumy+=i
print(sumy)

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

Fixed submission:
N=input()
a=list(map(int,input().split()))
i=0
count=-1
b=[]
c=True
while c:
    i=0
    count+=1
    while i<int(N):
        if a[i]%2!=0:
            c=False
            break
        else:
            a[i]=a[i]/2
            i+=1
print(int(count))

Buggy submission (verdict: Runtime Error):
import(sys)
n=int(input())
a = list(map(int,input().split()))
b=0
while(True):
  for i in range(n):
    if(a[i]%2!=0):
      print(b)
      sys.exit()
    a[i]=a[i]//2
  b+=1
print(b)
Problem p03557 (python)

Fixed submission:
import bisect
n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
    aa = bisect.bisect_left(a,b[i])
    ca = n-bisect.bisect_right(c,b[i])
    ans += aa * ca
print(ans)

Buggy submission (verdict: Runtime Error):
def abis(l, key):
    le = 0
    ri = n
    while le < ri:
        mid = (le + ri) // 2
        if mid == n:
            return mid
        elif l[mid] == key:
            while mid<n and l[mid-1]==l[mid]:
                mid-=1
            return mid
        elif l[mid] > key:
            if mid != 0 and l[mid - 1] < key:
                return mid
            ri = mid
        else:
            le = mid + 1
    return mid + 1

def cbis(l, key):
    le = 0
    ri = n
    while le < ri:
        mid = (le + ri) // 2
        if mid == n:
            return 0
        elif l[mid] == key:
            while mid<n and l[mid+1]==l[mid]:
                mid+=1
            return n-mid-1
        elif l[mid] > key:
            if mid != 0 and l[mid - 1] < key:
                return n-mid
            ri = mid
        else:
            le = mid + 1
    return n-mid



n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
    aa = abis(a, b[i])
    ca = cbis(c, b[i])
    ans += aa * ca
print(ans)
Problem p03860 (python)

Fixed submission:
s=input()
ss=s[8]
print("A"+ss+"C")

Buggy submission (verdict: Runtime Error):
s=input()
ss=s[0]
sss=upper(ss)
print("A"+sss+"C")

Buggy submission (verdict: Runtime Error):
print('A'+upper(input()[0])+'C')
Problem p02612 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
if n%1000 == 0:
  ans = 0
else:
  ans = 1000-n%1000
# 出力
print("{}".format(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
# 文字列の入力
s = [input() for i in range(n)]
# 数え上げ
C0 = s.count('AC')
C1 = s.count('WA')
C2 = s.count('TLE')
C3 = s.count('RE')
# 出力
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))
Problem p02696 (python)

Fixed submission:
import math

A, B, N = map(int,input().split())

if N < B:
    temp1 = math.floor(A*1/B) - A*math.floor(1/B)
    temp2 = math.floor(A*N/B) - A*math.floor(N/B)
    ans = max(temp1, temp2)

if N >= B:
    temp1 = math.floor(A*1/B) - A*math.floor(1/B)
    temp2 = math.floor(A*(B-1)/B) - A*math.floor((B-1)/B)
    ans = max(temp1, temp2)

print(ans)

Buggy submission (verdict: Runtime Error):
import math

A, B, N = map(int,input().split())

if N < B:
    temp1 = math.floor(A*1/B) - A*math.floor(1/B)
    temp2 = math.floor(A*N/B) - A*math.floor(N/B)
    ans = max(temp1, temp2)

if N > B:
    temp1 = math.floor(A*1/B) - A*math.floor(1/B)
    temp2 = math.floor(A*(B-1)/B) - A*math.floor((B-1)/B)
    ans = max(temp1, temp2)

print(ans)
Problem p02730 (python)

Fixed submission:
S = input()

S_list = list(S)
N = len(S_list)
#print(N)
no_flag = 0

for i in range(N//2):
    if S_list[i] != S_list[N-i-1]:
        no_flag = 1

for i in range(int((N-1)/2)//2):
    #print(S_list[i], S_list[(N-1)//2-i-1])
    if S_list[i] != S_list[(N-1)//2-i-1]:
        no_flag = 1

for i in range((N-3)//2):
    #print(S_list[(N+3)//2+i-1], S_list[N-1-i])
    if S_list[(N+3)//2+i-1] != S_list[N-1-i]:
        no_flag = 1

if no_flag == 1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()

S_list = list(S)
N = len(S_list)
no_flag = 0

for i in range(N//2):
    if S_list[i] != S_list[N-i-1]:
        no_flag = 1

for i in range(int((N-1)/2)//2 -1):
    if S_list[i] != S_list[(N-1)/2-i-1]:
        no_flag = 1

for i in range((N-3)//2-1):
    if S_list[(N+3)//2+i-1] != S_list[N-1-i]:
        no_flag = 1

if no_flag == 1:
    print("No")
else:
    print("Yes")
Problem p02780 (python)

Fixed submission:
N, K = map(int, input().split())
p_list = list(map(int, input().split()))

p_list_E = []
p_list_E_temp = [1, 1.5, 2, 2.5, 3, 3.5]

for i in range(len(p_list)):
    p_list_E.append((p_list[i]+1)*0.5)
#print(p_list_E)

p_list_sum = [0]
for i in range(0,N):
    p_list_sum.append(p_list_sum[i]+p_list_E[i])
#print(p_list_sum)

ans = 0
for i in range(K,N+1):
    ans = max(ans, p_list_sum[i]-p_list_sum[i-K])
print(ans)

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

p_list_E = []
p_list_E_temp = [1, 1.5, 2, 2.5, 3, 3.5]

for i in range(len(p_list)):
    p_list_E.append(p_list_E_temp[p_list[i]-1])
#print(p_list_E)

p_list_sum = [0]
for i in range(0,N):
    p_list_sum.append(p_list_sum[i]+p_list_E[i])
#print(p_list_sum)

ans = 0
for i in range(K,N+1):
    ans = max(ans, p_list_sum[i]-p_list_sum[i-K])
print(ans)
Problem p03164 (python)

Fixed submission:
N, W = map(int, input().split())
w_list = []
v_list = []
for i in range(N):
    w, v = map(int, input().split())
    w_list.append(w)
    v_list.append(v)

MAX = 10**11 + 1
dp = [[MAX]*(N*10**3+1) for i in range(N+1)]
dp[0][0] = 0
for i in range(1, N+1):
    for j in range(0, N*10**3+1):
        if j == 0:
            dp[i][j] = 0
        elif j >= v_list[i-1]:
            dp[i][j] = min(dp[i-1][j], w_list[i-1]+dp[i-1][j-v_list[i-1]])
        else:
            dp[i][j] = dp[i-1][j]
    #print(dp[i]) 
ans = 10**6 + 1
for k in range(N*10**3+1):
    if dp[N][k] <= W:
        ans = k
#print(dp[N])
print(ans)

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
w_list = []
v_list = []
for i in range(N):
    w, v = map(int, input().split())
    w_list.append(w)
    v_list.append(v)

dp = [[0]*(W+1) for i in range(N+1)]
for i in range(1, N+1):
    for j in range(1, W+1):
        if j >= w_list[i-1]:
            dp[i][j] = max(dp[i-1][j], v_list[i-1]+dp[i-1][j-w_list[i-1]])
        else:
            dp[i][j] = dp[i-1][j]
    #print(dp[i])    

print(dp[N][W])
Problem p03166 (python)

Fixed submission:
import sys
# 許容する再帰処理の回数を変更
sys.setrecursionlimit(10**5+10)
# input処理を高速化する
input = sys.stdin.readline

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

lst_edge = [[] for _ in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    lst_edge[x-1].append(y-1)

dp = [-1] * N

# rec(v) 頂点vを始点としたとき有効パスの長さの最大値
def rec(v):
    #print(dp, v)
    if dp[v] != -1:
        return dp[v] # 既に更新済み

    ans = 0
    lst_nv = lst_edge[v]
    for nv in lst_nv:
        ans = max(ans, rec(nv) + 1)
    dp[v] = ans # メモしながらリターン
    return dp[v]

ans_memo = 0
for i in range(N):
    ans_memo = max(ans_memo, rec(i))

print(ans_memo)

Buggy submission (verdict: Runtime Error):
import sys
# 許容する再帰処理の回数を変更
sys.setrecursionlimit(10**5+10)
\# input処理を高速化する
input = sys.stdin.readline

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

lst_edge = [[] for _ in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    lst_edge[x-1].append(y-1)

dp = [-1] * N

# rec(v) 頂点vを始点としたとき有効パスの長さの最大値
def rec(v):
    #print(dp, v)
    if dp[v] != -1:
        return dp[v] # 既に更新済み

    ans = 0
    lst_nv = lst_edge[v]
    for nv in lst_nv:
        ans = max(ans, rec(nv) + 1)
    dp[v] = ans # メモしながらリターン
    return dp[v]

ans_memo = 0
for i in range(N):
    ans_memo = max(ans_memo, rec(i))

print(ans_memo)

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

lst_edge = [[] for _ in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    lst_edge[x-1].append(y-1)

dp = [-1] * N

# rec(v) 頂点vを始点としたとき有効パスの長さの最大値
def rec(v):
    #print(dp, v)
    if dp[v] != -1:
        return dp[v] # 既に更新済み

    ans = 0
    lst_nv = lst_edge[v]
    for nv in lst_nv:
        ans = max(ans, rec(nv) + 1)
    dp[v] = ans # メモしながらリターン
    return dp[v]

ans_memo = 0
for i in range(N):
    ans_memo = max(ans_memo, rec(i))

print(ans_memo)
Problem p03355 (python)

Fixed submission:
s= input()
K = int(input())

ans_list = []
for i in range(len(s)):
    for j in range(i+1,i+K+1):
        if j < len(s)+1:
            ans_list.append(s[i:j])

ans_set = set(ans_list)
ans_list_min = sorted(list(ans_set))
#print(ans_list_min)
print(ans_list_min[K-1])

Buggy submission (verdict: Runtime Error):
s= input()
K = int(input())

ans_list = []
for i in range(len(s)-K+1):
    for j in range(i+1,i+K+1):
        ans_list.append(s[i:j])

ans_set = set(ans_list)
ans_list_min = sorted(list(ans_set))
print(ans_list_min[K-1])
Problem p02606 (python)

Fixed submission:
# from pprint import pprint
# import math
# import collections

# n = int(input())
l, r, d = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
# a = []
# for i in range(n):
#     a.append(int(input()))
cnt = 0
for n in range(l, r + 1):
    if n % d == 0:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
# from pprint import pprint
# import math
# import collections
from numba import jit

N = int(input())

loops = 0


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

@jit('i8(i8,i8,i8)', cache=True)
def calc(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


res = [0] * 1000000

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = calc(x, y, z)
            res[n - 1] += 1

for i in range(N):
    print(res[i])
Problem p02608 (python)

Fixed submission:
# from pprint import pprint
# import math
# import collections
from numba import jit

N = int(input())

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

@jit(cache=True)
def calc(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


res = [0] * 1000009

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = calc(x, y, z)
            res[n - 1] += 1

for i in range(N):
    print(res[i])

Buggy submission (verdict: Runtime Error):
# from pprint import pprint
# import math
# import collections
from numba import jit

N = int(input())

loops = 0


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

@jit('i8(i8,i8,i8)', cache=True)
def calc(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


# 全数字が等しい場合
p_eq = [0] * 100
for xyz in range(1, 100 + 1):
    p_eq[xyz] = calc(xyz, xyz, xyz)

p_ne = []
for x in range(1, 100):
    for y in range(1, 100):
        if x + y > 100:
            break
        for z in range(1, 100):
            if x + y + z > 100:
                break
            res = calc(x, y, z)
            p_ne.append(res)

# p_set = p

# p_equal = []
# p_nonequal = []
# for _p in p_set:
#     loops += 1
#     x, y, z = _p[0], _p[1], _p[2]
#
#     if x == y == z:
#         p_equal.append(calc(x, y, z))
#     else:
#         p_nonequal.append(calc(x, y, z))

# print(p_equal)
# print(p_nonequal)

res = [None] * N
for i in range(1, N + 1):
    if i in p_eq:
        res[i] = 1
    elif i in p_ne:
        res[i] = 3
    else:
        res[i] = 0

for s in res:
    print(s)
# print('lp', loops)
Problem p02687 (python)

Fixed submission:
S = input()

if S == 'ABC':
    print('ARC')
else:
    print('ABC')

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

if S == 'ABC':
    print('ARC')
else:
    print('ABC')
Problem p02953 (python)

Fixed submission:
n = int(input())
h = input().split(' ')

for i in reversed(range(n)):
    if i < n - 1:

        h[i] = int(h[i])
        h[i + 1] = int(h[i + 1])

        if h[i] > h[i + 1]:
            h[i] -= 1
            if h[i] > h[i + 1]:
                print('No')
                exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = input().split(' ')

for i in reversed(range(n)):
    if i < n - 1:
        if int(h[i]) > int(h[i + 1]):
            h[i] -= 1
            if int(h[i]) > int(h[i + 1]):
                print('No')
                exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = map(lambda x: int(x), input().split(' '))
flg = 0

for i in range(n):
    if i > 0:
        if h[i + 1] >= h[i]:
            pass
        else:
            if flg == 1:
                print('No')
                continue
            h[i] -= 1
            flg = 1

            if h[i + 1] >= h[i]:
                pass
            else:
                print('No')
Problem p02548 (python)

Fixed submission:
N = int(input())

N_m1 = N - 1
counter = 0
for i in range(1, N_m1 + 1):
    counter += N_m1 // i

print(counter)

Buggy submission (verdict: Runtime Error):
# A * B  = N - C
N = int(input())
count = 0
for i in range(1, N):
    AB = N - i
    count += len(make_divisors(AB))

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
for i in range(1, N):
    AB_product = N - i
    count += count_divisors(AB_product)

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
for i in range(1, N):
    AB_product = N - i
    count += count_divisors(AB_product)

print(count)