szawinis's blog

By szawinis, history, 8 years ago, In English

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?

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it

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

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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?

»
8 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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.