Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92485 | 刘轻松 | 31回文字符串II | C++ | Wrong Answer | 1 MS | 276 KB | 421 | 2024-10-05 14:44:09 |
#include<bits/stdc++.h> using namespace std; string str; bool isHW(int a,int b){ for(int i=a;i<(a+b)/2;i++){ if(str[i]!=str[b-a-i]){ return false; } } return true; } int main(){ cin>>str; int a,b; bool flag=true; for(int i=0;i<str.size()-2;i++){ for(int j=i+2;j<str.size();j++){ if(isHW(i,j)==true){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }
------Input------
qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwerty
------Answer-----
No
------Your output-----
Yes