Skip to main content
5 events
when toggle format what by license comment
Feb 13, 2017 at 8:36 comment added ChatterOne I don't know if this is the case, but on some of these platforms you can't really read one test case, print the output, read another test case and so on. Sometimes the output is not considered until all the input has been sent, at which point you're only outputting the last case and the test will fail, even if it's actually correct. So if something fails, just store the input and print the output after that.
Feb 13, 2017 at 0:41 comment added 301_Moved_Permanently @RenéG It doesn't matter that much here, but sometimes it can be useful to be able to define some parameters (possibly with default values). And thus testing different values will be made easier in an interactive session.
Feb 13, 2017 at 0:30 vote accept Elliot Gorokhovsky
Feb 13, 2017 at 0:30 comment added Elliot Gorokhovsky Thanks for your detailed response! I'm not sure I see how using a main() could be useful in competitions; it's extremely unlikely that I would import code between problems. Each problem is solved by a single-file program that's usually under 100-200 lines. Anyway, I really like your two-dimensional list-comprehension syntax there at the end!
Feb 13, 2017 at 0:18 history answered 301_Moved_Permanently CC BY-SA 3.0