摘要: 本题目的dfs原理不难,个人认为难点式路径的记录,刚开始定义了很大的数组,提交的时候超出了内存的限制,后来在网上发现有的人用了栈存储,纠结了半天终于搞出来啦。#include <stdio.h> #include <string.h> int flag; int st[7]; int head; int in[6]; int digit; int digit2; int num1,max; int de; void dfs(int cur,int sum) { if(cur>=digit2) { if(sum>max) { max=sum; flag=1; 阅读全文
posted @ 2012-07-02 11:41 lishimin_come 阅读(154) 评论(0) 推荐(0) 编辑