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

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:)

QUESTION REGARDING : FIND THE MAXIMUM VALUE ( LOST MAX )
alt text

alt text

FIRST IS TESTER SOLUTION SECOND IS MY SOLUTION LINK JUST SEE LAST LOOP TO FIND MAX ELEMENT AND IGNORE USE OF stl sort in my solution when I submitted it says WA and when I use test logic of bool variable it accepts the solution ?? I want to know why my solution failed ?? and how do I gain reputation so I can ask question on my own ?? how to get karma ??? thx
Best Regards
Syed Ashar Ali

1 Like

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

Hey, kunnu120, was your question answered? I noticed you deleted it when i was converting it into a independent question.

1 Like

Hey i am new here… have done coding before but new in these online coding field.Can you tell me how to approach the constraints placed in various questions?How should approach handling such an constraint related error? I mean the program I have written for a particular problem runs well in my machine but when submitted here says its incorrect. I have entered all the sample inputs as given and its running well for me at home.

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

On this recent cookoff, the contest length was 2.5 hours but people have submission times (on just one problem, not a sum) of 4-6 hours. Secondly, some problem had a time limit of 3 seconds but some submissions were 5 seconds. Are those types of stats displayed accurately? Or do those limits not really apply?

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

Yes ot includes penalty. Yes, JAVA is given max memory for reason, irrespective of array/var yoy declare :slight_smile:

1 Like

You are so helpful. Thank you!

1 Like

can anyone tell me from where i should study to solve questions related to trees and graphs ???