正文
增加 6 行删除 6 行
43 行未改动44454647484950515253545556575859606138 行未改动10010110210310410510610710810911011120 行未改动13213313413513613713813914016 行未改动43 行未改动for(int i = n; i; --i){if(s[i] != t[i]){ps = i - 1, sp = 6 - s[i] - t[i];ans = (ans + calc(6 - s[i] - t[i], i - 1, s) + 1) % mod;for(int j = 1; j <= ps; ++j) s[j] = 6 - s[i] - t[i];break;}}ans = (ans + calc(sp, ps, t)) % mod;cout << ans;return 0;}/*随机数据下正确Hack:31 1 33 1 138 行未改动namespace Zx_Tree{#define mid (l + r >> 1)struct node{int ls, rs, siz;} t[N * 20];int tot, rot[N];inline void psup(int u) {t[u].siz = t[t[u].ls].siz + t[t[u].rs].siz;}inline void upd(int ua, int &ub, int l, int r, int k){t[ub = ++tot] = t[ua];if(l == r) {++t[ub].siz; return ;}if(k <= mid) upd(t[ua].ls, t[ub].ls, l, mid, k);else upd(t[ua].rs, t[ub].rs, mid + 1, r, k);psup(ub);20 行未改动else{if(x % 2 == 0) printf("%d\n", fid(rot[md + x / 2 - 1], 1, m, x));else printf("%d\n", max(fid(rot[md + x / 2 - 1], 1, m, x), a[md + x / 2]));}}}return 0;}/*16 行未改动43 行未改动44454647484950515253545556575859606138 行未改动10010110210310410510610710810911011120 行未改动13213313413513613713813914016 行未改动43 行未改动for(int i = n; i; --i){if(s[i] != t[i]){ps = i - 1, sp = 6 - s[i] - t[i];ans = (ans + calc(6 - s[i] - t[i], i - 1, s) + 1) % mod;for(int j = 1; j <= ps; ++j) s[j] = 6 - s[i] - t[i];break;}}ans = (ans + calc(sp, ps, t)) % mod;cout << ans;return 0;}/*随机数据下正确Hack:31 1 33 1 138 行未改动namespace Zx_Tree{#define mid (l + r >> 1)struct node{int ls, rs, siz;} t[N * 20];int tot, rot[N];inline void psup(int u) {t[u].siz = t[t[u].ls].siz + t[t[u].rs].siz;}inline void upd(int ua, int &ub, int l, int r, int k){t[ub = ++tot] = t[ua];if(l == r) {++t[ub].siz; return ;}if(k <= mid) upd(t[ua].ls, t[ub].ls, l, mid, k);else upd(t[ua].rs, t[ub].rs, mid + 1, r, k);psup(ub);20 行未改动else{if(x % 2 == 0) printf("%d\n", fid(rot[md + x / 2 - 1], 1, m, x));else printf("%d\n", max(fid(rot[md + x / 2 - 1], 1, m, x), a[md + x / 2]));}}}return 0;}/*16 行未改动