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

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

Does anyone know how to manually check coded solution against large tests? Many of the new USACO problems haven't been uploaded to an online judge that I know of yet, so I would like to check the solution myself. Obviously, I can't go through each line of the test and compare their output to my output. Any suggestions?

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

»
9 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

You can write a program to compare two files or use this

  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Thanks for the reply. I'm also wondering if there are any online judges that allow ordinary people to upload problems with test cases and judge them on the server?

»
9 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Both linux and windows have a built-in diff program.

On linux: You should probably know what a terminal is. If not, you will probably find it in the menu. Move to the desired folder by writing cd path/to/files. Compare the files using diff file1 file2. You can set some options, I usually set -b (to ignore whitespaces, which means that you don't have problems with line ends) and -q (which only says that files differ or says nothing, instead of showing all differences).

On Windows: Run a program called cmd. Move to the desired folder by writing cd path\to\files. Compare the files using FC file1 file2. I don't know how to set options here but surely it's possible.