| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146857 | hjx2444 | 统计回文子串 | C++ | Accepted | 115 MS | 276 KB | 497 | 2026-02-01 10:03:23 |
#include <bits/stdc++.h> using namespace std; int main() { char a[5001]; int i,j,k,m,n; while(cin>>a) { n=strlen(a); i=0; k=n; while(i<n) { j=1; while(j<=i and j<n-i) { if(a[i-j]==a[i+j]) k++; else break; j++; } if(a[i]==a[i+1]) { j=0; while(i-j>=0 and i+j+1<n) { if(a[i-j]==a[i+j+1]) k++; else break; j++; } } i++; } printf("%d\n",k); } return 0; }