sio2project / oioioi

GNU General Public License v3.0
160 stars 70 forks source link

Interactive problems via IO #287

Closed DietPawel closed 3 weeks ago

DietPawel commented 8 months ago

We have a request to support interactive problems via stdio + flush rather than with a library on Szkopuł.

Consider this as an example

MasloMaslane commented 4 months ago

Interactive tasks with IO described by Krzysztof Małysa in his master thesis in point 4.14.1: https://github.com/varqox/masters_thesis/blob/main/main.pdf

Source code for interactive tasks with IO: https://github.com/varqox/sim-project/blob/main/subprojects/simlib/src/sim/judge/test_on_interactive_test.cc

Unit tests: https://github.com/varqox/sim-project/blob/main/subprojects/simlib/test/sim/judge/test_on_interactive_test.cc

DietPawel commented 4 months ago

I think we can get away without introducing third process to forward the communication as described in the 4.14.1 by utilizing WTERMSIG on status from waitpid(2). If the user process returns due to SIGPIPE we can ignore it if checker gave us the answer or treat it as SE when checker did not gave the verdict.

geoff128 commented 2 months ago

https://docs.google.com/document/d/1UEEOPyCRUpJRQv_nfrapkYvn31wIE604Z6beHlZPiW8/edit?usp=sharing