POJ 1200 Hash
来源:互联网 发布:淘宝如何赚集分宝 编辑:程序博客网 时间:2024/05/18 01:24
我的hash从来没写对过。。。。。。。。
(白学了快一年OI ……原来连个hash都没写对过)
但是
但是
今天是一个值得纪念的日子。
看看标题
我竟然在写hash的题解。
(好了好了 废话少说)
题意:
给你一个串,求长度为n的不同的子串的个数。
题目中的NC是什么意思 反正我没看懂,(But我能AC)
思路:
QY讲的hash 随便搞搞就过了。。。
// by SiriusRen#include <bitset>#include <cstdio>#include <cstring>using namespace std;#define N 100000007bitset<N>b;long long nc,n,ans=0,len,q=0;char a[700000];int main(){ scanf("%lld%lld\n%s",&n,&nc,a); len=strlen(a); for(int i=0;i<=len-n;i++){ for(int j=0;j<n;j++) q=((q<<8)+a[i+j])%N; if(!b[q])b[q]=1,ans++; q=0; } printf("%lld",ans);}
0 0
- poj 1200 hash
- POJ 1200 字符串hash
- POJ 1200 Hash
- poj 1200字符串hash
- poj 1200 (字符串hash)
- poj 1200 hash
- poj 1200 (hash)
- POJ 1200 Hash
- poj 1200 hash
- POJ 1200 Hash
- POJ 1200字符串hash
- POJ 1200 Crazy Search //HASH
- poj 1200 Crazy Search【hash】
- poj 1200(字符串hash)
- POJ 1200 Crazy Search(Hash)
- POJ 1200 Crazy Search(hash).
- [POJ] 1200 Crazy Search [HASH]
- poj 1200:Crazy Search (Hash)
- IDEA破解代码
- Android 事件总线OTTO用法快速入门
- Android RecyclerView 使用完全解析
- androidstudio解决Internal error please report to https://code.google.com/p/android/issues
- Y/N退出选择训练
- POJ 1200 Hash
- C语言 volatile 修饰 变量作用 总结
- Android自定义键盘之汉字键盘
- hdu 2896 病毒侵袭(AC自动机)
- spring boot 工程配置文件
- mac 安装Navicat Premium 注册机
- 腾讯2017实习生编程题之有趣的数字
- 推荐系统之协同过滤(CF)
- spring boot log日志