fork download
  1. /*
  2.   " وَكَانَ فَضْلُ اللَّهِ عَلَيْكَ عَظِيمًا "
  3.  
  4. ╔░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╗
  5. ║ ║
  6. ║ ██╗ ██╗ ██╗ ██╗ █████╗ ██╗ ███████╗ ██████╗ ██████╗ █████╗ ██████╗ ███████╗ ███████╗ ███████╗ ██████╗ ║
  7. ║ ██║ ██╔╝ ██║ ██║ ██╔══██╗ ██║ ██╔════╝ ██╔══██╗ ██╔════╝ ██╔══██╗ ╚════██ ██╔════╝ ██╔════╝ ██╔════╝ ██╔══██╗ ║
  8. ║ █████╔╝ ███████║ ███████║ ██║ █████╗ ██║ ██║ ╚█████╗ ███████║ ██████╝ █████╗ █████╗ █████╗ ██║ ██║ ║
  9. ║ ██╔═██╗ ██╔══██║ ██╔══██║ ██║ ██╔══╝ ██║ ██║ ╚═══██╗ ██╔══██║ ╚════██╗ ██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ║
  10. ║ ██║ ██╗ ██║ ██║ ██║ ██║ ███████╗ ███████╗ ██████╔╝ ██████╔╝ ██║ ██║ ██████╔╝ ███████╗ ███████╗ ███████╗ ██████╔╝ ║
  11. ║ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ ╚═════╝ ███████╗ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚══════╝ ╚══════╝ ╚═════╝ ║
  12. ║ ╚══════╝ ║
  13. ╚░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ The king gets sick but doesn't retire, Wait! ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╝
  14. */
  15. #include <bits/stdc++.h>
  16. using namespace std;
  17. #define endl '\n'
  18. #define ll long long
  19. #define int long long
  20. #define all(v) v.begin(), v.end()
  21. #define MAX(v) *max_element(all(v))
  22. #define MIN(v) *min_element(all(v))
  23. #define rall(v) v.rbegin(), v.rend()
  24. #define K3D ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  25. vector<string> v;
  26. string s;
  27.  
  28. void rec(int i, string d)
  29. {
  30. if (i == s.size()) { v.push_back(d); return; }
  31. rec(i + 1, d);
  32. rec(i + 1, d + s[i]);
  33. }
  34.  
  35. void solve()
  36. {
  37. cin >> s;
  38. rec(0, "");
  39. sort(all(v));
  40. for (auto& it : v)
  41. {
  42. if (it == "") { continue; }
  43. cout << it << endl;
  44. }
  45. }
  46.  
  47. int32_t main()
  48. {
  49. K3D;
  50. // ll TestCases;cin >> TestCases;while (TestCases--)
  51. {
  52. solve();
  53. cout << endl;
  54. }
  55. return (0 * 0);
  56. }
  57.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout