Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159175 孔声豪 31回文字符串II C++ Accepted 1 MS 272 KB 376 2026-08-26 14:09:12

Tests(10/10):


Code:

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