링크 : https://www.acmicpc.net/problem/11478
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string s;
cin >> s;
set<string> str_set;
string str;
for (int i = 0; i < s.size(); i++){
str = "";
for (int j = i; j < s.size(); j++){
str += s[j];
str_set.insert(str);
}
}
cout << str_set.size();
return 0;
}