02 2018 档案

POJ3581 Sequence —— 后缀数组
摘要:题目链接:https://vjudge.net/problem/POJ-3581 Sequence Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7754 Accepted: 1761 Case Time Limit: 2000 阅读全文

posted @ 2018-02-27 18:51 h_z_cong 阅读(343) 评论(0) 推荐(0)

POJ3450 Corporate Identity —— 后缀数组 最长公共子序列
摘要:题目链接:https://vjudge.net/problem/POJ-3450 Corporate Identity Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 8046 Accepted: 2710 Description 阅读全文

posted @ 2018-02-27 18:34 h_z_cong 阅读(341) 评论(0) 推荐(0)

UVA - 11475 Extend to Palindrome —— 字符串哈希 or KMP or 后缀数组
摘要:题目链接:https://vjudge.net/problem/UVA-11475 题意: 给出一个字符串,问在该字符串后面至少添加几个字符,使得其成为回文串,并输出该回文串。 题解: 实际上是求该字符串的“最长回文后缀”,有多种做法,其中用字符串哈希的方法最方便而且速度最快。 字符串哈希: 从字符 阅读全文

posted @ 2018-02-27 14:33 h_z_cong 阅读(248) 评论(0) 推荐(0)

POJ3415 Common Substrings —— 后缀数组 + 单调栈 公共子串个数
摘要:题目链接:https://vjudge.net/problem/POJ-3415 Common Substrings Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 12240 Accepted: 4144 Description 阅读全文

posted @ 2018-02-26 18:17 h_z_cong 阅读(198) 评论(0) 推荐(0)

SPOJ - PHRASES Relevant Phrases of Annihilation —— 后缀数组 出现于所有字符串中两次且不重叠的最长公共子串
摘要:题目链接:https://vjudge.net/problem/SPOJ-PHRASES PHRASES - Relevant Phrases of Annihilation no tags no tags You are the King of Byteland. Your agents have 阅读全文

posted @ 2018-02-26 16:37 h_z_cong 阅读(203) 评论(0) 推荐(0)

POJ1226 Substrings ——后缀数组 or 暴力+strstr()函数 最长公共子串
摘要:题目链接:https://vjudge.net/problem/POJ-1226 Substrings Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15122 Accepted: 5309 Description You ar 阅读全文

posted @ 2018-02-26 15:46 h_z_cong 阅读(237) 评论(0) 推荐(0)

POJ3294 Life Forms —— 后缀数组 最长公共子串
摘要:题目链接:https://vjudge.net/problem/POJ-3294 Life Forms Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 16905 Accepted: 4970 Description You ma 阅读全文

posted @ 2018-02-26 15:11 h_z_cong 阅读(344) 评论(0) 推荐(0)

POJ3693 Maximum repetition substring —— 后缀数组 重复次数最多的连续重复子串
摘要:题目链接:https://vjudge.net/problem/POJ-3693 Maximum repetition substring Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11250 Accepted: 3465 阅读全文

posted @ 2018-02-25 19:01 h_z_cong 阅读(268) 评论(0) 推荐(0)

SPOJ - REPEATS —— 后缀数组 重复次数最多的连续重复子串
摘要:题目链接:https://vjudge.net/problem/SPOJ-REPEATS REPEATS - Repeats no tags no tags A string s is called an (k,l)-repeat if s is obtained by concatenating 阅读全文

posted @ 2018-02-25 15:09 h_z_cong 阅读(508) 评论(0) 推荐(0)

POJ2774 Long Long Message —— 后缀数组 两字符串的最长公共子串
摘要:题目链接:https://vjudge.net/problem/POJ-2774 Long Long Message Time Limit: 4000MS Memory Limit: 131072K Total Submissions: 33144 Accepted: 13344 Case Time 阅读全文

posted @ 2018-02-25 13:47 h_z_cong 阅读(293) 评论(0) 推荐(0)

POJ3261 Milk Patterns —— 后缀数组 出现k次且可重叠的最长子串
摘要:题目链接:https://vjudge.net/problem/POJ-3261 Milk Patterns Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 17157 Accepted: 7592 Case Time Limit 阅读全文

posted @ 2018-02-24 17:00 h_z_cong 阅读(150) 评论(0) 推荐(0)

