Hii guys I wanna know about the time complexity of int comparison in c++ also what is the time complexity of multiplication and other basic operations can anybody give a cheat sheet sort of thing help me Thanks in Advance

Well, a rule of thumb is to consider addition, multiplication, division and modulo, < , > , == as O(1) operations. However, division and modulo are a bit more â€ścostlyâ€ť operations. But usually you can neglect it. (Assuming your time limit is 1s and your program performs < ~1e8 operations, you wonâ€™t get TLE for sure).

1 Like

but in general, multiplication is more costly than addition, right ?