From 578e2b9471f37119c49963998b7568a86904e918 Mon Sep 17 00:00:00 2001 From: Hexeong <123macanic@naver.com> Date: Mon, 19 Jan 2026 22:57:59 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Week2]=20BOJ=201965:=20=EC=83=81=EC=9E=90?= =?UTF-8?q?=EB=84=A3=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Hexeong.cpp" | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/Hexeong.cpp" diff --git "a/weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/Hexeong.cpp" "b/weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/Hexeong.cpp" new file mode 100644 index 0000000..d3d0450 --- /dev/null +++ "b/weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/Hexeong.cpp" @@ -0,0 +1,35 @@ +// +// Created by hex on 26. 1. 19.. +// + +#include +#include + +using namespace std; + +int main() { + ios::sync_with_stdio(false); + cin.tie(nullptr); + cout.tie(nullptr); + + int n; cin >> n; + vector arr(n); + vector dp(n, 1); + + for (int i = 0; i < n; i++) + cin >> arr[i]; + + int max_v = 1; + for (int i = 0; i < n; i++) { + for (int j = 0; j < i; j++) { + if (arr[j] < arr[i]) { + dp[i] = max(dp[i], dp[j] + 1); + } + } + max_v = max(max_v, dp[i]); + } + + cout << max_v << endl; + + return 0; +} \ No newline at end of file From cd6f45809970c0452b41f2052510fcb9d14494c4 Mon Sep 17 00:00:00 2001 From: Hexeong <123macanic@naver.com> Date: Sat, 14 Mar 2026 18:19:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Week10]=20BOJ=2012919:=20A=EC=99=80=20B=20?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 13 +++++++ .../BOJ_12919_A\354\231\200B2/Hexeong.java" | 38 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 "weekly/week10/BOJ_12919_A\354\231\200B2/Hexeong.java" diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a0193bd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.10) + +# 1. 프로젝트 이름 설정 (원하는 이름으로 변경 가능) +project(MyProject) + +# 2. C++ 표준 설정 (C++11, 14, 17, 20 중 선택) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# 3. 실행 파일 생성 +# add_executable(실행파일명 소스파일.cpp) +# 예: main.cpp를 컴파일하여 my_program이라는 실행 파일을 만듦 +add_executable(my_program /weekly/week02/BOJ_1965_상자넣기/Hexeong.cpp) \ No newline at end of file diff --git "a/weekly/week10/BOJ_12919_A\354\231\200B2/Hexeong.java" "b/weekly/week10/BOJ_12919_A\354\231\200B2/Hexeong.java" new file mode 100644 index 0000000..2d2084d --- /dev/null +++ "b/weekly/week10/BOJ_12919_A\354\231\200B2/Hexeong.java" @@ -0,0 +1,38 @@ +import java.io.BufferedReader; +import java.io.InputStreamReader; + +public class Main { + // AI의 피드백 : SB를 1개로 유지하고 process가 끝난 이후 원상태로 복구하는 방식으로 최적화하자. + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + String S = br.readLine(); + String T = br.readLine(); + + StringBuilder sb = new StringBuilder(T); + + System.out.println(process(sb, S) ? 1 : 0); + } + + private static boolean process(StringBuilder sb, String S) { + if (sb.toString().equals(S)) { + return true; + } + if (sb.length() <= S.length()) { + return false; + } + + if (sb.charAt(sb.length() - 1) == 'A' && process(removeAtoSb(sb), S)) { + return true; + } + return sb.charAt(0) == 'B' && process(reverseAndDeleteBtoSb(sb), S); + }; + + private static StringBuilder removeAtoSb(StringBuilder sb) { + return new StringBuilder(sb).deleteCharAt((sb.length() - 1)); + } + + private static StringBuilder reverseAndDeleteBtoSb(StringBuilder sb) { + return new StringBuilder(sb).reverse().deleteCharAt((sb.length() - 1)); + } +}