http://zzslgnlst7nqevy4lk4gt45dawmurnvfiqwuaevbr3no55fhh622wfqd.onion/Articles/4:Stress_testing.php
Демонстрирую: TIME_LIMIT = " 1 s" def solve(test):
c = subprocess.check_output(f "timeout {TIME_LIMIT} {EXEC_FILE_NAME} {test}" , shell=True) return c.decode() # noinspection PyShadowingNames def do_test(solve, solve_correct): for test_num in count( 0 ): print (test_num)
test = make_test(test_num)
ans_correct = solve_correct(test) try: ans_incorrect = solve(test) except Exception : # Тут RE или TL, их можно различать, но вы лучше сами сделайте .