摘要:
Interesting Housing Problem HDU - 2426 题意:n个人,m个房间,安排住宿。要求每个人不能分到不喜欢的房间,且使满意度最大。 不用slack几乎要超时~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 con 阅读全文
posted @ 2017-08-18 14:51
yijiull
阅读(221)
评论(0)
推荐(0)
摘要:
Going Home HDU - 1533 题意:给出地图,其中m和h个数相等,求所有m到h的总路程最短。 KM 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int inf=0x3f3f3f3f; 4 const int max 阅读全文
posted @ 2017-08-18 14:29
yijiull
阅读(173)
评论(0)
推荐(0)
摘要:
奔小康赚大钱 HDU - 2255 题意:给出每个村民愿意为每个房子出的价钱,问怎么分配房子可以使收益最大。 KM算法 一直对slack数组有点迷~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int inf=0x3f3f3f3 阅读全文
posted @ 2017-08-18 14:12
yijiull
阅读(235)
评论(0)
推荐(0)
摘要:
Clever Y POJ - 3243 题意:给a,c,b,求最小的x使得 ax≡b (mod c)。 扩展BSGS算法~ 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <cmath> 5 #def 阅读全文
posted @ 2017-08-18 13:25
yijiull
阅读(183)
评论(0)
推荐(0)
摘要:
Searching the String ZOJ - 3228 题意:两种查询,普通的就是ac自动机模板,另外一种要求没有发生覆盖。 处理方式是判断一下如果当前匹配到的位置(u)减去上一次匹配到的位置(ed[u])大于该字符的深度(deep[u]),就加1。 1 #include <bits/std 阅读全文
posted @ 2017-08-18 10:55
yijiull
阅读(204)
评论(0)
推荐(0)
摘要:
DNA repair HDU - 2457 题意:有些DNA序列是致病的,给你以个长DNA序列,问最少需要修改多少次使得其不含致病序列。 好多题解说的不清不楚的。。。最关键的地方往往没说清楚。。。 首先是进行了一步转换,将其理解为在建好的Trie图上走len(序列长度)步,走的路不能包含致病序列。 阅读全文
posted @ 2017-08-18 10:54
yijiull
阅读(311)
评论(0)
推荐(0)
摘要:
考研路茫茫——单词情结 HDU - 2243 题意: 和上一题基本差不多 比较坑的是,矩阵快速幂的时候m+1了,会爆int,所以要用long long 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ull unsigned l 阅读全文
posted @ 2017-08-18 10:52
yijiull
阅读(185)
评论(0)
推荐(0)
摘要:
DNA Sequence POJ - 2778 题意: 昨天看了好久也没明白咋回事。。。今天忽然就理解了。。。 晚上再来补题解。。。 昨天看了好久也没明白咋回事。。。今天忽然就理解了。。。 晚上再来补题解。。。 1 #include <iostream> 2 #include <cstdio> 3 阅读全文
posted @ 2017-08-18 10:51
yijiull
阅读(164)
评论(0)
推荐(0)
摘要:
病毒侵袭持续中 HDU - 3065 题意:统计长串中各短串出现的次数。 唯一需要注意的地方是,虽然短串只有大写英文字母,但是长串是可显示的字符,ASCII码是从32到127。 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define C 阅读全文
posted @ 2017-08-18 10:48
yijiull
阅读(190)
评论(0)
推荐(0)
摘要:
病毒侵袭 HDU - 2896 题意:统计长串中出现了哪些短串 用vector存一下,再输出 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define CLR(m,a) memset(m,a,sizeof(m)) 4 5 const in 阅读全文
posted @ 2017-08-18 10:46
yijiull
阅读(141)
评论(0)
推荐(0)

浙公网安备 33010602011771号