"I want to ask a question" - Ask them all here!

also i have tried most trivial changes as well…still it runs at 0.11 millisec at best!

Is the editorial unclear to you? If yes then i will elaborate, else its fine ^^

sorry… editorial wasn’t uploaded when i asked the question and thanks for the reply, i then checked it and understood the editorial.

Check the editorial once, if things are not clear i will explain. No, lazy propagation was not needed there.

You have to earn that privilege by participating in discuss forums.

You can, however, “accept” answers of your question to award yourself 2 karma and answering user 15 karma (it works same as upvote but is only available to the person who asked the question)

Did you try geeksforgeeks.org ??

yeah did some problems but not sure of dp for tougher problems

Oh, you want Q. Try the “Tag” feature at codechef to see the relevant questions with their accuracy rate. I think that should give you some thought provoking Q. Also, Hackerrank’s dp section has some nice problems (which are tough as well- if you are looking for challenges).

ok thanks:)

https://s3.amazonaws.com/codechef_shared/download/Solutions/LTIME50/Tester1/LOSTMAX.cpp

https://www.codechef.com/viewsolution/14743326

IDK I ATTACHED LINK IN QUESTION BUT THEY ARE NOT SHOWING UP SEE LINKS IN COMMENTS BELOW

I tried this:

1
5 2 4 5 4 2

Your code gave output 4, while the real output is 5. I think you are missing the part when the number of numbers occurs twice. BTW, I’ve upvoted you so now you can ask questions.

@dhruvsomani thanks a lot

you can get some more problems on codeforces

In this case, there must be some corner case where your code fails. For example, take code which tells if a number is prime. Your code might run good on numbers b/w 2-100, but if it says 1 is prime, then its wrong.

All in all, there is some case which is proving your approach to be wrong, try to think what it could be.

Oh god.I just messed up my code display here.Very Sorry.:frowning:

Also, a big thank you to @vijju123 for making it possible for us to ask questions.

1 Like

Time limit is diff. for different languages as some languages are slower than other. What do you mean in your firsg point?

1 Like

Ah, if Java has 2x the time as C/C++ then that explains it. Does Java also have a bigger memory? Some solutions to TRCNTCT have > 4000M usage.

On the second question if you go to the end of the ranklist and put your mouse over a user’s solution it says Total Time like say 5:44 hours. Now I am wondering if that includes the 20 minutes per wrong submission penalty converted into the time?

Thanks!

@vijju123 sorry for the late reply, I had a logical error in my question so I deleted it