diff --git a/InSange/README.md b/InSange/README.md index a494ef3..b510896 100644 --- a/InSange/README.md +++ b/InSange/README.md @@ -7,6 +7,7 @@ | 3차시 | 2024.03.19 | 플로이드 워셜 | [앱](https://www.acmicpc.net/problem/7579) | [#3](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/9) | | 4차시 | 2024.03.25 | 다익스트라 | [파티](https://www.acmicpc.net/problem/1238) | [#4](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/15)| | 5차시 | 2024.03.27 | DP | [RGB거리2](https://www.acmicpc.net/problem/17404) | [#5](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/19)] -| 6차시 | 2024.04.01 | 최소신장트리 | [행성 터널](https://www.acmicpc.net/problem/2887) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/19)] +| 6차시 | 2024.04.01 | 최소신장트리 | [행성 터널](https://www.acmicpc.net/problem/2887) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/24)] +| 7차시 | 2024.04.04 | 스택 | [문자열 폭발](https://www.acmicpc.net/problem/9935) | [#7](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/19)] ======= --- diff --git "a/InSange/\354\212\244\355\203\235/9935.cpp" "b/InSange/\354\212\244\355\203\235/9935.cpp" new file mode 100644 index 0000000..1a8b973 --- /dev/null +++ "b/InSange/\354\212\244\355\203\235/9935.cpp" @@ -0,0 +1,54 @@ +#include + +using namespace std; + +string s, boom; +int blen; + +void Solve() +{ + cin >> s >> boom; + + blen = boom.length(); + + string st = ""; + for (char c : s) + { + st.push_back(c); + + if (c == boom[blen-1] && st.size() >= blen) + { + bool flag = true; + + for (int i = 0; i < blen; i++) + { + if (boom[i] != st[st.length() - blen + i]) + { + flag = false; + break; + } + } + + if (flag) + { + for (int i = 0; i < blen; i++) + { + st.pop_back(); + } + } + } + } + + if (st == "") cout << "FRULA"; + else cout << st; +} + +int main() +{ + cin.tie(nullptr); + ios::sync_with_stdio(false); + + Solve(); + + return 0; +} \ No newline at end of file