If an algorithm solves an NP problem, for what f(n) can we claim that R belongs to TIME(f(n))?
Suppose, for clarity:


$X$ is the input, and $|X|$ = $n$
$Y^*$ is a "yes" certificate, $|Y^*| \leq 5\log n$ bits
$M$ is an algorithm that verifies the instance $X$ given certificate $Y^*$ in
$O(n^3)$ time.


There are $2^{|Y^*|}$ possible binary certificates of length $|Y^*|$, so algorithm $A$ that checks all possible certificates $Y_i$ of length $5\log n$ will have exactly $ 2^{5\log n} = n^5$ certificates to check.

Since each certificate takes $O(n^3)$ time to verify (with $M$), $A$ will run in $O(n^8)$. If $X \in R$, a certificate $Y^*$ that verifies it exists and $A$ will find it (because it checks them all).

It follows that $A$ accepts $R$ and runs in $O(n^8)$ time, so $R \in \textbf{TIME}(n^8)$