結果

問題 No.52 よくある文字列の問題
ユーザー ikd
提出日時 2016-10-07 17:43:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 322 bytes
コンパイル時間 655 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 05:27:43
合計ジャッジ時間 1,185 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<set>
using namespace std;

set<string> st;

void rec(string s, string t){
	
	if(s.size()==0){
		st.insert(t);
	}else{
		rec(s.substr(1), t+s[0]);
		rec(s.substr(0, s.size()-1), t+s.back());
	}
	
	
}

int main() {
	
	string S;
	cin>> S;
	
	rec(S, "");
	
	cout<< st.size()<< endl;
	
	return 0;
}
0