結果
| 問題 |
No.588 空白と回文
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-04 18:42:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 431 bytes |
| コンパイル時間 | 2,191 ms |
| コンパイル使用メモリ | 194,096 KB |
| 最終ジャッジ日時 | 2025-02-07 21:20:40 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 9 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
string s; cin >> s;
int n = int(s.size()), ans = 1;
rep(i,n) {
int cnt = 0;
rep(k,n) if(0 <= i - k && i + k < n)
cnt += (s[i - k] == s[i + k]);
ans = max(ans, cnt * 2 - 1);
}
cout << ans << endl;
}