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 #60: Prime pair sets
Project Euler #60: Prime pair sets
Sort by
recency
|
20 Discussions
|
Please Login in order to post a comment
Use Java 7 for this code
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution {
}
here is the C# code using System; using System.Collections.Generic; using System.Linq;
class Program { // Cache for concatenated prime checks. static Dictionary primeCache = new Dictionary();
}
import java.io.; import java.util.;
public class Solution {
}
JAva code
4, 9, 14 cash are not work
This one is very complex; in Python had to end up doing lots of optimizations. Miller-Rabin can be made deterministic beneath a certain range, it is recommended to avoid the overhead of constant random. And clique hunting is easy with set operators if you have access to them. But you have to really squeeze every ounce of efficiency from every function; there are plenty of places to prune in the clique algorithms.
I didn't end up needing multiprocessing that xperroni mentions, I didn't like the idea of processing power being the key to algorithmic optimizations for Project Euler.