Could anyone take a look at the below code and tell me where I could be going wrong?
I really want to understand before I take a look at the editorial.
Thanks in advance!
Link to solution:
https://www.codechef.com/viewsolution/30554563
Could anyone take a look at the below code and tell me where I could be going wrong?
I really want to understand before I take a look at the editorial.
Thanks in advance!
Link to solution:
https://www.codechef.com/viewsolution/30554563
Please just post a link to your submission - screenshots are hard to debug
Will keep that in mind, edited the post
Thanks
It seems to be the same mistake nearly everyone makes
See e.g. Noob here, what's wrong with my code? (TLG) - #3 by ssjgz
To be honest, I think it’s one of the rites of passage here
When I read this problem first, I made the same mistake of not looking at cumulative scores
Yeah same
Is there a way of finding out what test cases are failing or is it just trial and error?
Since you’re starting out, here are a few things to know
Codechef does not provide test cases as (I think) it would make the whole job easier of arriving at the solution and lessen the fun of getting the AC all on your own so even though you get a WA, read the question again to understand, test for corner cases, out of bounds and think of a solution that passes the time limit
Whenever you ask for help, along with a coherent description of your concern, add your code enclosed in three backticks (```) !
And keep practising, have fun and compete in contests, yay!
https://www.codechef.com/viewsolution/64585986
hi experts , please help me with my code I am getting one single subtask WA , thanks in advance !
The following is another possible update.
Your code fails when one of the two players wins all the N rounds. In this case, one of the two lists xlead or ylead is empty. Using the max function to find the maximum item in an empty list should have produced a run-time error. However, as you are using try to bypass any run-time error, the Python interpreter ended your program silently without executing any print function call.