consider the following example:
\documentclass[a4paper,final]{report}
\usepackage{cleveref}
\usepackage{algorithmic}
\Crefname{ALC@unique}{Line}{Lines}
\begin{document}
Tests:
\begin{algorithmic}[1]
\REQUIRE $x$ and $y$
\ENSURE $|x + y|$
\STATE $z = x + y$
\IF{$z<0$}
\RETURN $-z$\label{l1}
\ELSE
\RETURN $z$
\ENDIF
\end{algorithmic}
cref\{l1\}: \cref{l1}, ref\{l1\}: \ref{l1}
\begin{algorithmic}[1]
\REQUIRE $x$ and $y$
\ENSURE $|x - y|$
\STATE $z = x - y$
\IF{$z<0$}
\RETURN $-z$\label{l2}
\ELSE
\RETURN $z$
\ENDIF
\end{algorithmic}
cref\{l2\}: \cref{l2}, ref\{l2\}: \ref{l2}
\end{document}
This will output (apart from the pseudocode):
cref{l1}: line 3, ref{l1} 3
cref{l2}: line 9, ref{l2} 3
As you will notice, \cref{l2} returns an incorrect line number. Any suggestions on how to fix this?