Long Decimal Fractions - a possible New Problem
source link: https://www.codeabbey.com/index/forum_topic/af1b5607583a26da470d07175aca4f11
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Long Decimal Fractions - a possible New Problem |
Back to General discussions forum
Definitely I was quite silly when hastily classifying this as "simple". I'm a bit lost yet. Though glad to see Vladimir already managed to solve it!
As a side note I dare to say that 10^18
brings values to the brink of calculability in some languages. I guess most
compilers and interpreters nowadays support 64-bit
integers, but many of them only support them signed
which means
that, for example, multiplying 10^18 - 1
by 10
is integer overflow. Of course most modern languages make provision
for long arithmetics though...
Rodion, I fully appreciate your point about large numbers. For that reason, whenever I set a problem, I aim to ensure that both the final answer and all of the intermediate calculations will not exceed 2^63. In fact I usually use 10^18 as a limit since this is around 9 times smaller than 2^63. The large numbers are fairly necessary in a number of problems to ensure that a simple brute force approach will not cope with all of the sets of test data.
As for the simplicity (or otherwise) of the problem. This very much depends on whether or not you have reached that AHA! moment.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK