hdu 3723 Delta Wave (catalan数+结合数学)
hdu3723Delta Wave(catalan数+组合数学)Delta WaveTime Limit: 6000/3000 MS (Java/Others)Memory Limit:
hdu 3723 Delta Wave (catalan数+组合数学)
Delta WaveTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 626 Accepted Submission(s): 203
Problem Description
Given N, you are requested to find out how many kinds of different delta waves of otaku.InputOutputSample InputSample OutputSourceimport java.util.*;import java.math.*;public class Main{public static void main(String[] args) {// TODO Auto-generated method stubScanner cin=new Scanner(System.in);int i,t,n;BigInteger mod,ans,b;mod=BigInteger.valueOf(1);for(i=1;i<=100;i++){mod=mod.multiply(BigInteger.valueOf(10));} while(cin.hasNext()) { n=cin.nextInt(); ans=BigInteger.valueOf(1); b=BigInteger.valueOf(1); for(i=1;i<=n/2;i++) { b=b.multiply(BigInteger.valueOf((n-2*i+2)*(n-2*i+1))).divide(BigInteger.valueOf((i+1)*i)); ans=ans.add(b); ans=ans.mod(mod); } System.out.println(ans); }}}