版本比较
题解:CF1245F Daniel and Spring Cleaning
正文
增加 8 行删除 8 行
8 行未改动910111213131415161717181920202122232424252627282930303132333434353637383 行未改动424344454646474848495051525 行未改动8 行未改动
```cppint dp(int u, bool sb, bool bs) { if (!u) return 1;
int& res = f[u][sb][bs]; if (~res) return res; res = 0;
int t1 = sb ? a[u] : 1; int t2 = bs ? b[u] : 1;
for (int i = 0; i <= t1; ++ i ) for (int j = 0; j <= t2; ++ j ) if (!i || !j) res += dp(u - 1, sb && (i == t1), bs && (j == t2));
return res;}
int calc(int x, int y) { if (x < 0 || y < 0) return 0;
memset(f, -1, sizeof f); memset(a, 0, sizeof a); memset(b, 0, sizeof b);
int l = 0; while (x) { a[ ++ l] = x & 1; x >>= 1;3 行未改动 b[ ++ l] = y & 1; y >>= 1; } len = max(len, l);
int res = dp(len, 1, 1);
return dp(len, 1, 1);}
void Luogu_UID_748509() {5 行未改动