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

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

Sometimes it happens that I solve the problem and I have tests, but I can't find problem on the internet. So I need a tester that can test my solution on tests. I tried to find it on the internet, but I can't. I will appreciate if you give me such program. Thank you!

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

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

I use Hightail for contests (http://codeforces.com/blog/entry/13141) and it works really well. It's open source -- maybe you could adapt it to read files?

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

    I also use Hightail for contests. It is really cool program. But it is a problem in it. Hightail can't work without contest(or task in CodeForces, CodeChef etc). And I want a program that will work with tests on my computer. Just tests and execution file. And it checks and I get AC, WA...

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

      A simple bash script would suffice. Something like this:

      for f in *.in
      do
        test_name=${f%.in}
        if ! ./solution <$test_name.in >$test_name.myout
        then
          echo "$test_name: RE"
        elif diff -bB --strip-trailing-cr $test_name.out $test_name.myout
        then
          echo "$test_name: AC"
        else
          echo "$test_name: WA"
        fi
      done
      

      (Obviously if the answer is not unique, you'll have to replace diff with a manually implemented checker.)

      Alternatively, you could use my caide software which has other features in addition to tester.

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