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

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

There are lot of competitions which do not allow to submit your solution after contest's end(CEOI,COCI,IOI...), but they publish test data. I think it is very hard to manually compare output data with diff and it would be much more simpler if there was program for that. Isn't there something like that? Isn't there a nice coder who could code that for us? :D :D Sorry for english.

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

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится +9 Проголосовать: не нравится
»
10 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Assuming that test data are *.in/*.out files:

for in_file in *.in
do
    etalon_file=${in_file%.in}.out
    out_file=${in_file%.in}.myout
    
    ./program <$in_file >$out_file && diff -w $etalon_file $out_file && echo "$in_file : AC" || echo "$in_file : WA"
done
»
10 лет назад, # |
Rev. 3   Проголосовать: нравится +4 Проголосовать: не нравится

Upreckon is a very advanced local testing system, which allows you to specify input data filenames with either Python code or regular expressions (for most of the tasks, you'll just specify a mask like 'test.#.in' and the list of possible values for #).