Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159173 刘老师 31回文字符串II C++ Accepted 2 MS 284 KB 386 2026-08-26 14:06:57

Tests(10/10):


Code:

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