我有如下代码。我不知道为什么我不能使用算法环境。您能帮我解决这个问题吗?
\documentclass{article}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\begin{document}
\appendix
\renewcommand{\thealgocf}{\thesection.\arabic{algocf}}
\setcounter{algocf}{0}
\section{Appendix}
This algorithm \ref{alg1}.
\begin{algorithm}[H]
\caption{The assignment procedure}\label{alg1}
\algsetup{\small}
\scriptsize
\begin{algorithmic}[1]
\State Retrieve input parameters, including the intended room ($r$), the required qualification level ($q$), and the array of tasks required by room $r$ ($T$)
\State Propagate each element of array $T$ based on the number of SMs required for the relevant task
\State Detect qualified SMs for serving tasks of type $q$ (store in $C$)
\end{algorithmic}
\end{algorithm}
\end{document}