HDU 1502 - Regular Words
Problem : Find the number of strings, whose length is 3n, and has n As, n Bs and n Cs. The string has constraint that for any prefix, num(A)>=num(B)>=num(C).
Solution : Denote f[i][j][k], s.t. the number of valid string with i As, j Bs, k Cs. Then f[i][j][k]=f[i][j][k-1]+(j>k?f[i][j-1][k])+(i>j?f[i-1][j][k]). The answer is very big, big number is needed.