字符串
文章平均质量分 76
ACMega
精通C/C Java 要饭
展开
-
Uva1401 - Remember the Word
#include #define maxn 100010 #define INF (int)(1e9) #define MOD 20071027 #define maxnode 500010 #define sigma_size 30 typedef long long ll; using namespace std; int dp[maxnode]; char str[max原创 2014-05-06 01:02:09 · 354 阅读 · 0 评论 -
UVa11732 - strcmp() Anyone?
Trie #include #define sigma_size 100 #define maxnode 4000010 typedef long long ll; using namespace std; ll ans; struct Trie { struct Node { int val;//记录结点字母 int cnt;//记录节点字母出现次数原创 2014-05-15 00:22:45 · 229 阅读 · 0 评论 -
Uva1328 - Period
KMP #include #define INF (int)(1e9) #define maxn 1000010 #define sigma_size 100 using namespace std; char str[maxn]; int f[maxn]; void GetNext(char *p) { int m = strlen(p); f[0] = f[1] = 0;原创 2014-05-15 01:43:16 · 245 阅读 · 0 评论 -
UESTC807 - Caruta
Trie 记录结点数 #include #include #include #include #include #define MOD ((int)(1e9) + 7) #define eps 1e-10 using namespace std; typedef long long ll; #define sigma_size 110 #define maxnode 100010 i原创 2014-05-25 14:28:45 · 242 阅读 · 0 评论 -
Codeforces Round #246 (Div. 2) - Prefixes and Suffixes
KMP #include #include #include #include #include #define maxn 100010 #define INF (int)(1e9) #define MOD ((int)1e9+7) #define maxnode 400010 #define sigma_size 30 typedef long long ll; typedef un原创 2014-05-26 16:45:01 · 352 阅读 · 0 评论