Preprocessing: time, space. You build the sparse table once. Queries: per query, where is the jump distance. In the worst case, , so queries take . If you have queries, total time is . For and , that is under million operations.
This is fast enough for any competitive programming time limit.