当前位置:网站首页>Contest3182 - the 39th individual training match for 2021 freshmen_ F: ss
Contest3182 - the 39th individual training match for 2021 freshmen_ F: ss
2022-06-27 18:29:00 【This question AC sleep again】


// There exists a non-empty even string
// that can be obtained by deleting one or more characters from the end of S.
//
#include<bits/stdc++.h>
using namespace std;
const int MAXN=222;
char str[MAXN];
bool judge( int len )
{
if( len&1 ) return false;
char *p1=str;
char *p2=str+len/2;
int cnt=0;
while( cnt<len/2 )
{
if( *p1!=*p2 ) return false;
p1++; p2++; cnt++;
}
return true;
}
int main()
{
while( ~scanf("%s",str) )
{
int len=strlen(str); // -1
while( judge( --len )==false );
printf("%d\n",len);
}
return 0;
}//
find:
01 len/2 Be careful Discrimination between subscript and quantity -1
02 Pay attention to the meaning of the question Original string does not count At least one character must be subtracted 边栏推荐
- Some details of Huawei OSPF
- What do fast fashion brands care more about?
- Simulated process scheduling
- 时间序列数据的特点
- Alibaba cloud server is invaded
- Explain the distributed computing of Apache skywalking OAP in detail
- Wanzhou gold industry: what knowledge points do you need to master to invest in precious metals?
- (5) SPI application design and simulation verification 2 - design code implementation
- [UVM basics] UVM tree organizational structure
- 软件测试基础-软件测试历史流程,分类,好处,限制
猜你喜欢

Explain the distributed computing of Apache skywalking OAP in detail

Related configuration commands of Huawei LACP

leetcode 92. Reverse linked list II

Simulated process scheduling

leetcode 82. Delete duplicate Element II in the sorting linked list

d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
![[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes](/img/cb/0be2b2cf3b2cfa903190b7795d3cd7.jpg)
[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes

Sword finger offer 22 The penultimate node in the linked list

如何制作登录界面

Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)
随机推荐
Simulated process scheduling
[UVM basics] set a monitor at the input port of the DUT to explain the necessity
About binary
简历如何去写?
d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
写在eclipse里面,与数据库连接查询之后的问题
[Tang Laoshi] C -- encapsulation: member method
软件测试基础-软件测试历史流程,分类,好处,限制
Bit. Store: long bear market, stable stacking products may become the main theme
Application of scaleflux CSD 2000 in Ctrip
ROS "topic" programming implementation
Handling method of occasional error reporting on overseas equipment
黑马程序员-软件测试基础班-02-30-45工具代开浏览器运行代码,音、视频、测试点,音视频标签,布局标签。超链接语法进阶,绝对路径,相对路径
时序数据库(Time Series Database)的存储引擎要想做到极致,还得自研
Oracle的NUMBER长度超过19之后,实体使用Long映射,导致出现问题是为什么?
Asemi rectifier bridge kbp307 parameters, kbp307 details, kbp307 pictures
seata-server 端数据库连接用户、业务数据库 undo_log 所属用户都需要什么权限?
Software testing - the concept of testing, the detailed introduction of unit testing, and how to design test cases
All you want to know about large screen visualization is here
Software testing learning - dark horse programmer, software testing learning outline