結果
問題 | No.588 空白と回文 |
ユーザー |
|
提出日時 | 2017-11-13 02:35:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 512 ms |
コンパイル使用メモリ | 65,304 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 23:25:49 |
合計ジャッジ時間 | 1,151 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; string s;int r; main() { cin>>s; for(int i=0;i<s.size();i++) { int now=0; for(int j=i<s.size()-i-1?i:s.size()-i-1;j>=0;j--)now+=(s[i-j]==s[i+j])*(2-!j); r=r<now?now:r; if(i<s.size()-1) { now=0; for(int j=0;i-j>=0&&i+j+1<s.size();j++)now+=(s[i-j]==s[i+j+1])*2; r=r<now?now:r; } } cout<<r<<endl; }