Range of inputs

General topic about Valladolid Online Judge

Moderator: Board moderators

Post Reply
New poster
Posts: 2
Joined: Sun Dec 06, 2015 3:01 pm

Range of inputs

Post by TrL » Mon Dec 07, 2015 12:12 am

I've just started a attempting a few problems on this site and it feels like some of the problem descriptions are mission some information. For example, for problem 100 (3n+1) we know that the input n satisfies 0 < n < 10000, but we don't have an upper bound on how large n will become when running the algorithm. I used 32-bit ints to store the information and got CA, but perhaps I just got lucky, maybe some untested input would overflow. Am I missing something here or should the problem description state that any sequence generated by 0 < n < 10000 will be bounded above by 2^31-1?

In problem 102 (Ecological Bin Packing), however, things are clear as it states that:
The total number of bottles will never exceed 2^31.
I'm now up to question 103 (Stacking Boxes) and yet no bound is given on the size of the measurements. From glancing at the posts pertaining to this problem it looks safe to assume that the inputs will fit into a 32-bit int, but this is not stated in the problem. If we assume arbitrarily large inputs then the problem seems to get much more complicated.

So what I'm getting at is if no bounds are given for a particular problem how are we supposed to handle the input? Do we assume that numbers will fit into 32-bit integers unless otherwise stated?

Post Reply

Return to “General”