- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 二叉搜索树HDU 3791
http://acm.split.hdu.edu.cn/showproblem.php?pid=3791#include <stdio.h>#include <algorithm>#include <iostream>#define maxs 5010#include <string.h>#define MME(i,j) memset(i,j,sizeof(i))using namesp
2016-09-28 15:07:03 379
原创 二叉树——HDU 3999
http://acm.split.hdu.edu.cn/showproblem.php?pid=3999建树+前缀表达式#include <stdio.h>#include <algorithm>#include <iostream>#include <string.h>using namespace std;struct node{ int data; node *le
2016-09-28 14:27:19 342
原创 二叉树——HDU 1805 后缀表达式转前缀表达式
http://acm.split.hdu.edu.cn/showproblem.php?pid=1805给你后缀表达式让你输出前缀表达式#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#define maxs 10010#include <stack>#include <queue>
2016-09-28 14:25:31 879
原创 HDU 5880
http://acm.split.hdu.edu.cn/showproblem.php?pid=5880思路: 就是先把所以需要屏蔽的串挂在AC机上跑一边,并且要记录一下该串的长度,之后定义一个函数查询,把那篇文章跑一编AC机,遇到是之前屏蔽串的末尾就把当前位比如 i+1位+=1,把【i-len+1】-1。 细节看代码#include <stdio.h>#inc
2016-09-21 21:50:11 450
原创 Codeforces 701B
纯粹思维题#include <stdio.h>#include <iostream>#include <algorithm>#define MME(i,j) memset(i,j,sizeof(i))#include <string.h>#define maxs 100100#include <set>using namespace std;set<int>x,y;int osx,
2016-09-15 20:01:21 277
原创 Codeforces 615C. Running Track
http://codeforces.com/problemset/problem/615/C题意很简单,就是给你两个串 a和b,问你b能否由a组成(反向也可以),输出在a中的位置那么,我们可以理解为把b的每个子串都分别与a匹配或者与a的反串匹配。用left和right数组记录每个串的左边和右边的位置,但这里有一点就是每次匹配成功后不要改变left和right的下标,因为比如样例1 abc cba
2016-09-15 19:14:53 522
原创 POJ 2513 字典树+一笔画问题
http://poj.org/problem?id=2513大致题意: 给定一些木棒,木棒两端都涂上颜色,求是否能将木棒首尾相接,连成一条直线,要求不同木棒相接的一边必须是相同颜色的。解题思路: 可以用图论中欧拉路的知识来解这道题,首先可以把木棒两端看成节点,把木棒看成边,这样相同的颜色就是同一个节点 问题便转化为: 给定一个图,是否存在“一笔画”经过涂中每一点,以及经过每一边一次。 这样
2016-09-15 11:17:59 529
原创 POJ 2408
http://write.blog.csdn.net/mdeditor#include <stdio.h>#include <algorithm>#include <iostream>#include <string.h>#define maxs 100010#define MME(i,j) memset(i,j,sizeof(i))using namespace std;struct
2016-09-14 16:32:53 335
原创 POJ 1886简单模拟
http://poj.org/problem?id=1886#include<iostream>#include<cstdio>#include<algorithm>#include<string>#include<vector>#include<map>using namespace std;struct book{ string author; int statu
2016-09-14 13:09:40 499
原创 HDU 2243
http://acm.split.hdu.edu.cn/showproblem.php?pid=2243题意: 这题跟POJ 2778大体思路一样,只不过2778是找出不含有病毒串的,而这道题是找出含有病毒串的数量,那么我们只要找到不含病毒串的数量有多少个之后再用总数相减就好。但要记得这个题用的是邻接矩阵求出不满足的条件,之后再用矩阵存储 {26,1} {0, 1} 这样的矩阵进行矩阵快
2016-09-01 21:15:19 528
原创 POJ 1226
http://poj.org/problem?id=1226题意: 给你一堆串,问你这些串中出现次数最多串的长度,反向出现的也算。思路:因为问出现次数最多的串那么就要求这个串出现在每一个所给的串中,那么就是表明了需要出现N次,那么问题就简单明了了。就是N个串以及他们的反串中出现次数为K的串的最长长0度。那么我们只要 将height数组用一个数组分开就是要标记一下即可,之后二分答案,之后判断
2016-09-01 20:03:37 324
原创 HDU 2296
http://acm.split.hdu.edu.cn/showproblem.php?pid=2296题意 : 给你M个 字符串,这些字符串带有一定的价值,之后 告诉你每个 之前给你的字符串的价值,之后让你 最长为 N 的串 他的价值最大,如果价值相同输出 字符串长度最短的那个,如果长度相同,输出字典序小的那个………。思路: 参考了大神的思路–>http://blog.csdn.ne
2016-09-01 14:01:57 295
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人