test my program locally for multiple test cases

can you please tell me that if my algorithm has complexity of O(n) and i am taking n=10^6 than it becomes O(10^6). what is the meaning of this. Or i can’t say like this?

see the table in this link - CompSci 101 - Big-O notation | Dave Perrett

It tries to describe how “bad” is O(n^2) to O(n).

How to say it simply, try this example. Let say you have program with O(n) complexity (linear) and for 1000 items it runs for 0.1s, when n is 100 times bigger, then your program will run 10 seconds.

If another program has O(n^2) complexity and it runs for n=1000 0.1s, for n 100 times bigger it runs 100^2=10.000 times longer so instead of 10 seconds as in O(n) it will run 1000 seconds = ~17 minutes.

@tijoforyou: I know, that was just example from Slovak judge.

As I say, you can use command time if you work under Linux. Otherwise I don’t know, but sure it’s possible. But that will give you just very rough estimation.

@betlista is it possible to find time for my own machine rather than for codechef machine so that i can have a rough estimation