随笔分类 -  字符串——Hash

摘要:处理0的前缀和,枚举第i位不变,[1,i-1]全变为0,[i+1,n]全变为1的最小代价 1 #include <cstring> 2 #include <cstdio> 3 4 const int N(1e5+5); 5 int sum[N],ans,tmp; 6 char s[N]; 7 8 i 阅读全文
posted @ 2017-10-17 15:51 Aptal丶 阅读(114) 评论(0) 推荐(0)
摘要:1 #include <algorithm> 2 #include <cstring> 3 #include <cstdio> 4 5 inline void read(int &x) 6 { 7 x=0; register char ch=getchar(); 8 for(; ch>'9'||ch 阅读全文
posted @ 2017-10-15 20:08 Aptal丶 阅读(136) 评论(0) 推荐(0)
摘要:https://www.luogu.org/problem/show?pid=2957 题目描述 The cows enjoy mooing at the barn because their moos echo back, although sometimes not completely. Be 阅读全文
posted @ 2017-08-14 17:54 Aptal丶 阅读(375) 评论(0) 推荐(0)
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1355 Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 964 Solved: 664[Submit][Status][Discuss] Descriptio 阅读全文
posted @ 2017-08-14 17:23 Aptal丶 阅读(229) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3461 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 42698 Accepted: 17154 http://poj.org/problem?id=3461 Descrip 阅读全文
posted @ 2017-08-14 10:42 Aptal丶 阅读(153) 评论(0) 推荐(0)
摘要:http://codevs.cn/problem/3013/ 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题解 查看运行结果 http://codevs.cn/problem/3013/ 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻 阅读全文
posted @ 2017-08-13 09:52 Aptal丶 阅读(238) 评论(0) 推荐(0)
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3555 Description PenguinQQ是中国最大、最具影响力的SNS(Social Networking Services)网站,以实名制为基础,为用户提供日志、群、即时通讯、相册、集市等丰 阅读全文
posted @ 2017-08-01 16:34 Aptal丶 阅读(251) 评论(1) 推荐(0)
摘要:题目描述 如题,给定N个字符串(第i个字符串长度为Mi,字符串内包含数字、大小写字母,大小写敏感),请求出N个字符串中共有多少个不同的字符串。 友情提醒:如果真的想好好练习哈希的话,请自觉,否则请右转PJ试炼场:) 输入输出格式 输入格式: 第一行包含一个整数N,为字符串的个数。 接下来N行每行包含 阅读全文
posted @ 2017-05-22 22:23 Aptal丶 阅读(195) 评论(0) 推荐(0)