Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159171 余建成 31回文字符串II C++ Accepted 1 MS 280 KB 381 2026-08-26 14:06:24

Tests(10/10):


Code:

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