The Art of Making Programming Problems

Hello! Today we’ll explore the wonderful world of creating problems for programming contests. This article could be used as a sort of guide if you’re interested in writing problems yourself, but it’s intended for anyone interested in the process or philosophy behind making problems.   The scope of the article is quite broad, and in its four parts, we will discuss (1) why to make programming problems, (2) how to invent problems, (3) how to plan a contest, and (4) how to prepare problems. Do feel free to skip around if any of these topics tickle your fancy, or if you’re up for it, I invite you to read the article through from top to bottom. A lot of the thoughts presented here are based on my own modest experience with problem setting, mainly for university contests, informatics olympiads and miscellaneous educational purposes. Keep in mind that nothing I say is meant to prescribe a correct way to do things, just to describe what I’ve personally found effective for the work I’ve done. So

Interactive Tasks

Interactive tasks are tasks where your code interacts with another program, often called a grader , rather than simply reading input and printing output. Due to this novel format, people are often scared off and avoid attempting these problems. My goal in this blog is to remove your fear towards interactive tasks. Example Let's start with a basic example, Guess the Number , which you can view in more detail here . There is some hidden number and you have to interactively guess it. The hidden number is always an integer from 1 to 1000000.  You can make queries to the grader. Each query is an integer from 1 to 1000000. There are two different responses the grader can provide: "<" (without quotes), if the hidden number is less than the integer in your query, ">=" (without quotes), if the hidden number is greater than or equal to the integer in your query. When your program wants to guess the hidden number, print "! x" (without quotes), where x is th