結果
| 問題 |
No.599 回文かい
|
| コンテスト | |
| ユーザー |
_____Yuto___
|
| 提出日時 | 2017-11-25 00:35:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 374 bytes |
| コンパイル時間 | 397 ms |
| コンパイル使用メモリ | 56,180 KB |
| 実行使用メモリ | 33,792 KB |
| 最終ジャッジ日時 | 2024-11-27 08:54:51 |
| 合計ジャッジ時間 | 61,187 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 TLE * 12 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
#define MOD (int)(1e9 + 7)
int solve(string s)
{
int ret = 1, n = s.length();
for(int i = 1; i <= n / 2; i++){
if(s.substr(0, i) == s.substr(n - i, i)){
ret += solve(s.substr(i, n - 2 * i));
}
}
return ret;
}
int main()
{
string s;
cin >> s;
cout << solve(s) << endl;
return 0;
}
_____Yuto___