Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + ...
分类:
其他好文 时间:
2020-02-04 10:47:17
阅读次数:
71
题意: 给你一堆单词与询问,每次询问给一个字符串s问以s为前缀的字符串有多少 思路: #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int maxn=400009; struct ...
分类:
编程语言 时间:
2020-02-03 22:28:15
阅读次数:
99
http://acm.hdu.edu.cn/showproblem.php?pid=3038 大致题意: 有一个区间[0,n],然后会给出你m个区间和,每次给出a,b,v,表示区间[a,b]的区间和为v,但每次给出的区间可能与之前的有冲突,问这样起冲突的区间共有多少个 首先区间[a,b]的和可由区间 ...
分类:
其他好文 时间:
2020-02-03 19:29:00
阅读次数:
78
题:http://acm.hdu.edu.cn/showproblem.php?pid=2222 学习出:https://bestsort.cn/2019/04/28/402/ 主要是fail的建立。在跳的过程就是不断跳fail,而不是跳到一个fail再往下!! #include<iostream> ...
分类:
其他好文 时间:
2020-02-03 15:34:16
阅读次数:
64
首发于 "my CSDN blog" "题目链接" Problem Description 今天zyb参加一场面试,面试官听说zyb是ACMer之后立马抛出了一道算法题给zyb: 有一个序列,是 $1$ 到 $n$ 的一种排列,排列的顺序是字典序小的在前,那么第k个数字是什么? 例如 $n=15,k ...
分类:
其他好文 时间:
2020-02-03 13:59:35
阅读次数:
80
(一)贪心 1.A - 今年暑假不AC “今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一 ...
分类:
其他好文 时间:
2020-02-03 13:54:17
阅读次数:
88
用了前缀集合,高级的可以用前缀树 class Solution: def findWords(self, board: List[List[str]], words: List[str]) -> List[str]: if len(board) == 0 or len(board[0]) == 0: ...
分类:
其他好文 时间:
2020-02-03 09:45:19
阅读次数:
90