摘要:
num--忘了写。。#includeusing namespace std;int m[10][10],vis[10];int n,k;int cas=0;int num;void dfs(int c){ if(num==k) { cas++... 阅读全文
摘要:
#include#include#include#includeusing namespace std;const int maxn=1000000;//状态最大不超过9!,这里设置大一点int dx[]={-1,1,0,0};int dy[]={0,0,-1,1};... 阅读全文
摘要:
思路:建立双射关系:从字符A到字符Z遍历输入的字符串,用strchr函数将输入中出现的字符找出,并将找出的字符进行编号,用letter和id分别存储字符和对应的编号降维:输入中给出的,是类似于邻接表形式的二维形式,如果我们用二维数据结构,将增加处理时对于输出细节的处理... 阅读全文
摘要:
dfs回溯。判断后缀很重要。/*InputEach input line contains integers n and L (in that order), where n > 0 and L is in the range 1 ≤ L ≤ 26.Input is ... 阅读全文