結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-15 02:09:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 351 bytes |
| コンパイル時間 | 2,585 ms |
| コンパイル使用メモリ | 192,164 KB |
| 最終ジャッジ日時 | 2025-01-13 00:52:33 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 28 WA * 4 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0),ios::sync_with_stdio(false);
string s; cin>>s;
int ans=1;
for(int L=0;L<s.size();++L){
for(int R=L+1;R<s.size();++R){
if(s.at(L)!=s.at(R))continue;
int LL=L,RR=R;
while(LL<RR&&s.at(LL)==s.at(RR))++LL,--RR;
if(LL>=RR)ans=max(ans,R-L+1);
}
}
cout<<ans<<"\n"s;
}