結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
Naco
|
| 提出日時 | 2019-10-16 00:13:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 2,082 ms |
| コンパイル使用メモリ | 177,380 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-31 07:34:58 |
| 合計ジャッジ時間 | 2,479 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int ans=0;
string s;
map<string,int> ma;
void solve(string s,string t){
int N=s.size();
if(N==0){
ma[t]++;
return;
}
string i=t+s[0];
string j=t+s[N-1];
//cout << i << " " << j << " " << k << " " << l << endl;
solve(s.substr(1,N-1),i);
solve(s.substr(0,N-1),j);
}
int main(){
cin >> s;
solve(s,"");
cout << ma.size() << endl;
}
Naco