結果
| 問題 | No.273 回文分解 |
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-08-06 06:24:45 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 785 bytes |
| 記録 | |
| コンパイル時間 | 3,096 ms |
| コンパイル使用メモリ | 274,612 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-01 23:42:56 |
| 合計ジャッジ時間 | 4,446 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll mod=1000000007;
ll inf=10099999999999990;
int main(){
string s;
cin >> s;
ll ans=0;
for (ll i = 0; i < s.size(); i++)
{
for (ll j = 0; j < s.size(); j++)
{
if (i==0&&j==s.size()-1)
{
continue;
}
string t;
for (ll k = i; k <= j; k++)
{
t.push_back(s[k]);
}
string u=t;
reverse(u.begin(),u.end());
if (t==u)
{
ans=max(ans,(ll)t.size());
}
}
}
cout << ans << endl;
}
hiro71687k