While the first part of gnasher729's answer gives a good intuition for how to answer any such problem in a time that anyone can see is clearly $O(1)$, there's another way to see that the $O(1)$ claim holds even if we don't do any precomputation and storing of answers.
The thing about bounding the input size by some constant $k$ is that, if you do this, then regardless of what algorithm you use to solve the problem, provided that it eventually terminates on every input of size $\le k$, its worst-case execution time on a size-$n$ input for any $n \le k$ can be described by some function $f(n)$ -- and if all the things that you put into a function are bounded by constants, then what comes out is also bounded by a (probably different, possibly vastly greater) constant.
The overall worst-case execution time for such an algorithm is then just the maximum of $f(n)$ over all $0 \le n \le k$ -- and the maximum of a finite number of numbers, each of which is bounded by the same constant $c$, is also bounded by $c$.
IOW, even if the algorithm computes everything "the usual way" instead of precomputing all possible answers and storing them (or even if it computes them in "the dumbest, brute-forciest possible way"), the execution time can still be said to be $O(1)$.