From cde53ab6d0e46438bd38719b31eea4fd316d5889 Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Sun, 18 Jan 2026 16:29:04 +0900 Subject: [PATCH 1/5] =?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 --- .../whqtker.cpp" | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 "weekly/week02/BOJ_15486_\355\207\264\354\202\2542/whqtker.cpp" diff --git "a/weekly/week02/BOJ_15486_\355\207\264\354\202\2542/whqtker.cpp" "b/weekly/week02/BOJ_15486_\355\207\264\354\202\2542/whqtker.cpp" new file mode 100644 index 0000000..a645da3 --- /dev/null +++ "b/weekly/week02/BOJ_15486_\355\207\264\354\202\2542/whqtker.cpp" @@ -0,0 +1,27 @@ +#include +#include + +using namespace std; + +int dp[1500051]; +pair consult[1500001]; // consult[i] = { x, y } : i일의 상담은 x일이 걸리며 수익은 y + +int main() { + int n; + cin >> n; + for (int i = 1; i <= n; i++) { + int x, y; + cin >> x >> y; + consult[i] = { x, y }; + } + + for (int i = 1; i <= n; i++) { + dp[i + 1] = max(dp[i + 1], dp[i]); + + if (i + consult[i].first <= n + 1) { + dp[i + consult[i].first] = max(dp[i + consult[i].first], dp[i] + consult[i].second); + } + } + + cout << dp[n + 1] << "\n"; +} \ No newline at end of file From 6c7e7cbcb6217296dfe5005d9f569aecec19ef72 Mon Sep 17 00:00:00 2001 From: seonghyeok Date: Sat, 24 Jan 2026 14:42:07 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[Week03]=20BOJ:=20=ED=9C=B4=EA=B2=8C?= =?UTF-8?q?=EC=86=8C=20=EC=84=B8=EC=9A=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../whqtker.cpp" | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 "weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" diff --git "a/weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" "b/weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" new file mode 100644 index 0000000..9c7c299 --- /dev/null +++ "b/weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" @@ -0,0 +1,57 @@ +#include +#include +#include + +using namespace std; + +vector v; + +// 휴게소 간 최대 거리를 x로 했을 때, 설치 가능한 휴게소의 수를 리턴 +int chk(int x) { + int cnt = 0; + for (int i = 0; i < v.size() - 1; i++) { + int gap = v[i + 1] - v[i]; + + if (gap % x == 0) { + cnt += gap / x - 1; + } + else { + cnt += gap / x; + } + } + + return cnt; +} + +int main() { + int n, m, l; + cin >> n >> m >> l; + + for (int i = 0; i < n; i++) { + int x; + cin >> x; + v.push_back(x); + } + v.push_back(0); + v.push_back(l); + + sort(v.begin(), v.end()); + + int left = 1; + int right = l; + int mid; + while (left <= right) { + mid = (left + right) / 2; // mid: 휴게소 간 최대 거리 + + int cnt = chk(mid); + + if (cnt <= m) { + right = mid - 1; + } + else { + left = mid + 1; + } + } + + cout << left; +} \ No newline at end of file From 267c14e10d343bfa976bfc9914c8fe59836295b8 Mon Sep 17 00:00:00 2001 From: seonghyeok cho <65901319+whqtker@users.noreply.github.com> Date: Thu, 29 Jan 2026 04:08:25 +0000 Subject: [PATCH 3/5] =?UTF-8?q?[Week04]=20BOJ=201946:=20=EC=8B=A0=EC=9E=85?= =?UTF-8?q?=20=EC=82=AC=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../whqtker.cpp" | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 "weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" diff --git "a/weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" "b/weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" new file mode 100644 index 0000000..eab0f64 --- /dev/null +++ "b/weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" @@ -0,0 +1,48 @@ +#include +#include +#include + +using namespace std; + +int main() { + int T; + cin >> T; + while (T--) { + int n; + cin >> n; + + vector> v; + for (int i = 0; i < n; i++) { + int a, b; + cin >> a >> b; + v.push_back({ a,b }); + } + + sort(v.begin(), v.end()); + + int cnt = 0; // 탈락한 애들 수 + + // 비교 원소 조건 + // 이전보다 first가 클 것 (항상 만족) + // 이전보다 second가 작을 것 + int cmpA = v[0].first; + int cmpB = v[0].second; + for (int i = 1; i < v.size(); i++) { + int curA = v[i].first; + int curB = v[i].second; + + if (curA > cmpA && curB > cmpB) { + cnt++; + } + // 비교 원소 업데이트 + else { + if (curB < cmpB) { + cmpA = curA; + cmpB = curB; + } + } + } + + cout << n - cnt << "\n"; + } +} \ No newline at end of file From e4af828d664a283882abe2a3ccb833c36f739a4a Mon Sep 17 00:00:00 2001 From: seonghyeok cho <65901319+whqtker@users.noreply.github.com> Date: Thu, 29 Jan 2026 06:28:27 +0000 Subject: [PATCH 4/5] =?UTF-8?q?[Week04]=20BOJ=2014925:=20=EB=AA=A9?= =?UTF-8?q?=EC=9E=A5=20=EA=B1=B4=EC=84=A4=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../whqtker.cpp" | 0 .../whqtker.cpp" | 26 +++++++++++++++++++ .../whqtker.cpp" | 0 3 files changed, 26 insertions(+) rename "weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" => "weekly/week03/BOJ_1477_\355\234\264\352\262\214\354\206\214\354\204\270\354\232\260\352\270\260/whqtker.cpp" (100%) create mode 100644 "weekly/week04/BOJ_14925_\353\252\251\354\236\245\352\261\264\354\204\244\355\225\230\352\270\260/whqtker.cpp" rename "weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" => "weekly/week04/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" (100%) diff --git "a/weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" "b/weekly/week03/BOJ_1477_\355\234\264\352\262\214\354\206\214\354\204\270\354\232\260\352\270\260/whqtker.cpp" similarity index 100% rename from "weekly/week3/BOJ_1477_\355\234\264\352\262\214\354\206\214 \354\204\270\354\232\260\352\270\260/whqtker.cpp" rename to "weekly/week03/BOJ_1477_\355\234\264\352\262\214\354\206\214\354\204\270\354\232\260\352\270\260/whqtker.cpp" diff --git "a/weekly/week04/BOJ_14925_\353\252\251\354\236\245\352\261\264\354\204\244\355\225\230\352\270\260/whqtker.cpp" "b/weekly/week04/BOJ_14925_\353\252\251\354\236\245\352\261\264\354\204\244\355\225\230\352\270\260/whqtker.cpp" new file mode 100644 index 0000000..0f23da8 --- /dev/null +++ "b/weekly/week04/BOJ_14925_\353\252\251\354\236\245\352\261\264\354\204\244\355\225\230\352\270\260/whqtker.cpp" @@ -0,0 +1,26 @@ +#include +#include + +using namespace std; + +int dp[1001][1001]; + +int main() { + int n, m; + cin >> n >> m; + + int ans = 0; + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= m; j++) { + int x; + cin >> x; + + if (x == 0) { + dp[i][j] = min({ dp[i - 1][j - 1],dp[i - 1][j],dp[i][j - 1] }) + 1; + ans = max(ans, dp[i][j]); + } + } + } + + cout << ans; +} \ No newline at end of file diff --git "a/weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" "b/weekly/week04/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" similarity index 100% rename from "weekly/week4/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" rename to "weekly/week04/BOJ_1946_\354\213\240\354\236\205\354\202\254\354\233\220/whqtker.cpp" From ed93e66d2922d59ec374a47124c93b93a247a21a Mon Sep 17 00:00:00 2001 From: seonghyeok cho <65901319+whqtker@users.noreply.github.com> Date: Fri, 30 Jan 2026 08:28:54 +0000 Subject: [PATCH 5/5] =?UTF-8?q?[Week04]=20BOJ=204386:=20=EB=B3=84=EC=9E=90?= =?UTF-8?q?=EB=A6=AC=20=EB=A7=8C=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../whqtker.cpp" | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 "weekly/week04/BOJ_4386_\353\263\204\354\236\220\353\246\254\353\247\214\353\223\244\352\270\260/whqtker.cpp" diff --git "a/weekly/week04/BOJ_4386_\353\263\204\354\236\220\353\246\254\353\247\214\353\223\244\352\270\260/whqtker.cpp" "b/weekly/week04/BOJ_4386_\353\263\204\354\236\220\353\246\254\353\247\214\353\223\244\352\270\260/whqtker.cpp" new file mode 100644 index 0000000..5a88134 --- /dev/null +++ "b/weekly/week04/BOJ_4386_\353\263\204\354\236\220\353\246\254\353\247\214\353\223\244\352\270\260/whqtker.cpp" @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +using namespace std; + +vector> stars; +vector> graph[101]; +int mst[101]; + +double calc(int a, int b) { + return sqrt(pow(stars[a].first - stars[b].first, 2) + pow(stars[a].second - stars[b].second, 2)); +} + +int main() { + int n; + cin >> n; + + for (int i = 0; i < n; i++) { + double x, y; + cin >> x >> y; + stars.push_back({ x,y }); + } + + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + graph[i].push_back({ j,calc(i,j) }); + } + } + + priority_queue , vector>, greater>> pq; + for (int i = 0; i < graph[0].size(); i++) { + pq.push({ graph[0][i].second,graph[0][i].first }); + } + + mst[0] = 1; + int cnt = 0; + double cumw = 0; + while (cnt < n - 1) { + double w = pq.top().first; + int node = pq.top().second; + pq.pop(); + + if (mst[node]) continue; + + mst[node] = 1; + cnt++; + cumw += w; + + for (int i = 0; i < graph[node].size(); i++) { + int nnode = graph[node][i].first; + double nw = graph[node][i].second; + + if (!mst[nnode]) { + pq.push({ nw,nnode }); + } + } + } + + cout << fixed; + cout << setprecision(2); + cout << cumw; +} \ No newline at end of file