public class Solution {
public int climbStairs(int n) {
int result=0;
for(int i=0;i<=n/2;i++){
result+=select(ni,i);
}
return result;
}
The select function calculate C(big,small). The tradtional way to calculate C(big,small) is big!/(small!*(bigsmall)!). At first, I coded as that as well. But I found that even using long, it is still out of the range. So I did some improvement on the calculation to avoid out of the long range:

compare small and bigsmall, use the biger one to calculate
C(big,small) 
Instead of calculating any factorial in the method, calculate
big*(big1)(big2)....*(small+1) which equals big!/(bigsmall)!.
But it is still out of range.... So more changes are needed. 
divide the small! when it can be divided without remainder. I use a
int called record to divide the aa, and decrease record when the
previous record has calculated.public int select(int big,int small){ int another=bigsmall; if(another>small){ return select(big,another); } else{ long aa=1; int record=another; for(int i=big;i>small;i){ aa*=i; if(aa%record==0 && record>0){ aa=aa/record; record; } } if(record>1){ while(record!=0){ aa=aa/record; record; } } return (int) aa; } }
}
And my runtime is 168 ms. Yeah! I think this is the benefit to be patient with calculations. :)