fork download
  1. import java.io.*;
  2. import java.math.BigInteger;
  3. import java.util.*;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) throws Exception {
  8. long start = System.currentTimeMillis();
  9. int n = Integer.parseInt(new BufferedReader(new InputStreamReader(System.in)).readLine());
  10. BigInteger primorial = BigInteger.ONE;
  11. BigInteger prime = BigInteger.ONE;
  12. for (int i = 1; i < n; ++i) {
  13. prime = prime.nextProbablePrime();
  14. primorial = primorial.multiply(prime);
  15. }
  16. System.out.println(primorial);
  17. System.out.println(System.currentTimeMillis() - start);
  18. }
  19.  
  20. }
Success #stdin #stdout 0.09s 380416KB
stdin
6
stdout
2310
22