2

Long Decimal Fractions - a possible New Problem

 1 year ago
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

Rodion (admin)     2023-05-14 05:15:22
User avatar

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...

CSFPython     2023-05-14 08:49:54

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.

Please login and solve 5 problems to be able to post at forum

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK