Seek the Name, Seek the Fame

Obsidian从零搭建:可验证、可回溯、可演进的知识库工具链 个人知识库不是开箱即用的软件,而是基于Markdown内核构建的可演进系统。其核心原理在于分离‘稳定内核’与‘可插拔扩展’:Obsidian原生支持双链、嵌入、Frontmatter等基础能力,构成不可降级的知识骨架;而Dataview、Templater等插件则作为可验证、可回溯的增强层,需通过三问验证(解决痛点?有原生替代?失效可降级?)方可引入。这种设计赋予知识库技术价值——抗版本升级、跨平台兼容、离线可用,并支撑技术文档管理、项目复盘、读书笔记等真实场景。当面对computer use插件不可用或h 阅读详情

题目描述:

The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the fame. In order to escape from such boring job, the innovative little cat works out an easy but fantastic algorithm:

Step1. Connect the father’s name and the mother’s name, to a new string S.
Step2. Find a proper prefix-suffix string of S (which is not only the prefix, but also the suffix of S).
在这里插入图片描述

Example: Father=‘ala’, Mother=‘la’, we have S = ‘ala’+‘la’ = ‘alala’. Potential prefix-suffix strings of S are {‘a’, ‘ala’, ‘alala’}. Given the string S, could you help the little cat to write a program to calculate the length of possible prefix-suffix strings of S? (He might thank you by giving your baby a name:)

输入:

The input contains a number of test cases. Each test case occupies a single line that contains the string S described above.

Restrictions: Only lowercase letters may appear in the input. 1 <= Length of S <= 400000.

输出:

For each test case, output a single line with integer numbers in increasing order, denoting the possible length of the new baby’s name.

样例输入:

ababcababababcabab
aaaaa

样例输出:

2 4 9 18
1 2 3 4 5

code:

题目大意:
给定一个字符串s,有哪些长度的s的前缀,同时也是s的后缀。
使用KMP算法的next[ ]数组,即可完成这一个要求

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<set>
using namespace std;
const int maxn=1e6+10;
char a[maxn];
int nextt[maxn];
int n;
void init()
{
	int i=0,j=-1;
	n=strlen(a);
	nextt[0]=-1;
	int maxx=1;
	while(i<n)
	{
		if(j==-1||a[i]==a[j])
		{
			i++;
			j++;
			nextt[i]=j;
		}
		else j=nextt[j];
	}
}
void print(int what)
{
	if(what==0)return ;
	print(nextt[what]);
	printf("%d ",what);
}
int main()
{
	while(scanf("%s",a)!=EOF)
	{
		init();
		print(nextt[strlen(a)]);
		printf("%d\n",strlen(a));
	}
	return 0;
}

ubuntu通过qemu安装银河麒麟V10_Arm_v8 (kylin_v10_飞腾/鲲鹏版) 一、windows下安装vmware虚拟机 二、ubuntu下载地址 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04/ubuntu-20.04.3-live-server-amd64.iso 三、vmware中新建虚拟机,并使用ubuntu-20.04.3-live-server-amd64.iso作为启用盘 。。。在虚拟机中安装ubuntu(略) 四、配置ssh(如果ssh登录不上时配置) 修改openssh的配置 vi /etc/s 阅读详情

相关推荐

保姆级教程:手把手教你给联想System x 3650 M5服务器配置RAID 5并U盘装系统

本文提供联想System x 3650 M5服务器配置RAID 5并U盘安装系统的详细教程,特别适合零基础运维人员。从准备工作、RAID 5配置到U盘引导和系统安装,涵盖全流程关键步骤与常见问题解决方案,帮助用户高效完成服务器部署。

weixin_42535703的博客 358

POJ 2752 Seek the Name, Seek the Fame(KMP)

POJ 2752 Seek the Name, Seek the FameDescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. T

This is Mendez. 702

VN1630A硬件配置指南:手把手教你用CanApe搭建XCP标定工程(附ELF文件配置技巧)

本文详细介绍了如何使用VN1630A硬件和CanApe软件搭建XCP标定工程,包括硬件配置、CanApe工程创建、ELF文件处理及XCP协议层配置等关键步骤。特别针对实际项目中常见的错误和细节问题提供解决方案,帮助工程师高效完成ECU参数标定工作。

git9versioner的博客 1157

【一本通】Seek the Name, Seek the Fame

给定若干字符串(这些字符串总长 ≤4×105),在每个字符串中求出所有既是前缀又是后缀的子串长度。 例如:ababcababababcabab,既是前缀又是后缀的:ab,abab,ababcabab,ababcababababcabab。

✨ 欢迎来到【Seal ^_^ 的优快云博客】!✨ 5351

Win10环境下VS2019离线部署OnnxRuntime的完整指南

本文提供了在Windows 10系统下,为Visual Studio 2019进行OnnxRuntime离线部署的完整教程。针对网络受限环境,详细讲解了如何获取正确的离线安装包、配置本地NuGet源,并逐步指导项目配置与测试,确保AI模型在C++环境中顺利运行。

weixin_29205061的博客 400

电容式触摸抗干扰设计:工业环境下的实践方案

针对工业环境中电容式touch器件易受干扰的问题,分享实用的硬件布局与软件滤波方案,提升touch响应稳定性和可靠性。

weixin_35755562的博客 843

Openjudge Seek the Name, Seek the Fame

Openjudge 数据结构与算法MOOC Seek the Name, Seek the Fame

qq_51767234的博客 403

