当前位置:网站首页>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 边栏推荐
- Control file related views
- Wanzhou gold industry: what are the common gold investment and warehouse building modes?
- Synchronization mechanism of dual namenodes
- Electronic smart package tutorial
- 实现时序数据库(Time Series Database)在特定场景下“远超”通用数据库的难点
- 全面解析零知识证明:消解扩容难题 重新定义「隐私安全」
- Sword finger offer 22 The penultimate node in the linked list
- d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
- Simulated process scheduling
- 医院预约挂号系统-系统结构
猜你喜欢

Ping An technology's practice of migrating from Oracle to ubisql

Explain the distributed computing of Apache skywalking OAP in detail
![[the way of programmer training] - 3 Character count statistics](/img/0c/e506571a4b22edc7c02a346909eeab.jpg)
[the way of programmer training] - 3 Character count statistics

Wanzhou gold industry: what knowledge points do you need to master to invest in precious metals?

leetcode 200. Number of islands

d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download

leetcode 19. Delete the penultimate node of the linked list

Offline disk group

GAC Mitsubishi's new outlander made its first domestic debut in the year, and its product strength was fully renewed

428 binary tree (501. mode in binary search tree, 701. insert operation in binary search tree, 450. delete node in binary search tree, 669. prune binary search tree)
随机推荐
Hash encryption
Anfulai embedded weekly report (issue 252): February 7, 2022 to February 13, 2022
Optimal binary search tree
Why should string be designed to be immutable?
How can Seata performance be improved? For example, add a computing node to the database?
Advanced learning of MySQL -- Application -- Optimization of other SQL statements
[UVM foundation] build of UVM_ Phase execution sequence
d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
[qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment
leetcode 69. Square root of X
Android kotlin learning
[UVM foundation] can only be used in build_ Research on executing instantiation action in phase
TP5 generates the most detailed two-dimensional code tp6 (also available)
Shardingsphere sharding proxy actual combat scenario
【ELT.ZIP】OpenHarmony啃论文俱乐部—见证文件压缩系统EROFS
D use in
On array-_-
ansible环境安装及数据恢复
JS event binding and common events
实现时序数据库(Time Series Database)在特定场景下“远超”通用数据库的难点