From a06f54f309acbe2bfe56615c09149bdd4d903c9f Mon Sep 17 00:00:00 2001 From: Gyuhyeok99 Date: Wed, 21 Jan 2026 11:08:33 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[Week02]=20BOJ:=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 --- .../gyuhyeok99.cpp" | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 "weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/gyuhyeok99.cpp" diff --git "a/weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/gyuhyeok99.cpp" "b/weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/gyuhyeok99.cpp" new file mode 100644 index 0000000..1b09deb --- /dev/null +++ "b/weekly/week02/BOJ_1965_\354\203\201\354\236\220\353\204\243\352\270\260/gyuhyeok99.cpp" @@ -0,0 +1,26 @@ +#include +#include + +using namespace std; + +int n, len, num; +int lis[1001]; +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + cin >> n; + + for (int i = 0; i < n; i++) { + cin >> num; + auto lowerPos = lower_bound(lis, lis + len, num); + if (*lowerPos == 0) { + len++; + } + *lowerPos = num; + } + + cout << len << '\n'; + return 0; +} From 2eb4d1609ff98540298c32ef9165b4f0d392c38a Mon Sep 17 00:00:00 2001 From: Gyuhyeok99 Date: Wed, 21 Jan 2026 11:09:24 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[Week02]=20BOJ:=20=ED=87=B4=EC=82=AC2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gyuhyeok99.cpp" | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 "weekly/week02/BOJ_15486_\355\207\264\354\202\2542/gyuhyeok99.cpp" diff --git "a/weekly/week02/BOJ_15486_\355\207\264\354\202\2542/gyuhyeok99.cpp" "b/weekly/week02/BOJ_15486_\355\207\264\354\202\2542/gyuhyeok99.cpp" new file mode 100644 index 0000000..ba05fbf --- /dev/null +++ "b/weekly/week02/BOJ_15486_\355\207\264\354\202\2542/gyuhyeok99.cpp" @@ -0,0 +1,31 @@ +#include +#include + +using namespace std; + +int n, ret; +int arr[1500001][2]; +int dp[1500001]; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + cout.tie(NULL); + + cin >> n; + + for (int i = 0; i < n; i++) { + cin >> arr[i][0] >> arr[i][1]; + } + + for (int i = n - 1; i >= 0; i--) { + if (i + arr[i][0] <= n) { + dp[i] = max(dp[i + 1], arr[i][1] + dp[i + arr[i][0]]); + } else { + dp[i] = dp[i + 1]; + } + } + + cout << dp[0] << '\n'; + return 0; +} From ef3ba43a5211a9490088d028bec4c0318781047e Mon Sep 17 00:00:00 2001 From: Gyuhyeok99 Date: Wed, 21 Jan 2026 11:10:36 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[Week02]=20PGS:=20=EC=A4=84=EC=84=9C?= =?UTF-8?q?=EB=8A=94=EB=B0=A9=EB=B2=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gyuhyeok99.cpp" | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "weekly/week02/PGS_\354\244\204\354\204\234\353\212\224\353\260\251\353\262\225/gyuhyeok99.cpp" diff --git "a/weekly/week02/PGS_\354\244\204\354\204\234\353\212\224\353\260\251\353\262\225/gyuhyeok99.cpp" "b/weekly/week02/PGS_\354\244\204\354\204\234\353\212\224\353\260\251\353\262\225/gyuhyeok99.cpp" new file mode 100644 index 0000000..afbab0c --- /dev/null +++ "b/weekly/week02/PGS_\354\244\204\354\204\234\353\212\224\353\260\251\353\262\225/gyuhyeok99.cpp" @@ -0,0 +1,30 @@ +#include +#include +using namespace std; + +vector answer; +vector numbers; +vector dp; + +vector solution(int n, long long k) { + dp.resize(n); + dp[0] = 1; + for (int i = 1; i < n; i++) { + dp[i] = dp[i-1] * i; + } + + for (int i = 1; i <= n; i++) { + numbers.push_back(i); + } + + k--; + + for (int i = 0; i < n; i++) { + long long idx = k / dp[n-1-i]; + answer.push_back(numbers[idx]); + numbers.erase(numbers.begin() + idx); + k %= dp[n-1-i]; + } + + return answer; +}