标签:family tip script ssi nbsp strong ati mode pareto
JAVA大数....
2 1 2 3 2 2 2 0
3 90
import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); BigInteger[] jie=new BigInteger[20]; jie[0]=BigInteger.ONE; BigInteger nt=BigInteger.ONE; for(int j=1;j<=14;j++) { jie[j]=jie[j-1].multiply(nt); nt=nt.add(BigInteger.ONE); } while(in.hasNext()) { int n=in.nextInt(); if(n==0) break; BigInteger[] a=new BigInteger[n]; int[] av=new int[n]; BigInteger sum=BigInteger.ZERO; for(int i=0;i<n;i++) { av[i]=in.nextInt(); a[i]=BigInteger.valueOf(av[i]); sum=sum.add(a[i]); } BigInteger ans=BigInteger.ONE; for(BigInteger i=BigInteger.ONE;i.compareTo(sum)<=0;i=i.add(BigInteger.ONE)) { ans=ans.multiply(i); } for(int i=0;i<n;i++) { ans=ans.divide(jie[av[i]]); } System.out.println(ans); } } }
标签:family tip script ssi nbsp strong ati mode pareto
原文地址:http://www.cnblogs.com/zhchoutai/p/7294179.html