{
    "componentChunkName": "component---src-templates-blog-template-js",
    "path": "/2022-winter/",
    "result": {"data":{"cur":{"id":"d520b9d4-cfe8-5ce6-bc1f-e18b543a68b0","html":"<p>방학때마다 포스팅하는 계획글이다. 제대로 지켜지는 건 별로 없지만 그래도 아예 생각 안하는 것보다는 훨씬 나아서 꾸준히 포스팅 해볼 생각이다.</p>\n<h3 id=\"1-캡스톤-졸업프로젝트\" style=\"position:relative;\"><a href=\"#1-%EC%BA%A1%EC%8A%A4%ED%86%A4-%EC%A1%B8%EC%97%85%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8\" aria-label=\"1 캡스톤 졸업프로젝트 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. 캡스톤 (졸업프로젝트)</h3>\n<p>여름방학 때 ROS를 공부하고, 학기 중에는 드론 부품들을 구매해 직접 조립, 제대로 동작까지는 확인했다. 하지만 GPS 없이 어떻게 위치를 가져올 것인지와 크기 등의 제약사항이 많아 다른 완제품 드론을 통하여 프로젝트를 진행하게 될것 같아 할일이 많아졌다. 거의 사용한 적 없는 파이썬을 사용하여 마커를 따라 비행하고 작물의 사진을 찍어 전송하는 등의 기능들을 구현할것이다.</p>\n<h3 id=\"2-동아리-프로젝트-i-taxi\" style=\"position:relative;\"><a href=\"#2-%EB%8F%99%EC%95%84%EB%A6%AC-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-i-taxi\" aria-label=\"2 동아리 프로젝트 i taxi permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. 동아리 프로젝트 I-Taxi</h3>\n<p>내가 새내기때까지만 해도 학교 학생들이 많이 사용하던 택시를 같이 타거나 카풀을 구하는 앱인 아이택시가 리뉴얼이 됐고, 이후 추가 개발과 유지보수를 위한 프로젝트에 백엔드 개발로 참여하게 됐다. 캡스톤과 병행하게 되어 조금 힘들겠지만, 내가 공부하고 싶었던 백엔드를 맡게 되어 재밌게 할 수 있을 것 같다.</p>\n<h3 id=\"3-알고리즘--코딩테스트\" style=\"position:relative;\"><a href=\"#3-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98--%EC%BD%94%EB%94%A9%ED%85%8C%EC%8A%A4%ED%8A%B8\" aria-label=\"3 알고리즘  코딩테스트 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. 알고리즘 / 코딩테스트</h3>\n<p>이제는 당장 반년후부터 코딩테스트를 보고다녀야한다. 이번 방학동안 백준 골드를 찍고 코딩테스트 대비 문제들을 많이 풀어볼 예정이다.</p>\n<h3 id=\"4-개인프로젝트\" style=\"position:relative;\"><a href=\"#4-%EA%B0%9C%EC%9D%B8%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8\" aria-label=\"4 개인프로젝트 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. 개인프로젝트</h3>\n<p>저번 여름에 제대로 만들지 못했던 개인프로젝트를 2학기 때 모바일 앱 개발이라는 강의를 통해서 프로토타입을 만들었다.\n물론 이번 방학에 할것이 많기 때문에 우선순위가 떨어져 시간을 많이 쓰지 못할 가능성이 높지만 최대한 해보려는데, 4학년이 상당히\n여유롭기 때문에 오히려 학기 중에 하는게 좋을 수도 있겠다.</p>\n<h3 id=\"5-정보처리기사\" style=\"position:relative;\"><a href=\"#5-%EC%A0%95%EB%B3%B4%EC%B2%98%EB%A6%AC%EA%B8%B0%EC%82%AC\" aria-label=\"5 정보처리기사 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>5. 정보처리기사?</h3>\n<p>공기업을 가려면 필수겠지만 사기업에는 필요하지 않다는 이야기가 많아서 아직 응시할지말지 결정하지 못했다. 전공역량시험에 응시해야하는 강의를 듣는다면 한번쯤 응시할지도?</p>\n<div class=\"table-of-contents\">\n<ul>\n<li><a href=\"#1-%EC%BA%A1%EC%8A%A4%ED%86%A4-%EC%A1%B8%EC%97%85%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8\">1. 캡스톤 (졸업프로젝트)</a></li>\n<li><a href=\"#2-%EB%8F%99%EC%95%84%EB%A6%AC-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-i-taxi\">2. 동아리 프로젝트 I-Taxi</a></li>\n<li><a href=\"#3-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98--%EC%BD%94%EB%94%A9%ED%85%8C%EC%8A%A4%ED%8A%B8\">3. 알고리즘 / 코딩테스트</a></li>\n<li><a href=\"#4-%EA%B0%9C%EC%9D%B8%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8\">4. 개인프로젝트</a></li>\n<li><a href=\"#5-%EC%A0%95%EB%B3%B4%EC%B2%98%EB%A6%AC%EA%B8%B0%EC%82%AC\">5. 정보처리기사?</a></li>\n</ul>\n</div>","excerpt":"방학때마다 포스팅하는 계획글이다. 제대로 지켜지는 건 별로 없지만 그래도 아예 생각 안하는 것보다는 훨씬 나아서 꾸준히 포스팅 해볼 생각이다. 1. 캡스톤 (졸업프로젝트) 여름방학 때 ROS를 공부하고, 학기 중에는 드론 부품들을 구매해 직접 조립, 제대로 동작까지는 확인했다. 하지만 GPS 없이 어떻게 위치를 가져올 것인지와 크기 등의 제약사항이 많아 다른 완제품 드론을 통하여 프로젝트를 진행하게 될것 같아 할일이 많아졌다. 거의 사용한 적 없는 파이썬을 사용하여 마커를 따라 비행하고 작물의 사진을 찍어 전송하는 등의 기능들을 구현할것이다. 2. 동아리 프로젝트 I-Taxi 내가 새내기때까지만 해도 학교 학생들이 많이 사용하던 택시를 같이 타거나 카풀을 구하는 앱인 아이택시가 리뉴얼이 됐고, 이후 추가 개발과 유지보수를 위한 프로젝트에 백엔드 개발로 참여하게 됐다. 캡스톤과 병행하게 되어 조금 힘들겠지만, 내가 공부하고 싶었던 백엔드를 맡게 되어 재밌게 할 수 있을 것 같다. 3…","frontmatter":{"date":"December 19, 2022","title":"22 겨울방학 계획","categories":"기타","author":"김형진","emoji":null},"fields":{"slug":"/2022-winter/"}},"next":{"id":"d3865eb0-c3f6-5e23-86fa-e8e76cd809a7","html":"<h2 id=\"문제\" style=\"position:relative;\"><a href=\"#%EB%AC%B8%EC%A0%9C\" aria-label=\"문제 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>문제</h2>\n<p>0과 1로만 이루어진 수를 이진수라 한다. 이러한 이진수 중 특별한 성질을 갖는 것들이 있는데, 이들을 이친수(pinary number)라 한다. 이친수는 다음의 성질을 만족한다.</p>\n<p>이친수는 0으로 시작하지 않는다.\n이친수에서는 1이 두 번 연속으로 나타나지 않는다. 즉, 11을 부분 문자열로 갖지 않는다.\n예를 들면 1, 10, 100, 101, 1000, 1001 등이 이친수가 된다. 하지만 0010101이나 101101은 각각 1, 2번 규칙에 위배되므로 이친수가 아니다.</p>\n<p>N(1 ≤ N ≤ 90)이 주어졌을 때, N자리 이친수의 개수를 구하는 프로그램을 작성하시오.</p>\n<h2 id=\"풀이\" style=\"position:relative;\"><a href=\"#%ED%92%80%EC%9D%B4\" aria-label=\"풀이 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>풀이</h2>\n<p>먼저 N의 숫자에 따른 가능한 모든 이친수를 직접 찾아보며 시작했다. N = 1일때 이친수의 숫자는 1, N = 2일 때 동일, N = 3일 때 2, N = 4일 때 3 …</p>\n<p>여기까지 찾았다면 백준에서 문제를 어느정도 풀어본 사람들은 모두 알만한 시퀀스가 보이기 시작한다. 100% 확실하지는 않았지만 피보나치 시퀀스를 구현하여 제출하니 싱겁게 AC를 받았다…</p>\n<h2 id=\"코드\" style=\"position:relative;\"><a href=\"#%EC%BD%94%EB%93%9C\" aria-label=\"코드 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>코드</h2>\n<div class=\"gatsby-highlight\" data-language=\"cpp\"><pre class=\"language-cpp\"><code class=\"language-cpp\"><span class=\"token macro property\"><span class=\"token directive-hash\">#</span><span class=\"token directive keyword\">include</span> <span class=\"token string\">&lt;iostream></span></span>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#</span><span class=\"token directive keyword\">include</span> <span class=\"token string\">&lt;algorithm></span></span>\n<span class=\"token keyword\">using</span> <span class=\"token keyword\">namespace</span> std<span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">long</span> <span class=\"token keyword\">long</span> dp<span class=\"token punctuation\">[</span><span class=\"token number\">91</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">int</span> <span class=\"token function\">main</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n<span class=\"token punctuation\">{</span>\n    cin<span class=\"token punctuation\">.</span><span class=\"token function\">tie</span><span class=\"token punctuation\">(</span><span class=\"token constant\">NULL</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    ios_base<span class=\"token double-colon punctuation\">::</span><span class=\"token function\">sync_with_stdio</span><span class=\"token punctuation\">(</span><span class=\"token boolean\">false</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n    <span class=\"token comment\">/*\n    n = 1: 1 == 1\n    n = 2: 10, 11 == 1\n    n = 3: 100, 101, 110, 111 == 2 (100, 101) \n    n = 4: 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111 == 3 (1000, 1001, 1010)\n    n = 5: 10000, 10001, 10010, 10101, 10100\n\n    마지막 숫자가 0이라면 0과 1 모두 들어갈 수 있지만, 1일 때는 0밖에 들어갈 수 없다.\n    그냥 피보나치 수열인데 dp를 int로 선언했어서 바로 틀려버렸다.\n    long long으로 선언하니 바로 해결...\n    */</span>\n\n    <span class=\"token keyword\">int</span> num<span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">long</span> <span class=\"token keyword\">long</span> ans<span class=\"token punctuation\">;</span>\n\n    cin <span class=\"token operator\">>></span> num<span class=\"token punctuation\">;</span>\n    \n    dp<span class=\"token punctuation\">[</span><span class=\"token number\">1</span><span class=\"token punctuation\">]</span> <span class=\"token operator\">=</span> <span class=\"token number\">1</span><span class=\"token punctuation\">;</span>\n    dp<span class=\"token punctuation\">[</span><span class=\"token number\">2</span><span class=\"token punctuation\">]</span> <span class=\"token operator\">=</span> <span class=\"token number\">1</span><span class=\"token punctuation\">;</span>\n\n    <span class=\"token keyword\">for</span> <span class=\"token punctuation\">(</span><span class=\"token keyword\">int</span> i <span class=\"token operator\">=</span> <span class=\"token number\">3</span><span class=\"token punctuation\">;</span> i <span class=\"token operator\">&lt;=</span> num<span class=\"token punctuation\">;</span> i<span class=\"token operator\">++</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        dp<span class=\"token punctuation\">[</span>i<span class=\"token punctuation\">]</span> <span class=\"token operator\">=</span> dp<span class=\"token punctuation\">[</span>i <span class=\"token operator\">-</span> <span class=\"token number\">1</span><span class=\"token punctuation\">]</span> <span class=\"token operator\">+</span> dp<span class=\"token punctuation\">[</span>i <span class=\"token operator\">-</span> <span class=\"token number\">2</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n\n    ans <span class=\"token operator\">=</span> dp<span class=\"token punctuation\">[</span>num<span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span>\n    cout <span class=\"token operator\">&lt;&lt;</span> ans<span class=\"token punctuation\">;</span>\n\n    <span class=\"token keyword\">return</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<div class=\"table-of-contents\">\n<ul>\n<li><a href=\"#%EB%AC%B8%EC%A0%9C\">문제</a></li>\n<li><a href=\"#%ED%92%80%EC%9D%B4\">풀이</a></li>\n<li><a href=\"#%EC%BD%94%EB%93%9C\">코드</a></li>\n</ul>\n</div>","frontmatter":{"date":"August 04, 2022","title":"[백준] 2193 - 이친수","categories":"알고리즘","author":"김형진","emoji":"🎇"},"fields":{"slug":"/2193/"}},"prev":null,"site":{"siteMetadata":{"siteUrl":"https://hhjj0506.github.io","comments":{"utterances":{"repo":"hhjj0506/hhjj0506.github.io"}}}}},"pageContext":{"slug":"/2022-winter/","nextSlug":"/2193/","prevSlug":""}},
    "staticQueryHashes": ["1073350324","1956554647","2938748437"]}