当前位置:网站首页>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 边栏推荐
- Overview of Inspur Yunxi database executor
- Oracle TRUNC function processing date format
- Anfulai embedded weekly report (issue 252): February 7, 2022 to February 13, 2022
- Optimal binary search tree
- 07. Express routing
- (5) SPI application design and simulation verification 2 - design code implementation
- Wechat applet map displays the current position with annotation
- 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)
- Leetcode 5. Longest Palindromic Substring
猜你喜欢

Oracle concept II

CDH cluster installation

(5) SPI application design and simulation verification 1 - logic sorting

WOx WPM installing the Youdao plug-in

Defiato is an innovation that combines user-friendly features of a centralized platform with defi services

leetcode 19. Delete the penultimate node of the linked list

Asemi rectifier bridge kbp310 function pin diagram

Analysis of shardingsphere core source code

【ELT.ZIP】OpenHarmony啃论文俱乐部—见证文件压缩系统EROFS

Halcon: discrete digital OCR recognition
随机推荐
Oracle TRUNC function processing date format
如何提升IT电子设备效能管理
JS event binding and common events
Asemi rectifier bridge kbp310 function pin diagram
ROS "topic" programming implementation
leetcode 92. Reverse linked list II
Analysis of shardingsphere core source code
Set up your own website (10)
(POJ - 1847) tram (shortest circuit)
建立自己的网站(10)
Unity shadow shadow pancaking
Some details of Huawei OSPF
Redis installation
[Tang Laoshi] C -- encapsulation: member method
Part 32 supplement (32) string of ECMAScript
Wechat applet map displays the current position with annotation
Hash encryption
WOx WPM installing the Youdao plug-in
[UVM foundation] build of UVM_ Phase execution sequence
About binary