Skip to main content
6 events
when toggle format what by license comment
Oct 20 at 20:33 comment added toolic @MartinR: I appreciate you taking the time to clarify your original comment. I wasn't quite sure what you were trying to convey, but I understand it better now. These TLE questions are always a bit tricky, and the answer is often to scrap the code and start with a new algorithm/approach. I leave that up to the smarter users, like the 1st answer, then I try to backfill with more straightforward advice.
Oct 20 at 20:11 comment added Martin R @toolic: I did not say that your review does not have value (and I did not vote on your answer). I wrote that comment because I assume that the code for reading the input data is written as it is for a reason, and adding an input prompt (as you suggested) might even prevent a successful submission on that site. I know that all parts and aspects of code can be reviewed, but (IMHO) there is also context to consider. Here the context is a submission to a programming challenge site, and not an interactive program.
Oct 20 at 19:50 comment added toolic @MartinR: I am aware the question relates to a contest (I added the programming-challenge tag to the question before I posted my answer). While I am unfamiliar with the mechanics of the CodeForces site, my review of the code as posted in the question still has value. All code posted in a question here is eligible for review, and I made several specific suggestions with the intention of helping the OP and any other readers. If there is something unclear about my answer, I would appreciate specific suggestions for improvement.
Oct 18 at 17:07 comment added Chris The "main" part of the code might still be in a main function. This can either be then simply called or wrapped in a main test.
Oct 18 at 15:45 comment added Martin R The program is meant to be submitted to a programming contest, not to be run interactively. It could be that the "main" program is part of the Codeforces submission template.
Oct 18 at 10:58 history answered toolic CC BY-SA 4.0