how to take 14 digit number in c----without using array?

please help me

14 digit number can be taken in a variable whose data type is long long int.

in fact using long long int you can take number upto 19 digits…
hope this helps you.

These would do.

long long var;
scanf("%lld", &var);
printf("%lld", var);

People, I’m almost 100% sure this was for Google Code Jam’s problem C large input 1… :stuck_out_tongue: However, I’d say there’s no point in closing this thread now, since contest is almost over :slight_smile:

Bruno

1 Like

solved that problem :slight_smile:

Sadly, I only solved the C-small… However, I qualified to round 1… But I plan to attempt to read some people’s solutions and Google Contest Analysis to train as much as I can and learn as much as I can from this very interesting contest :smiley:

@kuruma >> If you solved C-small, you could have solved large-1 as well. As upto 10^14 numbers fit into long long int. You could have stored all the values and just a single count. I was trying C-large-2 but damn internet!! Later I saw time expired! The whole labor with strings was messed up! :frowning:

And similar thoughts here @kuruma, although qualified this year but I have to practice very very hard to clear all the rounds next year. So I wish you good luck. You wish me. :slight_smile:

1 Like

Ofc I wish you good luck too @bugkiller :smiley:

Usually on round 1, questions are more theoretically challenging and less implementation challenging, so its gets harder as we go… Ofc in the round 3 and finals questions get theoretically hard and very implementation hard as well… So, it needs to be a work in progress… slowly but steadily, we can get better at it :slight_smile: I noticed that this year… I used less wrong attempts, solved my 1st small input faster when compared to last year…

PS: Although extremely interesting from the implementation side, Problem A, was very easy and I already have a new problem ready based on that one, which will be a little harder :smiley:

@kuruma >> LOL! Thanks for the leak, as I solved Problem A with very much ease, I will be really happy if you extend it to something nice and harder, I’d like to attempt it here in the contests.