标签:
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 73503 Accepted Submission(s): 21308
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner cin=new Scanner (new BufferedInputStream(System.in)); PrintWriter cout=new PrintWriter(System.out); int t; //t=cin.nextInt(); //int eg=1; while(cin.hasNextInt()) { t=cin.nextInt(); BigInteger one=new BigInteger("1"); BigInteger ans=one; BigInteger tmp =one; for(int i=0;i<t;i++){ ans=ans.multiply(tmp); tmp=tmp.add(one); } //System.out.println(ans); System.out.println(ans); } } }
直接java大数,注意要读到文件末尾就行。
标签:
原文地址:http://www.cnblogs.com/superxuezhazha/p/5514277.html