Time Limit Exceeded (TLE) - Why ❓ and how to Figure our Right Time Complexity ❓
Вставка
- Опубліковано 28 лис 2017
- Frustated with a TLE Error. Watch this video why does an Online Judge throws TLE and how to write algorithms that follow the given constraints what complexities get accepted and when.
Like our FaceBook Page - / codingblocksindia
Follow us on Instagram - / codingblocks
Follow us on Twitter - / codingblocksin
Source code available on -github.com/coding-blocks
For more interesting tutorials - / @codingblocksindia
Become a professional programmer with Coding Blocks' Online Courses. Visit cb.lk/2T7WP to explore all courses. Use Coupon Code "UA-cam" to avail 25% Off on Our Courses.
sir, i have a doubt if some code has complexity of O(n^2). and in the question highest possible value of n given is 10^4. so how the complexity of O(n^2) can work??? because in 1 sec, in total 10^8 operations are allowed. But if the highest possible value of n is (10^4). then our code has more no of operations than 10^8 , because in actual some constant k also multiplies with n^2:-
if value of n =10^4
K*n^2=k*10^8 > total no of operations allowed in 1 sec , i.e. 10^8.
so how the complexity of n^2 is allowed for the question which has range of n as below:-
1
This is one of the most important video in competitive programming community
Finally I get it .why we use time constraints . Thanks you
The table is good to quickly know abt Worst case complexity ur code can have
Great Explanation Prateek Sir. Keep up the good work
Thanks Pooja
These many day i got frustrated. You cleared my doubt 🤷♂️. Thank you very much sir.
i have a doubt if some code has complexity of O(n^2). and in the question highest possible value of n given is 10^4. so how the complexity of O(n^2) can work??? because in 1 sec, in total 10^8 operations are allowed. But if the highest possible value of n is (10^4). then our code has more no of operations than 10^8 , because in actual some constant k also multiplies with n^2:-
if value of n =10^4
K*n^2=k*10^8 > total no of operations allowed in 1 sec , i.e. 10^8.
so how the complexity of n^2 is allowed for the question which has range of n as below:-
1
can u pls help me
Is it inclusive of test cases or not?
just now you introduced me to something exciting!
Is there any ide or online compiler that let me known about the time of compilation of my code...
My favourite video on UA-cam 🙏🙏❤️🔥🔥
Thanks for the beautiful explanation!
can anyone please tell me which tool is he using to draw and sketch
I use python for dsa , do i get more time exceeded errors while running the code compared to cpp or java
Globephone Mera Ek Number Ko Nahin Lagta Hai aur switch off bataya jata hai jabki aur mobile khula rahata hai Kisi dusre ke sath Baat chal raha Hota Hai usko Kaise band kiya jaaye Mere Naam Ka sim hai please answer me
Keep adding such videos, Prateek sir u explain so well!
Thank you Dimple for your feedback :D Glad you enojoyed it.
Great explanation. Thanks a lot.
very useful, thank you!
Thanks for your comment
Can you please tell me fast input output for python?
Is fast I/o necessary for Java
just would have mentioned that whatever the complexity you use, don't go beyond 5e8 - 1e9 operation
My question is, I've used the same algorithm in different programming languages, but Java tends to always have the TLE. I've been coding in Java since I learnt coding. How do I fix it?
Java zyada time leta hai compile n all mei.. codeforces mei i wrote a code in java and wrote the same code in c.. c took 30 ms while java took more than 300ms for the same code..
I like the way you say 'and'....😂😂
thank you. keep making videos
👌👌👌
it's very help video
Thanku so much sir 🚀🚀🚀🚀🚀🚀
Thanks
good
What does he mean when he said c and c++ more closer to the hardware
When i see the thumbnail of video i thing there we will do something with the processor but it is all about optimization.
How to avoid run time error
Use fast i/o at starting of main() i.e.
ios_base::sync_with_stdio(0);
cin.tie(0);
just use scanf and printf
Best Explanation.Thanks for the video
It is guaranteed that the sum of n over all test cases does not exceed 105.
What that the above means.. anyone????
What was the trick here. It was all optimization 💩
That is the trick lol
I can here your cpu noice. excellent.
What a operation means here
bhai solution bata turboC me, explanation nahi chahiye.. 1850+ lines ka compilation kaise karu
why cin and cout are slower than scanf and printf?
cuz in printf scan f u acually tell what type of data it is
because that you are providing address of the data type which is really faster when comparing just only with data which in in cin and cout
thank you.
Please use a good quality microphone!!
Wasted 11:33 mins
coding m koi jaadu ni hota ki cheatsheet lgai or test cases pass hgae. He just gave you a way to move in a right direction.
Go and sell groceries
How log(10^18)=60 ???????
Log here is with base 2 so
log(10^18)=18 log base 2(10) =59.something~60
@@darshantawte7435 log10(base2) = 3.32___ and here log(10^18)base2= 18 * 3.32__~=59.__==60
mast tutorial tha bhai
the quality of voice has to be better
awesome!!
thanks
i didnt understand anything
Claps👏👏👏
why your competitive programming course in hinglish i don't know hindi
1:02c