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

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

Recently, I find there are many interesting interactive problems on many platforms, including Codeforces. Usually, the example testcases and generated cases are rather small and it is easy for me to type in and test it directly on the C++ IDE console. But, if the tests are as big as in 1100D - Dasha and Chess, I can't afford to spend hours typing that in (who does that anyway ==). Of course test it directly by submitting it is a solution to this problem, but what if there is a small bug in my code, how can I find it?

I find this blog rather interesting: https://mirror.codeforces.com/blog/entry/49490. It said something about the Croupier (the Interactor), which is exactly what I'm looking for. But it is implemented in Python, so there are many unknown syntax for me, and I'm unable to translate it to C++ to use. Can anyone help me out?

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

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

If you mean you just want to test your program on given jury's input that does not depend on your answers, you could simply create input.txt and read it from here. If jury's input does depend on your answers, but in the simple known way (for this test) (such as interactive binary search problem), you could write your own interactor (just calculate jury's answers inside your code). Otherwise there is no better solution rather than typing.

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

    How to implement an interactor in C++??

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

      Perhaps I shouldn't use such a strong word. I just said, rather then write cin >> juryInput you could write juryInput = foo(yourAnswer) if you could deduce or assume this function foo for given problem/test.