Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
二分加数位dpdp[0][0][0][0] = 1; ull res = 0, ls = s.size(); REP(i, ls) REP(j, 3) REP(k, 2) REP(l, 2) REP(num, 10) { int ni = i + 1, nj = num == 6 ? j + 1 : 0, nk = k, nl = l; if (num < s[i] - '0') nl = 1; if (nj == 3) nj = 0, nk = 1; if (!nl && num > s[i] - '0') continue; dp[ni][nj][nk][nl] += dp[i][j][k][l]; } REP(j, 3) REP(l, 2) res += dp[s.size()][j][1][l]; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator