From 6ad786719e1914d18784edea8856df6abe506ddd Mon Sep 17 00:00:00 2001 From: caucsejunseo Date: Mon, 5 May 2025 17:48:53 +0900 Subject: [PATCH 1/6] Update README.md --- caucsejunseo/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/caucsejunseo/README.md b/caucsejunseo/README.md index 2267737..9a2a434 100644 --- a/caucsejunseo/README.md +++ b/caucsejunseo/README.md @@ -9,4 +9,10 @@ | 5차시 | 2025.04.02 | 큐 | [요세푸스문제](https://www.acmicpc.net/problem/1158)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/19| | 6차시 | 2025.04.06 | 큐 | [앵무새](https://www.acmicpc.net/problem/14713)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/23| | 7차시 | 2025.04.10 | 그리디 | [폴리오미노](https://www.acmicpc.net/problem/1343)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/28| +<<<<<<< Updated upstream | 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| +======= +| 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| +| 9차시 | 2025.04.30 | 문자열 | [듣보잡](https://www.acmicpc.net/problem/1764)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/35| +|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| +>>>>>>> Stashed changes From c14c0ab01cbb2f96e9c1f233f2d3af9453bd1113 Mon Sep 17 00:00:00 2001 From: caucsejunseo Date: Mon, 5 May 2025 17:48:55 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Create=202025.05.05.1=EB=A1=9C=EB=A7=8C?= =?UTF-8?q?=EB=93=A4=EA=B8=B0.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...234\353\247\214\353\223\244\352\270\260.c" | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 "caucsejunseo/\353\213\244\354\235\264\353\202\230\353\257\271(dp)/2025.05.05.1\353\241\234\353\247\214\353\223\244\352\270\260.c" diff --git "a/caucsejunseo/\353\213\244\354\235\264\353\202\230\353\257\271(dp)/2025.05.05.1\353\241\234\353\247\214\353\223\244\352\270\260.c" "b/caucsejunseo/\353\213\244\354\235\264\353\202\230\353\257\271(dp)/2025.05.05.1\353\241\234\353\247\214\353\223\244\352\270\260.c" new file mode 100644 index 0000000..1efa687 --- /dev/null +++ "b/caucsejunseo/\353\213\244\354\235\264\353\202\230\353\257\271(dp)/2025.05.05.1\353\241\234\353\247\214\353\223\244\352\270\260.c" @@ -0,0 +1,39 @@ +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define MAX 1000001 + + +int main() { + + int N = 0; + scanf("%d", &N); + + int* dp = (int*)malloc(sizeof(int) * MAX); + + if (dp == NULL) { + printf("메모리 할당 실패!\n"); + return 1; + } + + dp[1] = 0; + + for (int i = 2; i < N + 1; i++) + { + dp[i] = dp[i - 1] + 1; + + if (i % 3 == 0) + { + dp[i] = MIN(dp[i], dp[i / 3] + 1); + } + if (i % 2 == 0) + { + dp[i] = MIN(dp[i], dp[i / 2] + 1); + } + } + + printf("%d", dp[N]); + + return 0; +} From 299e9ecc0d9304f1a65c4b6e7cafa083659ac2a0 Mon Sep 17 00:00:00 2001 From: caucsejunseo Date: Mon, 5 May 2025 17:49:52 +0900 Subject: [PATCH 3/6] Update README.md --- caucsejunseo/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/caucsejunseo/README.md b/caucsejunseo/README.md index 9a2a434..c4bb727 100644 --- a/caucsejunseo/README.md +++ b/caucsejunseo/README.md @@ -14,5 +14,9 @@ ======= | 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| | 9차시 | 2025.04.30 | 문자열 | [듣보잡](https://www.acmicpc.net/problem/1764)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/35| +<<<<<<< Updated upstream +|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| +>>>>>>> Stashed changes +======= |10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| >>>>>>> Stashed changes From eb45120013ecbf8551399988340758c3484c27e6 Mon Sep 17 00:00:00 2001 From: caucsejunseo Date: Mon, 5 May 2025 17:52:41 +0900 Subject: [PATCH 4/6] Update README.md --- caucsejunseo/README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/caucsejunseo/README.md b/caucsejunseo/README.md index c4bb727..c73d07b 100644 --- a/caucsejunseo/README.md +++ b/caucsejunseo/README.md @@ -9,14 +9,7 @@ | 5차시 | 2025.04.02 | 큐 | [요세푸스문제](https://www.acmicpc.net/problem/1158)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/19| | 6차시 | 2025.04.06 | 큐 | [앵무새](https://www.acmicpc.net/problem/14713)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/23| | 7차시 | 2025.04.10 | 그리디 | [폴리오미노](https://www.acmicpc.net/problem/1343)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/28| -<<<<<<< Updated upstream - | 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| -======= | 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| | 9차시 | 2025.04.30 | 문자열 | [듣보잡](https://www.acmicpc.net/problem/1764)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/35| -<<<<<<< Updated upstream |10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| ->>>>>>> Stashed changes -======= -|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| ->>>>>>> Stashed changes + From ffa18abe4e1efeebabdcbebe7e6d22741e85aec7 Mon Sep 17 00:00:00 2001 From: caucsejunseo Date: Mon, 5 May 2025 17:54:46 +0900 Subject: [PATCH 5/6] Update README.md --- caucsejunseo/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/caucsejunseo/README.md b/caucsejunseo/README.md index c73d07b..8822b11 100644 --- a/caucsejunseo/README.md +++ b/caucsejunseo/README.md @@ -11,5 +11,4 @@ | 7차시 | 2025.04.10 | 그리디 | [폴리오미노](https://www.acmicpc.net/problem/1343)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/28| | 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| | 9차시 | 2025.04.30 | 문자열 | [듣보잡](https://www.acmicpc.net/problem/1764)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/35| -|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| - +|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| \ No newline at end of file From f77f345d8280dacc8b0b9217c234d2be2cb1b358 Mon Sep 17 00:00:00 2001 From: caucsejunseo Date: Wed, 7 May 2025 22:41:12 +0900 Subject: [PATCH 6/6] Update README.md --- caucsejunseo/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caucsejunseo/README.md b/caucsejunseo/README.md index 8822b11..b874276 100644 --- a/caucsejunseo/README.md +++ b/caucsejunseo/README.md @@ -11,4 +11,4 @@ | 7차시 | 2025.04.10 | 그리디 | [폴리오미노](https://www.acmicpc.net/problem/1343)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/28| | 8차시 | 2025.04.11 | 연결리스트| [키로거](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30| | 9차시 | 2025.04.30 | 문자열 | [듣보잡](https://www.acmicpc.net/problem/1764)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/35| -|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|| \ No newline at end of file +|10차시| 2025.05.05 | 다이나믹 | [1로만들기](https://www.acmicpc.net/problem/1463)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/38| \ No newline at end of file