Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
99905 | 刘轻松 | 31回文字符串II | C++ | Accepted | 1 MS | 280 KB | 392 | 2024-12-01 10:42:15 |
#include<bits/stdc++.h> using namespace std; string s; bool isHW(int l,int r){ for(int i=0;i<=((r-l+1)/2);i++){ if(s[i+l]!=s[r-i]){ return false; } } return true; } int main(){ cin>>s; int len=s.size(); for(int i=0;i<len-1;i++){ for(int j=len-1;j>i;j--){ if(isHW(i,j) && j-i>1){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }