College Life 2 ( made everything long long int but still WA)

Problem : Contest Page | CodeChef

My-solution : Solution: 66687412 | CodeChef

There is something wrong in my code, I tried making everything long long int but it still gives me WA. It passes all test cases but gives WA after submission.
Please give me some hint as to where am I going wrong?

Why are you making your solution so complicated?

1 Like

your fixed solution: Solution: 66695269 | CodeChef
(you printed sum_episode_length as an int instead of long long. Some variables should have been long long)

your fixed solution slightly improved: Solution: 66695148 | CodeChef
Just Note that nesting your loops that much will not work long term. It makes your code far too confusing for even easy problems. It is fine if you don’t have a feeling for that now, just make sure to improve yourself. Read other peoples code.
Example clean solution: Solution: 58342283 | CodeChef

1 Like

Yes you are right, I have to change my format specifier, Thank you.

To remember all concepts and syntax I try to forcefully use some concept in program, it helps me learn more how a program would behave.
Would definitely write better code in future. :slightly_smiling_face:
Regards.

1 Like

Experimenting while practising is cool. But do not try the same during a contest.:slightly_smiling_face:
Projects are an excellent way to try new things - you can benchmark the performance and compare whatever you’ve tried.

1 Like