Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92510 刘轻松 31回文字符串II C++ Accepted 2 MS 280 KB 406 2024-10-05 15:21:51

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; string str; bool isHW(int a,int b){ for(int i=0;i<(b-a+1)/2;i++){ if(str[a+i]!=str[b-i]){ return false; } } return true; } int main(){ cin>>str; for(int i=0;i<str.size();i++){ for(int j=i+1;j<str.size();j++){ if(isHW(i,j)==true&& j-i>1){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }