You are viewing a single comment's thread. Return to all comments →
I think there is a problem in the input of the tests case of OCaml. Just doing the simple
let a = read_int ();;
that should normally read the first line of the input (the number of tests cases), fail with the exception
meaning that the conversion was impossible. There's probably an odd character or byte in the input that' s not displayed when it's printed, because when I copy/paste the inputs of the tests cases as displayed in my browser and run them with "Test against custom input", they execute without errors.
Same problem here :c
I opened a ticket, but never obtained a satisfactory answer/solution. I worked around the problem by using Scanf, which is anyway more flexible.
read_line works as well, but of course you have to manually call int_of_string on the inputs
Same issue here. I finally wrote it using my own conversion functions.