POJ1743 Musical Theme —— 后缀数组 重复出现且不重叠的最长子串
摘要:题目链接:https://vjudge.net/problem/POJ-1743 Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 32402 Accepted: 10808 Description A 阅读全文

posted @ 2018-02-24 16:51 h_z_cong 阅读(229) 评论(0) 推荐(0)

SPOJ - SUBST1 New Distinct Substrings —— 后缀数组 单个字符串的子串个数
摘要:题目链接:https://vjudge.net/problem/SPOJ-SUBST1 SUBST1 - New Distinct Substrings #suffix-array-8 #suffix-array-8 Given a string, we need to find the total 阅读全文

posted @ 2018-02-24 16:21 h_z_cong 阅读(216) 评论(0) 推荐(0)

AC自动机小结
摘要:一. 模板 1 struct Trie 2 { 3 int sz, M[256]; 4 int next[MAXN][50], fail[MAXN], end[MAXN]; 5 int root, L, id // L为结点个数, id为单词个数。id可选择使用 6 7 int newnode() 阅读全文

posted @ 2018-02-23 16:32 h_z_cong 阅读(298) 评论(0) 推荐(0)

HDU3247 Resource Archiver —— AC自动机 + BFS最短路 + 状压DP
摘要:题目链接:https://vjudge.net/problem/HDU-3247 Resource Archiver Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 100000/100000 K (Java/Others)Total S 阅读全文

posted @ 2018-02-23 13:26 h_z_cong 阅读(229) 评论(0) 推荐(0)

POJ1625 Censored! —— AC自动机 + DP + 大数
摘要:题目链接:https://vjudge.net/problem/POJ-1625 Censored! Time Limit: 5000MS Memory Limit: 10000K Total Submissions: 10870 Accepted: 2979 Description The alp 阅读全文

posted @ 2018-02-22 17:09 h_z_cong 阅读(419) 评论(0) 推荐(0)

ZOJ3228 Searching the String —— AC自动机 + 可重叠/不可重叠
摘要:题目链接:https://vjudge.net/problem/ZOJ-3228 Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she 阅读全文

posted @ 2018-02-22 16:17 h_z_cong 阅读(388) 评论(0) 推荐(0)

ZOJ - 3430 Detect the Virus —— AC自动机、解码
摘要:题目链接:https://vjudge.net/problem/ZOJ-3430 One day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that i 阅读全文

posted @ 2018-02-22 15:14 h_z_cong 阅读(375) 评论(0) 推荐(0)

HDU2296 Ring —— AC自动机 + DP
摘要:题目链接:https://vjudge.net/problem/HDU-2296 Ring Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 442 阅读全文

posted @ 2018-02-21 16:58 h_z_cong 阅读(176) 评论(0) 推荐(0)

HDU4511 小明系列故事——女友的考验 —— AC自动机 + DP
摘要:题目链接:https://vjudge.net/problem/HDU-4511 小明系列故事——女友的考验 Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission( 阅读全文

posted @ 2018-02-21 15:15 h_z_cong 阅读(267) 评论(0) 推荐(0)

HDU2457 DNA repair —— AC自动机 + DP
摘要:题目链接:https://vjudge.net/problem/HDU-2457 DNA repair Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s 阅读全文

posted @ 2018-02-21 13:49 h_z_cong 阅读(217) 评论(0) 推荐(0)

HDU2825 Wireless Password —— AC自动机 + 状压DP
摘要:题目链接:https://vjudge.net/problem/HDU-2825 Wireless Password Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi 阅读全文

posted @ 2018-02-20 22:12 h_z_cong 阅读(270) 评论(0) 推荐(0)

HDU2243 考研路茫茫——单词情结 ——AC自动机、矩阵优化
摘要:题目链接:https://vjudge.net/problem/HDU-2243 考研路茫茫——单词情结 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission( 阅读全文

posted @ 2018-02-20 18:10 h_z_cong 阅读(227) 评论(0) 推荐(0)

POJ2278 DNA Sequence —— AC自动机 + 矩阵优化
摘要:题目链接:https://vjudge.net/problem/POJ-2778 DNA Sequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18479 Accepted: 7112 Description It's 阅读全文

posted @ 2018-02-20 15:10 h_z_cong 阅读(431) 评论(0) 推荐(0)

LightOJ - 1151 Snakes and Ladders —— 期望、高斯消元法
摘要:题目链接:https://vjudge.net/problem/LightOJ-1151 1151 - Snakes and Ladders PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB 'Sna 阅读全文

posted @ 2018-02-13 20:35 h_z_cong 阅读(401) 评论(0) 推荐(0)

LightOJ - 1274 Beating the Dataset —— 期望
摘要:题目链接:https://vjudge.net/problem/LightOJ-1274 1274 - Beating the Dataset PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB You 阅读全文

posted @ 2018-02-13 20:33 h_z_cong 阅读(436) 评论(0) 推荐(0)

LightOJ - 1287 Where to Run —— 期望、状压DP
摘要:题目链接:https://vjudge.net/problem/LightOJ-1287 1287 - Where to Run PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Last night 阅读全文

posted @ 2018-02-13 20:32 h_z_cong 阅读(450) 评论(0) 推荐(0)

LightOJ - 1284 Lights inside 3D Grid —— 期望
摘要:题目链接:https://vjudge.net/problem/LightOJ-1284 1284 - Lights inside 3D Grid PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB Y 阅读全文

posted @ 2018-02-13 20:30 h_z_cong 阅读(346) 评论(0) 推荐(0)

LightOJ - 1248 Dice (III) —— 期望
摘要:题目链接:https://vjudge.net/problem/LightOJ-1248 1248 - Dice (III) PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB Given a dice 阅读全文

posted @ 2018-02-12 15:34 h_z_cong 阅读(193) 评论(0) 推荐(0)

LightOJ - 1265 Island of Survival —— 概率
摘要:题目链接:https://vjudge.net/problem/LightOJ-1265 1265 - Island of Survival PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You 阅读全文

posted @ 2018-02-12 15:29 h_z_cong 阅读(212) 评论(0) 推荐(0)

LightOJ - 1038 Race to 1 Again —— 期望
摘要:题目链接:https://vjudge.net/problem/LightOJ-1038 1038 - Race to 1 Again PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Rimi le 阅读全文

posted @ 2018-02-11 16:15 h_z_cong 阅读(162) 评论(0) 推荐(0)

LightOJ - 1079 Just another Robbery —— 概率、背包
摘要:题目链接:https://vjudge.net/problem/LightOJ-1079 1079 - Just another Robbery PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB As 阅读全文

posted @ 2018-02-11 16:14 h_z_cong 阅读(236) 评论(0) 推荐(0)

LightOJ - 1104 Birthday Paradox —— 概率
摘要:题目链接:https://vjudge.net/problem/LightOJ-1104 1104 - Birthday Paradox PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Someti 阅读全文

posted @ 2018-02-11 16:11 h_z_cong 阅读(203) 评论(0) 推荐(0)

LightOJ - 1030 Discovering Gold —— 期望
摘要:题目链接:https://vjudge.net/problem/LightOJ-1030 1030 - Discovering Gold PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You ar 阅读全文

posted @ 2018-02-11 16:09 h_z_cong 阅读(180) 评论(0) 推荐(0)

LightOJ - 1027 A Dangerous Maze —— 期望
摘要:题目链接:https://vjudge.net/problem/LightOJ-1027 1027 - A Dangerous Maze PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You ar 阅读全文

posted @ 2018-02-11 16:08 h_z_cong 阅读(233) 评论(0) 推荐(0)

CodeForces - 385E Bear in the Field —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/CodeForces-385E E. Bear in the Field time limit per test 1 second memory limit per test 256 megabytes input standard i 阅读全文

posted @ 2018-02-08 19:42 h_z_cong 阅读(358) 评论(0) 推荐(0)

UVA10518 How Many Calls? —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/UVA-10518 题解: 问:求斐波那契数f[n]的时候调用了多少次f[n] = f[n-1] + f[n-2],没有记忆化,一直递归到f[0]、f[1],其中f[0]、f[1]也算调用了一次。 设求f[n]调用了S[n]次,则可知: 阅读全文

posted @ 2018-02-08 13:44 h_z_cong 阅读(198) 评论(0) 推荐(0)

UVA11149 Power of Matrix —— 矩阵倍增、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/UVA-11149 题意: 给出矩阵A,求出A^1 + A^2 …… + A^k 。 题解: 1.可知:A^1 + A^2 …… + A^k = (1+A^k/2)*(A^1 + A^2 …… + A^k/2)+ (k%2?A^k:0) 阅读全文

posted @ 2018-02-07 17:01 h_z_cong 阅读(389) 评论(0) 推荐(0)

HDU4686 Arc of Dream —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-4686 Arc of Dream Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission 阅读全文

posted @ 2018-02-07 15:39 h_z_cong 阅读(313) 评论(0) 推荐(0)

HDU4565 So Easy! —— 共轭构造、二阶递推数列、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-4565 So Easy! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 阅读全文

posted @ 2018-02-07 14:33 h_z_cong 阅读(448) 评论(0) 推荐(0)

UVA10655 Contemplation! Algebra —— 推公式、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/UVA-10655 题意: a+b、ab的值分别为p、q,求a^n+b^n。 题解: 1.a、b未知,且直接求出a、b也不太实际。 2.看到 a^n+b^n 这个式子就想到二阶齐次递推式的通项公式,然后就想是否能通过通项公式反推回递推式 阅读全文

posted @ 2018-02-07 13:50 h_z_cong 阅读(262) 评论(0) 推荐(0)

HDU5950 Recursive sequence —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-5950 Recursive sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Subm 阅读全文

posted @ 2018-02-05 20:03 h_z_cong 阅读(225) 评论(0) 推荐(0)

UVA10870 Recurrences —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/UVA-10870 题意: 典型的矩阵快速幂的运用。比一般的斐波那契数推导式多了几项而已。 代码如下: 1 #include <bits/stdc++.h> 2 #define rep(i,s,t) for(int (i)=(s); ( 阅读全文

posted @ 2018-02-05 20:02 h_z_cong 阅读(250) 评论(0) 推荐(0)

HDU5171 GTY's birthday gift —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-5171 GTY's birthday gift Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Sub 阅读全文

posted @ 2018-02-05 20:02 h_z_cong 阅读(207) 评论(0) 推荐(0)

HDU4965 Fast Matrix Calculation —— 矩阵乘法、快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-4965 Fast Matrix Calculation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Tot 阅读全文

posted @ 2018-02-05 15:41 h_z_cong 阅读(306) 评论(0) 推荐(0)

UVA11551 Experienced Endeavour —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/UVA-11551 题意: 给定一列数,每个数对应一个变换,变换为原先数列一些位置相加起来的和,问r次变换后的序列是多少 题解: 构造矩阵:要加的位置值为1,其余位置为0。然后用快速幂计算。 代码如下: 1 #include <iost 阅读全文

posted @ 2018-02-05 15:09 h_z_cong 阅读(211) 评论(0) 推荐(0)

HDU4549 M斐波那契数列 —— 斐波那契、费马小定理、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-4549 M斐波那契数列 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 阅读全文

posted @ 2018-02-05 13:24 h_z_cong 阅读(229) 评论(0) 推荐(0)

UVA10689 Yet another Number Sequence —— 斐波那契、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/UVA-10689 题解: 代码如下: 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 #include < 阅读全文

posted @ 2018-02-04 16:38 h_z_cong 阅读(293) 评论(0) 推荐(0)

HDU4990 Reading comprehension —— 递推、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-4990 Reading comprehension Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S 阅读全文

posted @ 2018-02-04 16:34 h_z_cong 阅读(257) 评论(0) 推荐(0)

HDU5015 233 Matrix —— 矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/HDU-5015 233 Matrix Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission( 阅读全文

posted @ 2018-02-04 16:00 h_z_cong 阅读(407) 评论(0) 推荐(1)

CodeForces - 450B Jzzhu and Sequences —— 斐波那契数、矩阵快速幂
摘要:题目链接:https://vjudge.net/problem/CodeForces-450B B. Jzzhu and Sequences time limit per test 1 second memory limit per test 256 megabytes input standard 阅读全文

posted @ 2018-02-04 13:56 h_z_cong 阅读(182) 评论(0) 推荐(0)

数论小结
摘要:一. 素数筛、素数表 1.小区间素数(1e6、1e7): 2.大区间素数筛(1e12): 3.题目: 二.唯一分解定理 1.模板: 2.题目: 三. 欧几里得、扩展欧几里得 1.欧几里得算法: 辗转相除法证明: 设 d = gcd(a,b), 那么 d | a 、d | b …… 符号“|”表示整除 阅读全文

posted @ 2018-02-03 14:51 h_z_cong 阅读(194) 评论(0) 推荐(0)

导航