Input format

Input format

Hello everyone,

This is just to avoid any confusion about the input and output formats: is it safe to assume that the numbers in the input file are separated by exactly one space? And lines are sperated by exactly one new line (\\n)? Also, is the last line of numbers have a new line (\\n) at the end? If so, should we assume that the last line of an input file is a line of numbers ended with a new line, that is there are no extra lines (\\n) other than the one ending the last line of numbers?

The output format looks straightforward, just the solution upper left and lower right indicies with the x component printed first, and each solution is on a newline. Please correct me if I am wrong.

Thank you.

7 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Yes, from the other posts that I saw, the input are considered correct (like you described it), and this is the correct output.
Also, you may want to post on the english version of the forum

Thank you for the quick answer. Just to make sure, because this is becoming a bit confusing for us, which of the two inputs is the correct one:

input 1:
12 32 54 -67\n43 54 65 341\n

input 2:
12 32 54 -67\n43 54 65 341

I think you can assume and provide your assumption in the documentation.for me, i work on the 2nd input.

I am assuming input 1 format. I understood that testing will be automated, and handling the input can go horribly wrong if wrong assumptions are made, as no one will check how you took the input. Handling possible cases might be too costly and aren't really necessary as the format will be of just one type.By the way, sorry for the english post on the french side forum, I thought it was a mixed forum.

If a final \n is breaking your program, then you possibly do it the wrong way.
Just check that the final line contains elements, if not, that's an empty line, decrementing your "height" counter should do the work.

Thanks for the tip. Feels better. We just didn't want to have cases and whatnots, but this one just had to be.

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui