Codeforces Beta Round #7, problem: (D) Palindrome Degree
来源:互联网 发布:新热血英豪mac 编辑:程序博客网 时间:2024/06/05 15:04
#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>__int64 dp[5000000+5];char s[5000000+5];using namespace std;int main(void){ __int64 ans=0,l=0,r=0,k=1; scanf("%s",s); for(int i=0;s[i];i++) { l=l*33+s[i]-'a'; r=r+(s[i]-'a')*k; k=k*33; if(l==r) dp[i+1]=dp[(i+1)/2]+1; ans+=dp[i+1]; } cout<<ans<<endl; return 0;}
- Codeforces Beta Round #7, problem: (D) Palindrome Degree
- Codeforces Beta Round #7 D. Palindrome Degree
- Codeforces Beta Round #7--D. Palindrome Degree(hash)
- Codeforces Beta Round #7--D. Palindrome Degree(Manacer)
- Codeforces Beta Round #7 D. Palindrome Degree —— hash
- CodeForces - 7D Palindrome Degree
- CodeForces 7D Palindrome Degree
- codeforces 7D Palindrome Degree
- codeforces 7D Palindrome Degree 字符串hash
- CodeForces 7D Palindrome Degree 字符串hash
- Codeforces 7D Palindrome Degree 字符串hash DP
- CF 7D: Palindrome Degree
- Codeforce 7D Palindrome Degree
- Codeforces Beta Round #35 (Div. 2), problem: (D) Animals DP
- [数据结构-hash]CF 7D Palindrome Degree
- #7 D. Palindrome Degree (manacher + dp)
- Codeforces Beta Round #51 D
- Codeforces Beta Round #7
- sendfile相关
- Java程序员面试中的多线程问题
- Android FileInputStream 、 FileOutputStream运用
- Myacm Triangles hoj,poj,uva 计算几何
- JAVA随机数
- Codeforces Beta Round #7, problem: (D) Palindrome Degree
- 在路上
- 品悟性能优化学习笔记一
- WinSock Tips
- Object-c---拷贝对象笔记
- java观察者模式
- jquery弹出框插件--jqModal
- index range scan,index fast full scan,index skip scan发生的条件
- 设计模式C++实现(4)——单例模式