Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3377 | 孙浚轩 | 31回文字符串II | C++ | Wrong Answer | 0 MS | 260 KB | 692 | 2024-06-01 18:26:03 |
#include<iostream> using namespace std; bool ispd(string s,int lens){ int len2s=lens/2; for(int i=0;i<len2s;i++) if(s[i]!=s[lens-i]) return 0; return 1; } int main(){ string st; cin>>st; int lenst=st.size(),lens=2; if(lenst<=2){ cout<<"No"; return 0; } for(;lens<lenst;lens++){ for(int i=0;i<lenst;i++){ string tstr; if(st[i]==st[i+lens]){ for(int j=0;j<=lens;j++) tstr+=st[i+j]; if(ispd(tstr,lens)){ cout<<"Yes"; return 0; } } } } cout<<"No"; return 0; }
------Input------
pqwieurytalskdjfhgvbcnxmzpqwoeiurytfhdjghfgbcnxmz
------Answer-----
No
------Your output-----
Yes