結果
問題 |
No.52 よくある文字列の問題
|
ユーザー |
![]() |
提出日時 | 2025-05-21 06:46:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 386 bytes |
コンパイル時間 | 1,827 ms |
コンパイル使用メモリ | 200,544 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-05-21 06:46:42 |
合計ジャッジ時間 | 2,721 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string t = ""; set<string> st; auto dfs = [&](auto self, int l, int r) -> void { if (l == r) { st.insert(t); return; } t += s[l]; self(self, l+1, r); t.pop_back(); t += s[r-1]; self(self, l, r-1); t.pop_back(); }; dfs(dfs, 0, (int)s.size()); cout << (int)st.size() << endl; }