CF 319D(Have You Ever Heard About the Word?-模拟)
来源:互联网 发布:linux c 调用so动态库 编辑:程序博客网 时间:2024/05/01 05:53
模拟能过……
E文是硬伤,要的是最短中最左子串,不是最左中最短子串……
#include<cstdio>#include<cstdlib>#include<cstring>#include<iostream>#include<algorithm>#include<functional>#include<cmath>#include<cctype>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Rep(i,n) for(int i=0;i<n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForD(i,n) for(int i=n;i;i--)#define Forp(x) for(int p=pre[x];p;p=next[p])#define RepD(i,n) for(int i=n;i>=0;i--)#define MEM(a) memset(a,0,sizeof(a))#define MEMI(a) memset(a,127,sizeof(a))#define MEMi(a) memset(a,128,sizeof(a))#define MAXN (50000+10)char s[MAXN];int main(){//freopen("CF319D.in","r",stdin);//freopen(".out","w",stdout);int t=1;while (t--){int n=strlen(gets(s+1));For(len,n/2){int tot=0;For(j,n-len){if (s[j]==s[j+len]) tot++;else tot=0;if (tot==len){Fork(k,j+1,n-len) s[k]=s[k+len];n-=len;len=0;break;}}}s[n+1]=0;puts(s+1);}return 0;}
- CF 319D Have You Ever Heard About the Word?
- CF 319D(Have You Ever Heard About the Word?-模拟)
- CF 319D Have You Ever Heard About The World? 二分Hash判断可行解
- If you ever have a broken heart
- What is the best(funniest) comment in source code you have ever encountered?
- What is the best comment in source code you have ever encountered? [closed]
- Did I ever tell you about Ashton?
- Have you ever chatted with a Hacker within a virus?
- More than you ever wanted to know about GeoJSON
- CF 109D 模拟
- I “Heard” the Love
- Have u ever experienced the grace of C++?
- "I ask you, have you ever known what it is to be an orphan?"
- The best article about SVM ever (Chinese version)
- CF 372D Dijkstra+模拟
- OSX I have heard of people on OSX running in to problems due to the terminal pointing to the native
- Saving changes is not permitted. The changes that you have made require the following tables to be d
- The shortest guide to character sets you'll ever read
- SqlServer和Oracle中一些常用的sql语句8 触发器和事务
- 面向对象
- ORA-01034 或者 ORA-27101 终极解决办法(有图有真相)
- 凯撒加密
- 用宏区分操作系统和编译器
- CF 319D(Have You Ever Heard About the Word?-模拟)
- 计算机科学中最重要的32个算法
- 基于Andoird 4.2.2的Account Manager源代码分析学习:AccountManager的初始化
- CCNode
- 找出删除两个文件相同部分Linux_grep,comm,awk
- GNUPLOT使用技巧
- 6410 otg 主控制器驱动移植
- CF 189 div2 D
- [队] 链式