超时了

ljy2022 2022-09-13 22:00:36 6

#include<bits/stdc++.h> using namespace std; char f[1200]; int h(int a,int b){ int m=a,n=b; while(m<=n){ if(f[m]!=f[n]) return 0; m++; n--; } for(int i=a;i<=b;i++) cout<<f[i]; cout<<endl; } int main(){ cin>>f; int x=strlen(f); for(int i=1;i<=x;i++){ for(int k=0;k<x-i;k++) h(k,k+i); } return 0; }

{{ vote && vote.total.up }}