Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
135598 李朋秦 31回文字符串II C++ Accepted 2 MS 280 KB 403 2025-11-07 18:22:12

Tests(10/10):


Code:

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