This year in our programming competition in Samara (link) there was also an experimental contest with a marathon problem. You could face these problems at Marathon 24, Deadline 24, Google Hash Code, and recently at ICPC Challenge. It turned out Codeforces supports these problems, and this post is a tutorial how to prepare them. If MikeMirzayanov don't mention it, I'll do it.
Contest link: 2020, XIII Samara Regional Intercollegiate Programming Contest (marathon problem)
The duration of the onsite contest was 4 hours, so you can participate virtually and compare your results with onsite results:
- Onsite 1st place: 294993 points
- Onsite 2nd place: 290891 points
- Onsite 3rd place: 272036 points
- Onsite 4th place: 180972 points
- Onsite 5th place: 165657 points
- Current upsolving record: 344110 points
So, how to prepare such problems and contests? Actually it is very easy. These are the differences from the standard problems:
- the problem should have only one test that should be uploaded somewhere in advance (for example, to gist.github.com). Then give participants the download link.
- use function
void quitp(double points, const std::string &message = "")or
template<typename F> void quitp(F points, const char *format, ...)in checker.
- don't output anything to stderr in checker (to be precise, don't output too much to stderr), for unknown reason it breaks the checker and it starts to always return 0 points. I don't know why this happens, but that's it.
- change the contest type to IOI in the contest settings (by default it's ICPC).
- it is impossible to set Text language in the contest settings, but luckily there is a magic language PHP, which works exactly like Text for such problems and just redirects the program code (your output) to stdout. You have to be sure that any possible output for the test fits into source limit.