转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Solve this interesting problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1731    Accepted Submission(s): 519 Problem Description…
pid=5323" target="_blank" style="">链接 Solve this interesting problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 511    Accepted Submission(s): 114 Problem Descriptio…
题目传送门 /* 题意:告诉一个区间[L,R],问根节点的n是多少 DFS+剪枝:父亲节点有四种情况:[l, r + len],[l, r + len - 1],[l - len, r],[l - len -1,r]; */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <queue> using namespace std;…
Solve this interesting problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1479    Accepted Submission(s): 423 Problem Description Have you learned something about segment tree? If not, don’…
Have you learned something about segment tree? If not, don't worry, I will explain it for you.  Segment Tree is a kind of binary tree, it can be defined as this:  - For each node u in Segment Tree, u has two values: $L_u$ and $R_u$.  - If $L_u = R_u$…
题目链接 传送门 题意 总共有\(2n\)个人,任意两个人之间会有一个竞争值\(w_{ij}\),现在要你将其平分成两堆,使得\(\sum\limits_{i=1,i\in\mathbb{A}}^{n}\sum\limits_{j=1,j\in\mathbb{B}}^{n}w_{ij}\)最大. 思路 看到这一题第一想法是状态压缩然后枚举状态,然后人就没了. 其实这题就是个普通的\(dfs\),假设在枚举第\(i\)个人时,前面已经有\(tot1\)个人分进了\(\mathbb{A}\),\(t…
H - Solve this interesting problem Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5323 Appoint description:  System Crawler  (2015-07-28) Description Have you learned something about segment tr…
http://acm.hdu.edu.cn/showproblem.php?pid=4403 题意: 给出一串数字,在里面添加一个等号和多个+号,使得等式成立,问有多少种不同的式子. 思路: 数据量比较小,直接dfs爆搜答案即可. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<map> using namespace std;…
Word Puzzles Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 10782 Accepted: 4076 Special Judge Description Word puzzles are usually simple and very entertaining for all ages. They are so entertaining that Pizza-Hut company started using t…
转载请注明出处,谢谢:http://www.cnblogs.com/KirisameMarisa/p/4298840.html   ---by 墨染之樱花 题目链接:http://poj.org/problem?id=1077 题目描述:民间流传的推15游戏,不过这里简化为3*3,也就是八数码问题,‘x’表示空位.与AOJ0121的“Seven Puzzle”类似. 思路:没什么特别的,构造字符串队列,爆搜一下.注意Hash函数,哈得好就哈哈,哈得不好就只能呵呵了...我的hash函数是∑((s…