为什么要开64路?好像我觉得会快一点……其实并没有快……
import java.io.*;import java.util.*;import java.math.*;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); int anscnt = 64; BigInteger ans[] = new BigInteger[anscnt]; for (int i = 0; i < anscnt; i++) { ans[i] = BigInteger.ONE; } for (int i = 1; i <= n; i++) { ans[i % anscnt] = ans[i % anscnt].multiply(BigInteger.valueOf(i)); } BigInteger ANS = BigInteger.ONE; for (int i = 0; i < anscnt; i++) { ANS = ANS.multiply(ans[i]); } System.out.println(ANS); } sc.close(); }}