From 59df6e5b47bcb01302a75fb560ce3922d2a7248d Mon Sep 17 00:00:00 2001 From: sh0723 Date: Fri, 3 Jul 2026 11:53:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?14405=20:=20=ED=94=BC=EC=B9=B4=EC=B8=84=20s?= =?UTF-8?q?olve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/week4/BOJ14405/BOJ14405_V1.cpp | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/week4/BOJ14405/BOJ14405_V1.cpp diff --git a/src/week4/BOJ14405/BOJ14405_V1.cpp b/src/week4/BOJ14405/BOJ14405_V1.cpp new file mode 100644 index 0000000..58a3e4c --- /dev/null +++ b/src/week4/BOJ14405/BOJ14405_V1.cpp @@ -0,0 +1,32 @@ +#include +using namespace std; +string s; +int main() { + + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + cin >> s; + bool ret_flag = true; + if (s.length() == 1) + ret_flag = false; + for (int i=0; i Date: Fri, 3 Jul 2026 11:56:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?14405=20:=20=ED=94=BC=EC=B9=B4=EC=B8=84=20V?= =?UTF-8?q?2=20solve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/week4/BOJ14405/BOJ14405_V2.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/week4/BOJ14405/BOJ14405_V2.cpp diff --git a/src/week4/BOJ14405/BOJ14405_V2.cpp b/src/week4/BOJ14405/BOJ14405_V2.cpp new file mode 100644 index 0000000..444c810 --- /dev/null +++ b/src/week4/BOJ14405/BOJ14405_V2.cpp @@ -0,0 +1,26 @@ +#include +using namespace std; + +int main() { + + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + string s; + cin >> s; + + bool ret_flag = true; + for (int i = 0; i < s.length(); i++) { + if (i < s.length()-1 && (s.substr(i,2) == "pi" || s.substr(i,2) == "ka")) i++; + else if (i < s.length()-2 && s.substr(i,3) == "chu") i+=2; + else ret_flag = false; + } + + if (ret_flag) cout << "YES\n"; + else cout << "NO\n"; + + + + return 0; +} \ No newline at end of file