Get Time
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (oldest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
Re: About the format of arguments (response to post by stoundmire) | Reply
I think they do this because there is some (unstated?) rule somewhere that arrays won't be larger than 50 elements.

So if the author wants to have more than 50 ints as input (here, there could be up to 500), then this is how the author has (sneakily?) done so.
Re: About the format of arguments (response to post by stoundmire) | Reply
2. There is the idea that the TC arena system cannot support more than 50 elements in an array. So much that it became a defacto standard that is enforced even by the local test case window which will not allow you to insert more than 50 elements in an array. Even though the TC system seems to do fine with 150 integers in the last test, and I would dare to say that the strings of 2500 characters are already larger than an array of 500 integers.

Regardless, problems cannot allow more than 50 elements in a single vector. Thus a work around is to send them all in a string.

1. Yet strings are subject to a similar limitation, 50 characters, thus writers use a string of 50 elements to get up to 2500 characters in a string instead of just 50.

On the upside, it still beats having to parse stdin. It also makes test cases easier to wrap in the statistics page.
About the format of arguments | Reply
For this SRM's 500 ptr, the special integers are given as a vector of strings. I'm wondering:
  1. The first thing most coders do is to concatenate the strings together to get a single long string. A lot of previous problems' arguments are given in this manner. Why is the string not given as a single one? After all, it is no more than 2500 characters long and string concatenation is not part of the intended algorithm.

  2. For this problem, special integers fit in the range of 32-bit integers. Why bother give them as strings?