結果
| 問題 |
No.588 空白と回文
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-03 22:39:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 401 bytes |
| コンパイル時間 | 620 ms |
| コンパイル使用メモリ | 69,916 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-22 16:00:56 |
| 合計ジャッジ時間 | 1,331 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 9 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
const int n = s.size();
int ans = 0;
for (int i = 0; i < n; i++) {
int cnt = 1;
for (int j = 1; i - j >= 0 && i + j < n; j++) {
if (s[i - j] == s[i + j]) {
cnt += 2;
}
}
ans = max(ans, cnt);
}
cout << ans << endl;
}