blob: 0c7de2a9fe7add6e4e52915f86a3d553a0c22daf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
NB. The trick is to convert numbers to a common base using
NB. a^b = e^(b * ln(a)), so by comparing the exponents we
NB. avoid calculating the large number
solve =: {{
>:{.\:{{y*^.x}}/|:1000 2$".>{.|:2000 2$;:fread y
}}
problem99 =: solve 'p099_base_exp.txt'
|