当前位置:网站首页>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 边栏推荐
- Set up your own website (10)
- The European unified charging specification act was passed before the end of the year, and it is planned to expand to products such as laptop and keyboard
- d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?
- All you want to know about large screen visualization is here
- 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)
- Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately
- (5) SPI application design and simulation verification 1 - logic sorting
- 06. First introduction to express
- [the way of programmer training] - 3 Character count statistics
- Impressive questions
猜你喜欢

Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)

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

Project team management - Tuckman ladder theory

软件测试基础-软件测试历史流程,分类,好处,限制

Computing trends in three times of machine learning

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

The power of code refactoring: how to measure the success of refactoring

Handling method of occasional error reporting on overseas equipment

Oracle TRUNC function processing date format

电子智慧套装教程
随机推荐
leetcode 200. Number of islands
Ten common methods of arrays tools
d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
Asemi rectifier bridge kbp210 parameters, kbp210 specifications, kbp210 dimensions
Awk determines whether the first column is greater than 1. If it is greater than 1, the row will be printed
新产品新人事新服务,英菲尼迪继续深耕中国未来可期!
LeetCode 124. Binary tree maximum path sum - binary tree series question 8
Ping An technology's practice of migrating from Oracle to ubisql
The European unified charging specification act was passed before the end of the year, and it is planned to expand to products such as laptop and keyboard
Computing trends in three times of machine learning
Related configuration commands of Huawei LACP
Application of scaleflux CSD 2000 in Ctrip
Leetcode 704. Binary search
d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
软件测试学习-黑马程序员,软件测试学习大纲
The power of code refactoring: how to measure the success of refactoring
Oracle concept II
Redis installation
Oracle的NUMBER长度超过19之后,实体使用Long映射,导致出现问题是为什么?
Optimal binary search tree