| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 128697 | 常钰杰 | 31回文字符串II | C++ | Wrong Answer | 1 MS | 280 KB | 672 | 2025-08-19 13:36:35 |
#include<bits/stdc++.h> using namespace std; string s; bool pd(int i,int j) { int b; b = abs(i-j) - 1; for(i = i; i < b / 2; i++) { if(s[i] != s[b - i]) { return false; } } return true; } int main() { cin >> s; for(int i = 0;s[i] != '\0';i++) { for(int j = 0;s[j] != '\0';j++) { if(i != j && s[i] == s[j] && abs(i-j)!=1) { if(pd(i,j)) { cout << "Yes"; return 0; } } } } cout << "No"; return 0; }
------Input------
qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwerty
------Answer-----
No
------Your output-----
Yes