Skip to content

Commit

Permalink
Merge pull request #28 from AlgoLeadMe/7-InSange
Browse files Browse the repository at this point in the history
7-InSange
  • Loading branch information
InSange authored May 1, 2024
2 parents 892dce2 + 51c4629 commit 4cde274
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
3 changes: 2 additions & 1 deletion InSange/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/28)]
=======
---
54 changes: 54 additions & 0 deletions InSange/μŠ€νƒ/9935.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <iostream>

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;
}

0 comments on commit 4cde274

Please sign in to comment.