Very true. I have tried many problems that work on small but fail on large, and when I replace all 32 bit integers with 64 bit integers the large file works.
I now try to use long (64 bit integers) whenever there is a chance that they will be required. On Apr 15, 9:39 pm, Nitin Kumar <[email protected]> wrote: > Consider one more case... In case of small input... the result might > contain small data amount!! bt.. in case of large input.. if you use > the same data type to hold the result the data type is not able to > hold the large result .. thus giving a wrong output!! > > Like.. if in small input we are asked to find factorial till 10 or say > 15.. then we can use int to hold the result... but.. for large input > it it's something like 100 or more.. then.. would we be able to hold > the data in int!! > > On Apr 15, 6:49 am, Felipe Sodré Silva <[email protected]> wrote: > > > > > On Wed, Apr 14, 2010 at 7:16 PM, Schiefler <[email protected]> wrote: > > > Hi all, > > > > I'm a little bit new on programming. > > > I wanna know if there is another difference betwen small and large > > > input than the size of its inputs. > > > Usually yes. > > The constraints in the input may differ (and they almost always do). > > Sometimes you can come up with a solution that can solve the problem for the > > constraints on the small input, but not for the large input. Therefore you > > can get a few points from that problem, even if you can't come up with a > > good solution. > > > For instance, if a problem asks for the optimal ordering of a sequence of > > things and the small input constraint says you'll be given at most 10 > > elements, you can just go over all possible permutations and find the best > > one. However, in the large input, they may give you at most 1000 elements, > > and you'd have to find a better solution for that. > > > Felipe -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
