Package net.n1da.dev.euler
Class PE0029
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0029
-
- All Implemented Interfaces:
Solvable
public class PE0029 extends Problem
Solution for problem 29 "Distinct powers" completed on Wed, 18 Nov 2015, 10:20.- Since:
- 10.10.2015 06:56:23
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<LargeNumber>
mem
Storage for all foundLargeNumber
s
-
Method Summary
Modifier and Type Method Description void
prepare()
Just initializing thelocal storage
.java.lang.String
solve()
Run two nested loops to calculate all powers and test each if it already exists in thememory
.-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Field Detail
-
mem
private java.util.ArrayList<LargeNumber> mem
Storage for all foundLargeNumber
s
-
-
Method Detail
-
prepare
public void prepare()
Just initializing thelocal storage
.
-
solve
public java.lang.String solve()
Run two nested loops to calculate all powers and test each if it already exists in thememory
. If it can not be found the power is added to thestorage
- Returns:
- the size of the
memory
- See Also:
LargeNumber
-
-