
Brute force
文章平均质量分 68
X-Wyatt
For free 邮箱whitezhangv5@gmail.com
展开
-
HDU 1016
好久没写搜索了,差不多要不会了。看了下滔滔的解题报告才写出来的。http://blog.youkuaiyun.com/chuck_0430/article/details/8127339深搜的核心也就是 vis 标志数组的改变,并在中间递归调用 dfs#include #include #include #define NUMBER 500000 #define LEN 10000原创 2012-11-05 21:16:20 · 517 阅读 · 0 评论 -
Codeforces-134D2A
Easy problem and I directly attached to the code.#include #include using namespace std;#define LEN 1000int mon[LEN];int index[LEN];int main() { int n, k, tmp; int i, count; scanf("原创 2012-09-13 15:54:12 · 411 阅读 · 0 评论 -
Codeforces-125D2A
Brute force problem and it is very easy.My code is as follows:#include #include using namespace std;#define LEN 101long long fib[LEN];void init() { fib[0] = 0; fib[1] = 1; for(in原创 2012-09-12 08:52:19 · 387 阅读 · 0 评论 -
ZOJ 1136
广搜,每个节点有两个值,一个是当前的数字,另一个是余数,用余数可以减少以后的计算量,并且可进行剪枝,从而减少了常数时间的复杂度#include #include #include #include #include using namespace std;struct Node { string num; int mod; Node() {} Node(stri原创 2013-07-16 10:36:19 · 1263 阅读 · 0 评论