Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3386 莫业祁 31回文字符串II C++ Accepted 1 MS 260 KB 529 2024-06-01 19:00:26

Tests(10/10):


Code:

# include<iostream> # include<cstring> using namespace std; string s1; bool fun(int l,int r){ int size=r-l+1; for(int i=0;i<size/2;i++){ if(s1[l+i]!=s1[r-i])return false; } return true; } int main(){ cin>>s1; int size=s1.size(); for(int i=0;i<=size-1;i++){ for(int j=size-1;j>i+1;j--){ if(fun(i,j)==true){ cout<<"Yes"<<endl; return 0; } } } cout<<"No"<<endl; return 0; }