2017年8月1日

UVALive 3942 Remember the Word 字典树+dp

摘要: /** 题目:UVALive 3942 Remember the Word 链接:https://vjudge.net/problem/UVALive-3942 题意:给定一个字符串(长度最多3e5)和m个单词(每个单词长度最多100)。单词都是不同的。该字符串可以由若干个单词组成,问最多有多少种组合方式。 思路:字典树+dp 用字典树处理好m个单词,定义dp[i]表示从i开始的字符串可以由... 阅读全文

posted @ 2017-08-01 19:18 hnust_accqx 阅读(153) 评论(0) 推荐(0)

UVALive 7721 K - 2-ME Set 集合dp,所有数的位或来表示状态。

摘要: /** 题目:UVALive 7721 K - 2-ME Set 链接:https://vjudge.net/problem/UVALive-7721 题意:给定n个数,从中取出一个集合,至少包含两个元素,如果集合内任意两个元素取位与都是0,那么是合法集合。 如果5个数为{5,2,2,1,4}那么有9种。(5, 2), (5, 2), (2, 1), (2, 1, 4), (2, 4), (2,... 阅读全文

posted @ 2017-08-01 10:40 hnust_accqx 阅读(188) 评论(0) 推荐(0)

Confusing Date Format UVALive 7711 给定mm-mm-mm格式的时间。年份(1900-1999)只给了后两位数,问有多少种合法的排列使时间正确。

摘要: /** 题目:Confusing Date Format UVALive 7711 链接:https://vjudge.net/contest/174844#problem/A 题意:给定mm-mm-mm格式的时间。年份(1900-1999)只给了后两位数,问有多少种合法的排列使时间正确。 思路: 第一次:快速读题,题意不清,没注意到这句话, To punish teams who did ... 阅读全文

posted @ 2017-08-01 10:25 hnust_accqx 阅读(385) 评论(0) 推荐(0)

导航