BZOJ1833 [ZJOI2010]count 数字计数

数位DP好麻烦啊不想写啊怎么办啊。 利用trie树思想直接做好了。 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long qw; #ifdef WIN32 #define lld "%I64d" #else #define lld "%lld" #endif const int maxn = 15; qw p10[maxn]; qw x, y, ans[10], c[10]; int n; char a[maxn]; void calc(qw val, int sgn) { if (!val) return; sprintf(a + 1, lld, val); int n = strlen(a + 1); memset(c, 0, sizeof(c)); qw cz, cm, cr; cz = 1;...

November 23, 2014 · 2 min · laekov