| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 70816 | 刘轻松 | 31回文字符串II | C++ | Wrong Answer | 2 MS | 276 KB | 423 | 2024-04-20 08:56:40 |
#include<bits/stdc++.h> using namespace std; string s1; bool isHui(int i,int j){ int l=j-i; for(int k=i;k<=l/2;k++){ if(s1[k]!=s1[j-k]){ return 0; } } return 1; } int main(){ string s1; getline(cin,s1); int len = s1.length(); for(int i=0;i<len-1;i++){ for(int j=len-1;j>i;j--){ if(isHui(i,j)&&j-i>2){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }
------Input------
qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwerty
------Answer-----
No
------Your output-----
Yes