poj2752 水题
又2b了一次……
var s:ansistring;
ans,pre:array[..] of longint;
i,k,tot:longint;
procedure main;
begin
pre[]:=;k:=;
for i:= to length(s) do
begin
while (k<>) and (s[k+]<>s[i]) do k:=pre[k];
if s[k+]=s[i] then inc(k);
pre[i]:=k;
end;
k:=pre[length(s)];
tot:=;
while k<> do
begin
inc(tot);ans[tot]:=k;
k:=pre[k];
end;
for i:=tot downto do write(ans[i],' ');
writeln(length(s));
end;
begin
while true do
begin
readln(s);if s='' then break;
main;
end;
end.
poj2752 水题的更多相关文章
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
- ACM水题
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...
- CF451C Predict Outcome of the Game 水题
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...
随机推荐
- Spark Tungsten揭秘 Day1 jvm下的性能优化
Spark Tungsten揭秘 Day1 jvm下的性能优化 今天开始谈下Tungsten,首先我们需要了解下其背后是符合了什么样的规律. jvm对分布式天生支持 整个Spark分布式系统是建立在分 ...
- Linux学习1
Linux中一切皆文件,且不依靠扩展名区分文件,学习Linux必须要熟悉在字符界面进行文件的管理. 首先是Linux的查询命令. (1)ls -a是显示当前目录所有文件,包含隐藏文件,如图中文件名前加 ...
- 支持异步通知的globalfifo平台设备驱动程序及其测试代码
驱动: #include <linux/module.h> #include <linux/types.h> #include <linux/fs.h> #incl ...
- u3d 2d序列动画代码
using UnityEngine; using System.Collections; public class AniSprite : MonoBehaviour { private float ...
- unity3d KeyCode各键值说明
KeyCode :KeyCode是由Event.keyCode返回的.这些直接映射到键盘上的物理键. http://docs.unity3d.com/ScriptReference/KeyCode.h ...
- Python+PyQt 数据库基本操作
Sqlite: 使用Python的sqlite3: 需要注意下commit方式与qt稍有不同 import sqlite3 class DBManager(): def __init__(self): ...
- Failed to execute command: ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ResGen.exe" 的一个解决办法
最近在做wpf项目,期间下了一些源码参考,但是在build时经常遇到下面这种bug: Error 2 Failed to execute command: ""C:\Program ...
- Mooncake (排序+贪心)
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types ...
- PHP 一个可以过滤非法脚本的函数
这里提供一个过滤非法脚本的函数: function RemoveXSS($val) { // remove all non-printable characters. CR(0a) and L ...
- sql之表连接和group by +组函数的分析
1.首先我们来先看一个简单的例子: 有[Sales.Orders]订单表和[Sales.Customers]顾客表,表的机构如下 业务要求:筛选 来自“按时打算”国家的用户以及所下的订单数 sele ...