【RT-DETR涨点改进】全网独家创新,卷积细节涨点改进篇 | TCSVT 2025 | 引入DGBM差分专家引导双向调制模块,利用双向仿射调制实现特征分布对齐,含多种创新改进,助力小目标检测高效涨点

本文提出DGBM差分专家引导双向调制模块,用于改进RT-DETR目标检测网络。该模块通过差分建模突出不同层级特征的独特信息,利用双向调制实现特征分布对齐,增强局部细节与全局语义的协同表达。DGBM包含差分专家机制、物理反演建模和双向仿射调制三个关键部分,能有效解决CNN与Transformer特征融合冲突问题。实验表明,该方法可提升复杂场景下的检测精度,降低误检漏检率,且模块具有可插拔、易集成的特点。文章详细介绍了模块结构、原理、优势及具体实现代码,并提供了四种RT-DETR改进方案的yaml配置文件。

Ai缝合怪、助力小伙伴高效发论文 441

哈希 poj2752 Seek the Name, Seek the Fame

Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 17568   Accepted: 9009 Description The little cat is so famous, that many couples tramp over hill and dale to Byteland,

fanesemyk的博客 461

什么是垂直同步?电脑快速消除屏幕撕裂与提升游戏性能的方法 垂直同步、游戏画面撕裂、游戏优化、VSync、FPS、FreeSync、G-Sync、显卡驱动更新、游戏画质、输入延迟

看这张动图,左边的画面出现了明显“切开”的断层现象,而右边画面非常流畅,没有撕裂。这正是「垂直同步」开关的区别。:每秒生成多少帧图像。比如 60FPS 表示一秒钟显示 60 张图片。刷新率(Refresh Rate):显示器每秒刷新几次画面,单位是赫兹(Hz)。60Hz 表示每秒刷新 60 次。参数说明FPS显卡渲染速度(逻辑帧率)刷新率显示器的显示频率(物理限制)当 FPS 高于刷新率时,显卡渲染的画面来不及被显示器显示,导致撕裂。屏幕撕裂(Screen Tearing)

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1347

国密GmSSL v2版本命令行方式生成国密sm2私钥、公钥、签名和验证签名

GmSSL是国密算法的工具库(主要包含SM2、SM3、SM4和国密SSL证书生成等功能),项目本身是OpenSSL的分支,但是截至文章发布为止,OpenSSL主分支的国密算法并不完善,目前并不支持签名和解签,所以国密算法这块还是需要使用GmSSL工具库。网上现在并没有v2版本的GmSSL可用的命令行文章,本章用于记录这些命令。本文原创自csdn博客,其他网站看到这篇文章都是盗,版,爬。虫。网站,支持原创,远离盗版。

eguid音视频方向博客,分享经过实践检验的硬核音视频技术。FFmpeg、openCV和JavaCV音视频和图像处理系列教程发布十周年,众多开发者的严格验证。欢迎关注,一起交流探索学习最新音视频和图像处理技术 4604

【hash】Seek the Name, Seek the Fame

【哈希和哈希表】Seek the Name, Seek the Fame 题目描述 The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born bab...

weixin_30609287的博客 178

英伟达(NVIDIA) 显卡型号、计算能力(CC)、CUDA版本、PyTorch版本 对照表

本文全面梳理NVIDIA显卡型号与其计算能力(CC)的对应关系,并详解各代CUDA版本对不同架构的支持与弃用情况,帮助用户判断硬件兼容性。同时,结合PyTorch官方发布版本,整理其支持的CUDA版本清单,指导开发者合理选择深度学习环境配置。涵盖从Jetson嵌入式设备到H100、Blackwell等最新旗舰显卡,是一份实用的AI开发环境搭建参考指南。

寒水馨 · 轻量级技术文档 · hanshuixin.org 4890

POJ 2752 Seek the Name, Seek the Fame

DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same ti

Monster_Day的博客 7826

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

【字符串匹配】Seek the Name, Seek the Fame

Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8567   Accepted: 4036 Description The little cat is so famous, that many couples t

wu_yihao的专栏 688

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

Seek the Name, Seek the Fame(kmp)

Description The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same ...

海马有力量的博客 719

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Seek the Name, Seek the Fame(KMP)

Description The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same ...

计算机科学与技术专业学生的成长之路 777

POJ 2752 Seek the Name,Seek the Fame

Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 14048   Accepted: 6990 Description The little cat is so famous, that many coup

Moressette流沙的博客 408

U - Seek the Name, Seek the Fame

Time Limit: 2000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description

mr_lee 632

Seek the Name, Seek the Fame(哈希)

The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek th...

booty 708

POJ2752 Seek the Name, Seek the Fame

Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 27506 Accepted: 14240 Description The little cat is so famous, that many couples tramp over hill and dale to B...

DouglasConnor的博客 261

Seek the Name, Seek the Fame (KMP)

题目链接: Seek the Name, Seek the Fame 题目大意: 给定一个字符串,现在要找一些跟给定的字符串的前缀和后缀相同的字符串的长度。 题解: 利用KMP里面的next数组解决这一道题 我们用next数组求出来的是跟后缀相同的前缀,也就是上图中的左边的红色绿色和右边的红色绿色,那么如果说左边的红色和绿色相同的话,也就意味着左边的绿色等于右边的绿色,也就是前面的...

BigZong 630

KMP之Seek the Name, Seek the Fame

Seek the Name, Seek the Fame   题目描述: The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. Th

loterior的博客 340
上一篇: Power Strings
下一篇: Blue Jeans
大橘为重eleven
博客等级 码龄8年 35粉丝 103原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值