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 #138: Special isosceles triangles
Project Euler #138: Special isosceles triangles
Sort by
recency
|
6 Discussions
|
Please Login in order to post a comment
im guessing the solution should be faster than O(n) and cannot be simply solved by using Pells Equation ?
Case 1 in .2 sec, case 2 in .23 sec, but my method has no chance for N = 10^18.
I generate and save a list of solutions for i = 1, ..., 1000000 mod 1e9+7. Not happening with N = 10^18.
Do I need a different method or am I missing something?
Followed a winding path to finally solve this one. Test case 3 in .31 seconds.
timed out by 4s. i calculated hypotenuse by using successive side lengths.
You can try something else algo or try to minimise loops, share your code of you can.
test care 0 is incorrect. you have mentioned L=305 for 2nd case and still it says 322 dont understand how
2 nd case means 17+305 u need to sum up first and second L's
Test Case #0: 0.05s Test Case #1: 1.02s Test Case #2: 1.1s Test Case #3: 1.16s
Can you please share your approach to the qstn. I believe a slight insight might help beginners like me to grab something potentially large