Time complexity

how many operations can we perform in 0.5,1,1.5,2 sec?

It Depends On Your Code!!! And System Also

1 Like

You can perform about 10^8 operations per second.

1 Like

thanks,but if i’ll be given 2 sec than number of operations are 2*(10**8) or something else.
thanks in advance:)

1 Like

Yes in 2 seconds you will be able to perform 2*(10^8) operations

Yes you may go through this:

Though As Per GeeksForGeeks Its 10^8
Link To The Post: How An Online Judge Works And How To Avoid Time Limit Exceeded Problem? - GeeksforGeeks

Yes I’ve mentioned this above…

But here I’m trying to point out how the time limit for specific question matters and how the solution needs to be optimised for various languages.

I Think, Because Those Kind Of Question Have More Input Than Others And That Can Be Done In Limited Time Constrains @manvi_03

That’s what “how does the time limit work” is for!

if the input contains multiple test cases, your code must complete ALL of these within that time limit. If the time limit is 2 seconds, and there may be 1000 test cases, your program shouldn’t be taking 1 second per test case - it needs to run all 1000 in under 2 seconds.

Some programming languages are slower than others, and are thus given more time. Currently, Java and Python are allowed twice the time limit, while Ruby, PHP and Lisp are allowed to run for up to three times the time limit.

Ah! The text is clearly copied word to word from the link I’ve already posted above in this thread :slightly_smiling_face::slightly_smiling_face:

Summary

P.S.: It’s good manners to give credit to the original poster/ mention the source/ paste the original link when the text doesn’t belong to you. I hope you aren’t again re-replying the already given answers?

3 Likes

I thought you only copied codes, but you seem to be a pro in this.

4 Likes

There have been multiple instances where he just copied any one of the replies above in a thread and passed as his own.

For example-

4 Likes

Haha! Probably searching previous comments!

2 Likes

Seems like someone’s advice back fired, you guys took his suggestion seriously

1 Like

Just like someone’s level of practice and contest problems are poles apart.


image credit: @koolprogammer via cc

1 Like

Of course he probably doesn’t even knows what an adjacency list is and he is solving tree problems in one shot just after a bunch of compilation errors which is enough to prove that he is cheating just let the contest end, it’s gonna be a lot of fun to check his submissions.

1 Like

Endlessly glad the Internet wasn’t a Thing when I was growing up :slight_smile:

4 Likes

I don’t want to be villain but here it goes-
He helped someone here-

He just picked up the first submitted AC submission (second last in the list) of the practice problem and pasted in the forum after removing the comments.

He probably doesn’t even understand what interactive problems are.

4 Likes