Блог пользователя Enchom

Автор Enchom, история, 10 лет назад, По-английски

Hello everybody,

I've been practicing for a while now with some old competitions and, as you know, many of them are not uploaded on any online judge so you have to test your solutions by yourself. For this purpose I use Codeforces Gym and prepare the problems in Polygon. The trouble comes from the fact that not all of the competitions provide model solutions. Most of them give the test data, but it is in the form of input-output files and from what I've managed to understand — Polygon wants a model solution to generate output files.

My question is : Is there a way to prepare a problem in Polygon by manually uploading the correct outputs of the tests and having no model solution?

Thanks in advance!

  • Проголосовать: нравится
  • +35
  • Проголосовать: не нравится

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Unfortunately no. If inputs and outputs are small, you can just hardcore them into a model solution, if not... well, you can write a model solution as an exercise.

»
10 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -9 Проголосовать: не нравится

Well, you could always write a small script that would read some few lines of input and compare the variables to the input and print the answer. Of course, this is not very efficient but you can do it.

Example: Input is N, M, you could just write something like

if(n == X && m == Y) print Z

A way to simplify this a lot would be to make add a unique identifier to the beginning of the test which your solution could ignore. Example, start input1.in file with the string "IN1". This string could be read by checker program which would print corresponding output. Writing a script to write this program for you is also quite straightforward.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +127 Проголосовать: не нравится

You can locally add outputs to the end of inputs. Model solution will read (skip) input and then read-and-write output. You are practising so you will not use this hack during the contest.