From 737051932834e3a77babcb456e07fbfeef3837c6 Mon Sep 17 00:00:00 2001 From: Changmin Kim <41724458+KimRabbert@users.noreply.github.com> Date: Wed, 25 Jun 2025 00:01:55 +0900 Subject: [PATCH] Add files via upload --- week7/KCM/[W7]_11867.cpp | 15 +++++++++++++++ week7/KCM/[W7]_9935.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 week7/KCM/[W7]_11867.cpp create mode 100644 week7/KCM/[W7]_9935.cpp diff --git a/week7/KCM/[W7]_11867.cpp b/week7/KCM/[W7]_11867.cpp new file mode 100644 index 0000000..42a5360 --- /dev/null +++ b/week7/KCM/[W7]_11867.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; + +int main() { + int N, M; + + cin >> N >> M; + + if (N % 2 == 0 || M % 2 == 0) { + cout << 'A'; + } + else { + cout << 'B'; + } +} \ No newline at end of file diff --git a/week7/KCM/[W7]_9935.cpp b/week7/KCM/[W7]_9935.cpp new file mode 100644 index 0000000..4124fe9 --- /dev/null +++ b/week7/KCM/[W7]_9935.cpp @@ -0,0 +1,28 @@ +#include +#include +using namespace std; + +int main() { + const string emptyStr = "FRULA"; + string s, explodeStr; + string result; + int explodeSize; + + cin >> s; + cin >> explodeStr; + + explodeSize = explodeStr.size(); + + for (auto chr : s) { + result += chr; + + if (result.size() >= explodeSize && result.substr(result.size() - explodeSize, explodeSize) == explodeStr) { + result.erase(result.size() - explodeSize, explodeSize); + } + } + + if (result == "") + result = emptyStr; + + cout << result; +} \ No newline at end of file