Cutting Chains What a find! Anna Locke has just bought several links of chain some of which may be connected. They are made from zorkium, a material that was frequently used to manufacture jewelry in the last century, but is not used for that purpo…
紫书195 题目大意:给一个困难的串,困难的串的定义就是里面没有重复的串. 思路:不需要重新对之前的串进行判重,只需要对当前的加入的字符进行改变即可. 因为是判断字典序第k个的字符串,所以要多一个全局变量cnt来记录目前是第几次循环到了. #include<bits/stdc++.h> using namespace std; + ; int n, L; int s[maxn]; int cnt; bool dfs(int cur){ //printf("cur = %d\n&quo…