正文
增加 3 行删除 3 行
422 行未改动全部展开4234244254264274284294304314324334344 行未改动439440441442443444445446447212 行未改动全部展开422 行未改动全部展开void dfs(int p, int k) {if(k <= siz[p]) return;k -= siz[p];for(int i = 0;i < 26; ++i) {int to = sam[p].nex[i];if(!to) continue;if(k > sum[to]) {k -= sum[to];}else {putchar(i + 'a'), dfs(to, k);4 行未改动int main() {scanf("%s", s);len = strlen(s);scanf("%d %lld", &t, &k);for(int i = 0;i < len; ++i) add(s[i] - 'a');for(int i = 1;i <= tot; ++i) ++cnt[sam[i].len];for(int i = 1;i <= len; ++i) cnt[i] += cnt[i - 1];for(int i = 1;i <= tot; ++i) order[cnt[sam[i].len]--] = i;//倒拓扑序212 行未改动全部展开422 行未改动全部展开4234244254264274284294304314324334344 行未改动439440441442443444445446447212 行未改动全部展开422 行未改动全部展开void dfs(int p, int k) {if(k <= siz[p]) return;k -= siz[p];for(int i = 0;i < 26; ++i) {int to = sam[p].nex[i];if(!to) continue;if(k > sum[to]) {k -= sum[to];}else {putchar(i + 'a'), dfs(to, k);4 行未改动int main() {scanf("%s", s);len = strlen(s);scanf("%d %lld", &t, &k);for(int i = 0;i < len; ++i) add(s[i] - 'a');for(int i = 1;i <= tot; ++i) ++cnt[sam[i].len];for(int i = 1;i <= len; ++i) cnt[i] += cnt[i - 1];for(int i = 1;i <= tot; ++i) order[cnt[sam[i].len]--] = i;//倒拓扑序212 行未改动全部展开