We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #142: Perfect Square Collection
Project Euler #142: Perfect Square Collection
Sort by
recency
|
12 Discussions
|
Please Login in order to post a comment
I am bit confused with the problem statements.
Passed all test cases except #7 and #8.. Anybody have any tips about why this might be? To me my algorithm works when N>=3000, but apparently not?
It's not a timeout issue as I'm returning answers fast.
error: no suitable method found for valueOf(BigInteger)
for (BigInteger x =BigInteger.valueOf(1234567890);x.compareTo(BigInteger.ZERO) > 0;x=x.subtract(BigInteger.ONE)) { for (BigInteger y =BigInteger.valueOf(x);y.compareTo(BigInteger.ZERO) > 0;y = y.subtract(BigInteger.ONE)) { for (BigInteger z = BigInteger.valueOf(y); z.compareTo(BigInteger.ZERO) > 0; z = z.subtract(BigInteger.ONE))
pls help!!!
can we use bisection search to find the numbers ?
Here is my answer to the question. Arrived at this solution after looking at Euler's solution(https://sites.google.com/site/tpiezas/0020). But it is not running due to timeout problem :(
import math
from itertools import combinations
def perfect_square(n):
def check_perfect(list):
list = []
for i in range(1,int(math.pow(10,12)+1)):
for i in combinations(list, 4):