The input data for Problem 368 contains an error

Back to General discussions forum

kajuyone     2026-04-04 01:06:10

The following message appears in the input data for Problem #368. Input generation error - tell admin please:sh: line 1: python2: command not found”

Rodion (admin)     2026-04-04 19:20:15
User avatar

Thank you for reporting the issue!

It seems hosting provider made some massive software update on the server and we have several issues at once, including loss of the python2 used in checkers of almost 100 problems provided by Clive - and login with Google is broken again.

(on the other hand they at last updated python3 to 3.9 - it is also used in some problems)

I'll try to figure out necessary fixes but it may take some time, thanks for your patience!

CSFPython     2026-04-04 20:03:50

Rodion,

Would you like me to go through each of my problems and convert the checkers to python3 ? I am more than happy to do that if this will resolve the problem. I assume that I would need to send you the updated files.

Rodion (admin)     2026-04-04 20:30:29
User avatar

Dear Clive, thanks for the suggestion - but I believe it would be quite toilsome approach :)

So I'm going to investigate some other options. For example I'm sure we can use sandbox to run python2 (in form of pypy2 at least) and most probably this will be sufficient for most of the tasks!

Rodion (admin)     2026-04-04 22:14:22
User avatar

P.S. on the second thought the idea itself - about converting code - sounds good as it gives more hope about functionality won't break when there'll be completely no any python2 interpreter available. I'll look into it too, but hopefully we'll need not do it manually. I remember there were some tools - and perhaps it would be good to give them a try!

UPD: it looks that some (perhaps many) checkers need very minimal corrections. For the problem 386 I only added parentheses for print... (hopefully someone can verify please)

Rodion (admin)     2026-04-05 08:02:44
User avatar

Should be fixed now

As mentioned above, for now the changes were made so that python2 checkers are executed via our "sandbox" - the main visible drawback is that loading of input data takes few seconds, but hopefully in other regards it works (please test).

Perhaps meanwhile I'll try updating python2 checkers to python3 by and by, as suggested by Clive, in hope to reduce chance of future inconvenience.

CSFPython     2026-04-05 15:57:24

Rodion,

It is correct that my checker code is likely to need very little alteration in order to convert it to python3. As you say, the print statements (probably just one right at the end) need changing. The most important change is to identify all of the division statements. Clearly integer division requires // in python3 but it is important to identify those divisions which are for floating point. These must not be changed to //. I use only a small subset of python2 with very little use of libraries so it is possible that there are no other changes that need to be made.

In problem 368 there are integer divisions which need to be changed to //.

Please login and solve 5 problems to be able to post at forum