Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159179 张蔚林 31回文字符串II C++ Accepted 1 MS 280 KB 381 2026-08-26 14:11:40

Tests(10/10):


Code:

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