上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页
摘要: 题目链接 将所有的字符串一起依次建立trie树。 在每一次insert的过程中更新答案。每次insert,每走到一个结点(包括根结点)时,一定会与该结点的所有子结点比较一次,之后按照改字符串的字符,走到下一个结点,只与之前也走到该结点的字符串发生第2次比较。其他先前父节点的子结点的字符串,都因为那一 阅读全文
posted @ 2017-05-24 10:34 perplex 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 题目链接 设d[i]表示从下标i的字符开始的字符串的分解方法数,显然有倒序的递推公式。 需要求每个位置开始是否能组成模式串的前缀,才可以建立正确的递推。 阅读全文
posted @ 2017-05-24 10:28 perplex 阅读(142) 评论(0) 推荐(0) 编辑
摘要: You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a ne 阅读全文
posted @ 2017-05-22 20:51 perplex 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she 阅读全文
posted @ 2017-05-22 15:20 perplex 阅读(151) 评论(0) 推荐(0) 编辑
摘要: A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Wri 阅读全文
posted @ 2017-05-22 15:04 perplex 阅读(113) 评论(0) 推荐(0) 编辑
摘要: After several latest reforms many tourists are planning to visit Berland, and Berland people understood that it's an opportunity to earn money and cha 阅读全文
posted @ 2017-05-21 23:24 perplex 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Berland has a long and glorious history. To increase awareness about it among younger citizens, King of Berland decided to compose an anthem. Though t 阅读全文
posted @ 2017-05-21 23:20 perplex 阅读(410) 评论(0) 推荐(0) 编辑
摘要: This is an interactive problem. In the output section below you will see the information about flushing the output. On Sunday Leha the hacker took Nur 阅读全文
posted @ 2017-05-21 23:16 perplex 阅读(360) 评论(0) 推荐(0) 编辑
摘要: D. Labelling Cities time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output D. Labelling Cities 阅读全文
posted @ 2017-05-16 23:35 perplex 阅读(342) 评论(0) 推荐(0) 编辑
摘要: C. Naming Company time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Naming Company time 阅读全文
posted @ 2017-05-16 16:51 perplex 阅读(245) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页