标签:des style blog http io ar color os sp
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3187 Accepted Submission(s): 757
import java.io.*; import java.math.*; public class Main { public static void main(String args[])throws IOException { StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); BigInteger data[]=new BigInteger[30]; int [] x = new int[30]; while(true){ st.nextToken(); int n=(int)st.nval; if( n == 0 ) break ; int sum = 0 ; for(int i=1;i<=n;i++) { st.nextToken(); x[i]=(int)st.nval; sum += x[i]; } BigInteger res=BigInteger.ONE; for( int i = 1 ; i <= sum ; ++i ){ res = res.multiply(BigInteger.valueOf(i)); } for( int i = 1 ; i <= n ; ++i ){ for( int j = 1 ; j <= x[i] ; ++j ){ res = res.divide( BigInteger.valueOf(j) ); } } out.println(res); } out.close(); } }
标签:des style blog http io ar color os sp
原文地址:http://www.cnblogs.com/hlmark/p/4115158.html