發表文章

目前顯示的是有「卡特蘭數」標籤的文章

[TIOJ] 1107. 繁複的二元樹

題目連結: http://tioj.infor.org/problems/1107 裸卡特蘭數題,而卡特蘭數可由$C_0=1$及$C_{n+1}=\frac{2(2n+1)}{n+2} \times C_{n}$的遞迴關係式算出,不過本題要輸出成科學記號有點麻煩,記得處理一下ww #include <bits/stdc++.h> using namespace std; #define N 1000000 struct sciF{ double _a; int _n; inline sciF operator=(int x){ _a=x; _n=0; while(_a>10){ _n++; _a/=10.; } return *this; } inline sciF operator*(int x){ _a*=x; while(_a>10){ _n++; _a/=10.; } return *this; } inline sciF operator/(int x){ _a/=x; while(_a<1){ _n--; _a*=10.; } return *this; } }; bitset<N+5> isset; sciF cc[N+...