結果
| 問題 |
No.588 空白と回文
|
| コンテスト | |
| ユーザー |
ugis_prog
|
| 提出日時 | 2018-06-10 00:10:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 679 bytes |
| コンパイル時間 | 634 ms |
| コンパイル使用メモリ | 65,000 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 13:05:55 |
| 合計ジャッジ時間 | 1,635 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 7 RE * 2 |
ソースコード
#include<iostream>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string s;
cin>>s;
int ans = -1;
for(int i=0;i<s.size();i++){
stack<char> st;
int count = 0;
string front = s.substr(i,s.size());
for(int j=s.size()-1;(front[j] != s[i] && front.size() < 1);j--){
front.pop_back();
}
string back = front;
reverse(front.begin(),front.end());
for(int j=0;j<front.size();j++){
if(front[j] == back[j]) count++;
}
ans = max(ans,count);
}
cout<<ans<<endl;
}
ugis_prog