Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
120924 | 罗子童 | 31回文字符串II | C++ | Accepted | 1 MS | 280 KB | 731 | 2025-06-01 19:23:00 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; string a; bool f(int l,int r){ int y=(r-l+1)/2; for(int i=0;i<y;i++){ if(a[l+i]!=a[r-i]){ return false; } } return true; } int main(){ cin>>a; int s=a.size(); for(int i=0;i<s-1;i++){ for(int j=s-1;j>i;j--){ if(f(i,j)&&(j-i!=1)){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }