难道是我理解有问题?

P1210 [USACO1.3] 最长的回文 Calf Flac

@[dinghongyu](/space/show?uid=108879) 同志,不用输出空格哦
by 情谊、暴走 @ 2019-01-13 21:11:41


@[情谊、暴走](/space/show?uid=115923) 但题目中说空格要保留输出呀——在寻找回文时不用理睬那些标点符号、空格(但应该保留下来以便做为答案输出)
by dinghongyu @ 2019-01-13 21:15:01


@[dinghongyu](/space/show?uid=108879) 这的确是一个值得深思的问题……
by 情谊、暴走 @ 2019-01-13 21:17:25


其实这样的话还应该再输一个冒号
by dinghongyu @ 2019-01-13 21:25:09


@[dinghongyu](/space/show?uid=108879) ------------ ~~无视~~样例?
by 情谊、暴走 @ 2019-01-13 21:29:23


@[dinghongyu](/space/show?uid=108879) 蒟蒻正在敲键盘……
by 情谊、暴走 @ 2019-01-13 21:36:46


@[dinghongyu](/space/show?uid=108879) 大佬的代码好像没有判断s1[ansr]与s1[ansl]是否非字母。 **蒟蒻**提供代码: ```cpp inline void check(int mid){ register int sum=1,l=mid-1,r=mid+1; while(l--&&r++){ if(!isalpha(b[l]))l--; if(!isalpha(b[r]))r++; if (b[l]!=b[r])break; sum+=2; } if(ans<sum){ ans=sum,ansl=l,ansr=r; while(!isalpha(b[ansl]))ansl++; while(!isalpha(b[ansr]))ansr--; } return ; } ```
by 情谊、暴走 @ 2019-01-13 22:29:31


b数组就是s
by 情谊、暴走 @ 2019-01-13 22:31:04


@[情谊、暴走](/space/show?uid=115923) 谢谢指点,又改了点小地方,成功88分
by dinghongyu @ 2019-01-14 13:13:47


@[dinghongyu](/space/show?uid=108879) 在吗
by 情谊、暴走 @ 2019-01-14 13:16:46


| 下一页