<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>quant developer dave</title>
    <link>https://healthydeveloper.tistory.com/</link>
    <description>퀀트 트레이딩을 좋아하는 개발자입니다.</description>
    <language>ko</language>
    <pubDate>Sun, 26 Jul 2026 23:13:56 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>quantdave</managingEditor>
    <item>
      <title>사라지만 발판 python 풀이 2022 KAKAO BLIND RECRUITMENT 프로그래머스</title>
      <link>https://healthydeveloper.tistory.com/48</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;615&quot; data-origin-height=&quot;297&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bHXIc2/btrDERk7jkS/dvvsIB9td8Lw0w0iITgzFk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bHXIc2/btrDERk7jkS/dvvsIB9td8Lw0w0iITgzFk/img.png&quot; data-alt=&quot;https://programmers.co.kr/learn/courses/30/lessons/92345&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bHXIc2/btrDERk7jkS/dvvsIB9td8Lw0w0iITgzFk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbHXIc2%2FbtrDERk7jkS%2FdvvsIB9td8Lw0w0iITgzFk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;615&quot; height=&quot;297&quot; data-origin-width=&quot;615&quot; data-origin-height=&quot;297&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;https://programmers.co.kr/learn/courses/30/lessons/92345&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure id=&quot;og_1654061343055&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;코딩테스트 연습 - 사라지는 발판&quot; data-og-description=&quot;[[1, 1, 1], [1, 1, 1], [1, 1, 1]] [1, 0] [1, 2] 5 [[1, 1, 1], [1, 0, 1], [1, 1, 1]] [1, 0] [1, 2] 4&quot; data-og-host=&quot;programmers.co.kr&quot; data-og-source-url=&quot;https://programmers.co.kr/learn/courses/30/lessons/92345&quot; data-og-url=&quot;https://programmers.co.kr/learn/courses/30/lessons/92345&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/c8Rg2x/hyOCAwJKCT/A6wuHn63QmFT7T33CmI0iK/img.jpg?width=626&amp;amp;height=626&amp;amp;face=0_0_626_626,https://scrap.kakaocdn.net/dn/N51K2/hyOCMqprL2/wZ509dmDS1LJ1PxZBQxxX0/img.jpg?width=626&amp;amp;height=626&amp;amp;face=0_0_626_626,https://scrap.kakaocdn.net/dn/kIF03/hyOBK8PbtU/lVDk8xkkuM0IFSTwFvLDWK/img.png?width=1000&amp;amp;height=1000&amp;amp;face=0_0_1000_1000&quot;&gt;&lt;a href=&quot;https://programmers.co.kr/learn/courses/30/lessons/92345&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://programmers.co.kr/learn/courses/30/lessons/92345&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/c8Rg2x/hyOCAwJKCT/A6wuHn63QmFT7T33CmI0iK/img.jpg?width=626&amp;amp;height=626&amp;amp;face=0_0_626_626,https://scrap.kakaocdn.net/dn/N51K2/hyOCMqprL2/wZ509dmDS1LJ1PxZBQxxX0/img.jpg?width=626&amp;amp;height=626&amp;amp;face=0_0_626_626,https://scrap.kakaocdn.net/dn/kIF03/hyOBK8PbtU/lVDk8xkkuM0IFSTwFvLDWK/img.png?width=1000&amp;amp;height=1000&amp;amp;face=0_0_1000_1000');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;코딩테스트 연습 - 사라지는 발판&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;[[1, 1, 1], [1, 1, 1], [1, 1, 1]] [1, 0] [1, 2] 5 [[1, 1, 1], [1, 0, 1], [1, 1, 1]] [1, 0] [1, 2] 4&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;programmers.co.kr&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1475&quot; data-origin-height=&quot;697&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bsYTMr/btrDFJNFjiC/fBmC16urBniy5IdiN0uyB0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bsYTMr/btrDFJNFjiC/fBmC16urBniy5IdiN0uyB0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bsYTMr/btrDFJNFjiC/fBmC16urBniy5IdiN0uyB0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbsYTMr%2FbtrDFJNFjiC%2FfBmC16urBniy5IdiN0uyB0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1475&quot; height=&quot;697&quot; data-origin-width=&quot;1475&quot; data-origin-height=&quot;697&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;minmax tree를 사용해서 풀었다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;game(board, aloc, bloc) 함수는 두가지 값을 반환 하는데 (&amp;nbsp;&lt;span&gt;Tuple[bool, int]&lt;span&gt; )&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;첫번째는 이번 차례에 aloc가 이길 수 있는지 여부&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;두번째는 이길 수 있다면 최소 길이 못 이기면 최대 길이를 반환 한다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;next_aloc는 aloc가 다음번에 이동할 칸의 위치이고,&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이때 game(board, bloc, next_aloc) 반환 값을 이용해 최적의 플레이를 하도록 한다.&lt;/p&gt;
&lt;pre id=&quot;code_1654060569804&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;from typing import Tuple
moves = [(0, 1), (-1, 0), (1, 0), (0, -1)]

def game(board, aloc, bloc,)-&amp;gt; Tuple[bool, int]:
    game_results = []
    
    if board[bloc[0]][bloc[1]] == 0:
        return True, 0
    if board[aloc[0]][aloc[1]] == 0:
        return False, 0
    
    for move in moves:
        next_aloc = (aloc[0]+move[0], aloc[1]+move[1])        
        try:
            if next_aloc[0] &amp;lt; 0 or next_aloc[1] &amp;lt; 0 :
                raise IndexError
            next_board = board[next_aloc[0]][next_aloc[1]]
        except IndexError:
            continue
        
        if next_board == 1:
            board[aloc[0]][aloc[1]] = 0
            win, game_length = game(board, bloc, next_aloc)
            board[aloc[0]][aloc[1]] = 1
            game_results.append((not win, game_length+1))
    
    if len(game_results) == 0:
        return False, 0
    elif any(r[0] for r in game_results):
        return True, min(r[1] for r in game_results if r[0])
    else:
        return False, max(r[1] for r in game_results)

def solution(board, aloc, bloc):
    return game(board, aloc, bloc)[1]&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1292&quot; data-origin-height=&quot;1167&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/daECUw/btrDFJUvXj4/xXXtWdBZriNy7ZpAnuYd50/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/daECUw/btrDFJUvXj4/xXXtWdBZriNy7ZpAnuYd50/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/daECUw/btrDFJUvXj4/xXXtWdBZriNy7ZpAnuYd50/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdaECUw%2FbtrDFJUvXj4%2FxXXtWdBZriNy7ZpAnuYd50%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;691&quot; height=&quot;624&quot; data-origin-width=&quot;1292&quot; data-origin-height=&quot;1167&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/48</guid>
      <comments>https://healthydeveloper.tistory.com/48#entry48comment</comments>
      <pubDate>Wed, 1 Jun 2022 14:27:20 +0900</pubDate>
    </item>
    <item>
      <title>파이썬 튜토리얼 1. 애피타이저 (Whetting Your Appetite)</title>
      <link>https://healthydeveloper.tistory.com/47</link>
      <description>&lt;p&gt;&lt;a href=&quot;https://docs.python.org/3/tutorial/appetite.html&quot;&gt;https://docs.python.org/3/tutorial/appetite.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;만약 당신이 컴퓨터로&amp;nbsp; 많은 작업을 한다면, 결국에 당신은 자동화 하고 싶은 일을 발견하게 될겁니다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;예를들면, 당신은 대용량 텍스트 파일에서 찾아바꾸기를 수행하거나, 복잡한 방법으로 많은 사진들을 정리하거나 이름을 바꾸고 싶을 수도 있습니다. 아마도 당신은 작은 커스텀 데이터베이스나 특정 GUI 어플리케이션 혹은 간단한 게임을 만들고 싶을 수도 있습니다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;만약 당신이 전문적인 소프트웨어 개발자라면, C/C++/JAVA 라이브러리를 사용하게 될수도 있지만 그 과정에서 보통 코드작성/컴파일/테스트/리컴파일 싸이클이 너무 많은 시간을 소요합니다. 그리고 당신은 특정 라이브러리를 위한 test suite를 작성하며 test code를 작성하는것이 지루한 일이라는 것을 발견할 것입니다. 혹은 당신이 이미 언어 확장이 가능한 프로그램을 만들었지만, 새로운 언어 전체를 설계하고 구현하고 싶지는 않을수도 있습니다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;파이썬은 당신을 위한 언어 입니다. (&lt;span&gt;&lt;b&gt;Python is just the language for you&lt;/b&gt;.)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;당신은 위에서 서술한 작업들을 위해 유닉스 쉘 스크립트 혹은 윈도우 배치 파일을 작성할 수 있습니다. 그러나 쉘스크립트는 파일을 이동시키거나 텍스트를 수정하는데는 적합하지만,&amp;nbsp; GUI&amp;nbsp; 어플리케이션 혹은 게임을 만드는데는 적합하지 않습니다. 당신은 C/C++/JAVA를 사용할 수도 있지만, 이는 초안을 개발하기까지도 많은 시간을 필요로 합니다. 파이썬은 사용하기 단순하면서 윈도우 맥 유닉스 시스템 모두에서 사용이 가능하고 빠른 일 처리를 가능하게합니다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;파이썬은 단순하지만, 쉘 스크립트 혹은 배치 파일에 비해 훨씬 더 구조적이며 대규모 프로그램 개발을 지원합니다.&lt;/p&gt;
&lt;p&gt;한편, 파이썬은 C언어에 비해 훨씬 더 많은 에러 체킹 기능을 지원하고 가변길이 배열(flexible array)과 사전 자료형(dictionary)과 같은 built-in high-level data type을 지원하는 high level language 입니다.&amp;nbsp; 제너럴 데이터 타입 덕분에 파이썬은 Awk 혹은 펄에 비해 훨씬 더 큰 프로램에도 적용 될 수 있습니다. &lt;span style=&quot;color: #000000;&quot;&gt;적어도&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;파이썬에서 많은 것들을 &lt;span style=&quot;color: #000000;&quot;&gt;그 언어들만큼&lt;/span&gt; 쉽게 구현 할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000000;&quot;&gt;파이썬은 당신의 프로그램을 다른 파이썬 프로그램에서 재사용 가능한 모듈로 분리할수 있게 해줍니다.&amp;nbsp; 파이썬에는 당신의 프로그램의 기반이 되어주거나 프로그램을 배울때 예시가 되어줄 다양한 표준 모듈이 있습니다.&amp;nbsp; 이런 모듈중 일부는 file I/O, 시스템 콜 그리고 Tk와 같은 GUI 툴킷까지도 제공을 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>파이썬</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/47</guid>
      <comments>https://healthydeveloper.tistory.com/47#entry47comment</comments>
      <pubDate>Fri, 10 Jul 2020 22:23:28 +0900</pubDate>
    </item>
    <item>
      <title>대경권 대학생 프로그래밍 경진대회 3번 with 프로그래머스</title>
      <link>https://healthydeveloper.tistory.com/46</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;707&quot; data-origin-height=&quot;242&quot;&gt;&lt;span data-url=&quot;https://t1.daumcdn.net/cfile/tistory/99CDC8335AE4160B12?original&quot; data-phocus=&quot;https://t1.daumcdn.net/cfile/tistory/99CDC8335AE4160B12?original&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/99CDC8335AE4160B12&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F99CDC8335AE4160B12&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;707&quot; height=&quot;242&quot; data-origin-width=&quot;707&quot; data-origin-height=&quot;242&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;752&quot; data-origin-height=&quot;686&quot;&gt;&lt;span data-url=&quot;https://t1.daumcdn.net/cfile/tistory/997585335AE4160B17?original&quot; data-phocus=&quot;https://t1.daumcdn.net/cfile/tistory/997585335AE4160B17?original&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/997585335AE4160B17&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F997585335AE4160B17&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;752&quot; height=&quot;686&quot; data-origin-width=&quot;752&quot; data-origin-height=&quot;686&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;요약하면 문제는 입력된 명령어대로 움직였을 때, 지나온 길의 수를 찾는것이다.&amp;nbsp; 입력이 매우 작으므로 그냥 나올 수 있는 모든 길을 저장하는 2차원 배열(footprints)을 선언해 메모이제이션 했다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;코드&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre id=&quot;code_1679757571087&quot; class=&quot;cpp&quot; data-ke-language=&quot;cpp&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;#include &amp;lt;string&amp;gt;
#include &amp;lt;algorithm&amp;gt;
#include &amp;lt;memory.h&amp;gt;
using namespace std;


# -5~5의 범위를 가지는 2차원 좌표를 정수 하나로 변환 해주는 함수.
int flatten(int y, int x){
    y += 5;
    x += 5;
    return y*11+x;
}

int footprints[122][122];
int solution(string dirs)
{
    int answer = 0;
    int now_y = 0;
    int now_x = 0;

    for (auto i=dirs.begin(); i!=dirs.end(); i++){
        int prev_y = now_y;
        int prev_x = now_x;

		switch (*i){
            case 'U':
                now_y += 1;
                break;
            case 'D':
                now_y -= 1;
                break;
            case 'R':
                now_x += 1;
                break;
            case 'L':
                now_x -= 1;
                break;
        }

        if(now_y &amp;lt; -5) now_y = -5;
        if(now_y &amp;gt; 5) now_y = 5;
        if(now_x &amp;lt; -5) now_x =-5;
        if(now_x &amp;gt; 5) now_x = 5;

        int flat_prev = flatten(prev_y, prev_x);
        int flat_now = flatten(now_y, now_x);

        if( (flat_prev != flat_now)
           &amp;amp;&amp;amp; (footprints[flat_prev][flat_now] == 0)){
            footprints[flat_prev][flat_now] = 1;
            footprints[flat_now][flat_prev] = 1;
            answer += 1;
        }
    }
    return answer;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/46</guid>
      <comments>https://healthydeveloper.tistory.com/46#entry46comment</comments>
      <pubDate>Sat, 28 Apr 2018 15:47:26 +0900</pubDate>
    </item>
    <item>
      <title>대경권 대학생 프로그래밍 경진대회 2번 with 프로그래머스</title>
      <link>https://healthydeveloper.tistory.com/45</link>
      <description>&lt;p&gt;오랜만에 알고리즘 문제를 푸니 기분이 좋아 대회 리뷰를 남긴다. 1번은 너무 단순한 구현 문제라 생략한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 669px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/999A2A435AE4138E41&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F999A2A435AE4138E41&quot; width=&quot;669&quot; height=&quot;728&quot; filename=&quot;1.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;전형적인 dp 문제.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;첫번째 입력 예제인 [1,1,1,1] 문제를 (0, [1,1,1,1])로 두고 (1, [1,1,1])과 (-1, [1,1,1]) 경우로 나누는 방법으로 recursive property를 찾아 문제를 해결했다.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;코드&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;string&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;vector&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;memory.h&amp;gt;&lt;/p&gt;&lt;p&gt;using namespace std;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int d[102][1001*2], N;&lt;/p&gt;&lt;p&gt;vector&amp;lt;int&amp;gt; input;&lt;/p&gt;&lt;p&gt;int dp(int state, int value){&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; int index_value = value + 1001;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; int &amp;amp;ret = d[state][index_value] ;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (ret != -1)&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ret;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (state == N)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return value == 0;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; int result = 0;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; result += dp(state+1, value+input[state]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; result += dp(state+1, value-input[state]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; result %= 100000;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return ret=result;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int solution(vector&amp;lt;int&amp;gt; numbers) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; input = numbers;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; N = input.size();&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; memset(d,-1,sizeof(d));&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return dp(0, 0);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/45</guid>
      <comments>https://healthydeveloper.tistory.com/45#entry45comment</comments>
      <pubDate>Sat, 28 Apr 2018 15:29:54 +0900</pubDate>
    </item>
    <item>
      <title>boj 14699 관악산 등산</title>
      <link>https://healthydeveloper.tistory.com/44</link>
      <description>&lt;p&gt;게을러져서 문제도 많이 안풀고 풀이 남기는 것도 귀찮았는데 그래도 주1회 정도는 포스팅을 하려고 다시 마음을 먹었다.&lt;/p&gt;&lt;p&gt;서울대 프로그래밍 콘테스트 문제를 하나씩 풀어나가고 있다.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;문제링크 :&amp;nbsp;&lt;a href=&quot;https://www.acmicpc.net/problem/14699&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.acmicpc.net/problem/14699&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;문제를 읽고 처음 든 순간은 최단거리네? 최단거리 알고리즘 중에 아무꺼나 하나 골라 쓰자였다. 그 생각에 사로잡혀 문제 조건도 확인안하고 다익스트라를 n번 돌리는걸로 답을 구해&amp;nbsp;시간초과 ... 와샬플로이드써서 시간초과 ....&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;그렇게 두번 실패를 하고 찬찬히 다시 문제를 읽어보니 간단한 dp 문제였다. &amp;nbsp;코딩 테스트 같은걸 볼때 쉬운 문제라도 이런 실수를 해버리면 시간안에 못풀수있겠다는 생각이 든다. 경각심을 가져야겠다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;풀이 : &amp;nbsp;일단 더 위쪽 쉼터에서 아래로 내려가는 경우가 없으므로 양방향이 아닌 단방향(저 -&amp;gt; 고)으로 그래프를 만든다. 그 후에 dfs로 탐색을 하는데 현재 쉼터 s에서 들릴 수 있는 최대 쉼터 갯수&amp;nbsp;d(s)는 max( d(s에서 갈 수 있는 모든 쉼터) &amp;nbsp;+ 1) 이다. &amp;nbsp;재귀적인 속성을 가지므로 재귀함수로 작성을 하면 간단하다. 또한 d(s)는 중복 호출이 많이 되므로 메모이제션을 해서 중복 계산을 막는다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;소스코드 &amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;iostream&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;vector&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;cstdio&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;algorithm&amp;gt;&lt;/p&gt;&lt;p&gt;using namespace std;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int a, b, V, E;&lt;/p&gt;&lt;p&gt;const int MAX_V = 5001;&lt;/p&gt;&lt;p&gt;const int INF = 987654320;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;vector&amp;lt;pair&amp;lt;int, int&amp;gt;&amp;gt;adj[MAX_V];&lt;/p&gt;&lt;p&gt;vector&amp;lt;int&amp;gt; cache(MAX_V, -1);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int dp(int s) {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int &amp;amp;ret = cache[s];&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;if (ret != -1) return ret;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int res = 1;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;for (int i = 0; i &amp;lt; adj[s].size(); i++) {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;res = max(res, dp(adj[s][i].first) + 1);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;return ret = res;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;int main() {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;cin &amp;gt;&amp;gt; V &amp;gt;&amp;gt; E;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;for (int i = 0; i&amp;lt;E; i++) {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;scanf(&quot;%d%d&quot;, &amp;amp;a, &amp;amp;b);&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;a--; b--;&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;//더 위에 있는 쉼터만 연결함.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;if (height[a] &amp;lt; height[b]) adj[a].push_back(pair&amp;lt;int, int&amp;gt;(b, 1));&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;else if (height[a] &amp;gt; height[b]) adj[b].push_back(pair&amp;lt;int, int&amp;gt;(a, 1));&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int res = 0;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;for (int j = 0; j &amp;lt; V; j++) {&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;cout &amp;lt;&amp;lt; dp(j) &amp;lt;&amp;lt; endl;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;</description>
      <category>알고리즘/BOJ문제풀이</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/44</guid>
      <comments>https://healthydeveloper.tistory.com/44#entry44comment</comments>
      <pubDate>Wed, 27 Sep 2017 23:09:32 +0900</pubDate>
    </item>
    <item>
      <title>5월 인바디 결과</title>
      <link>https://healthydeveloper.tistory.com/43</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;원래 인바디를 잴 때 마다 업로드 하려 했으나 3월은 귀찮아서 못했다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;바빠서 운동을 집에서 풀업하고 딥스 팔굽혀펴기 정도 밖에 못해서 크게 변한건 없는 듯 하다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;3월에 비해 골격근 0.8kg / 체지방 0.1kg 이 늘었다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;6월은 더 바쁘겠지만 그래도 시간 내서 운동 가보려고 다시 헬스장을 등록했다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;6월 말에 다시 재러 가야겠다.&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left; clear: none; float: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 723px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2339313C592994EA20&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2339313C592994EA20&quot; width=&quot;723&quot; height=&quot;207&quot; filename=&quot;골격근.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 477px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2623F63C592994EB01&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2623F63C592994EB01&quot; width=&quot;477&quot; height=&quot;171&quot; filename=&quot;골격근2.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>헬스</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/43</guid>
      <comments>https://healthydeveloper.tistory.com/43#entry43comment</comments>
      <pubDate>Sun, 28 May 2017 00:03:29 +0900</pubDate>
    </item>
    <item>
      <title>팁스타운 배 코드챌린지 본선 - 3번</title>
      <link>https://healthydeveloper.tistory.com/42</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 723px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2166E536592329FD11&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2166E536592329FD11&quot; width=&quot;723&quot; height=&quot;907&quot; filename=&quot;문제3.PNG&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;예전에 풀었던 백준넷 단어와 주기율표 문제의 다운그레이드 버전&lt;/p&gt;&lt;p&gt;https://www.acmicpc.net/problem/4507&lt;br /&gt;&lt;/p&gt;&lt;p&gt;저 문제는 조건이 상당히 까다로워 아직도 푼 사람이 두명밖에 없어서 뿌듯하다 ㅋㅋㅋ&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;동적 계획법 문제인데, dp(state)를 state~끝 문장을 처리 할 때 필요한 최소 단어 조각 갯수로 정의했다&lt;/p&gt;&lt;p&gt;최대 단어 조각 길이는 5이므로 state부터 한자리씩 추가해가면서 단어 조각 목록에 있는지를 검사해 있으면 그 다음 글자부터 필요한 단어 조각 갯수를 계산하는 과정을 다섯번 반복한다. 그 중 최소값을 반환하면 된다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int d[20001];&lt;/p&gt;&lt;p&gt;set&amp;lt;string&amp;gt; dictionary;&lt;/p&gt;&lt;p&gt;string str;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int dp( int state)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;if(state&amp;gt;=str.length()) return 0;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int &amp;amp;ret &amp;nbsp;= d[state];&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;if(ret != -1) return ret;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int res = 987654321;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;string match = &quot;&quot;;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;for(int i=state; i&amp;lt;state+5; i++)&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;match+=str[i];&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;if(dictionary.find(match) != dictionary.end())&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;res = min(res, dp(i+1)+1);&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;return ret = res;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int solution(vector&amp;lt;string&amp;gt; strs, string t)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int answer = 0;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;dictionary.clear();&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;memset(d,-1,sizeof(d));&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;str = t;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;for(auto i=strs.begin(); i!=strs.end(); i++)&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;dictionary.insert(*i);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;int ret = dp(0);&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;if(ret &amp;gt; 20001) return -1;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;return ret;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/42</guid>
      <comments>https://healthydeveloper.tistory.com/42#entry42comment</comments>
      <pubDate>Tue, 23 May 2017 03:17:34 +0900</pubDate>
    </item>
    <item>
      <title>팁스타운 배 코드챌린지 본선 - 2번</title>
      <link>https://healthydeveloper.tistory.com/41</link>
      <description>&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 723px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2540363A592328F50F&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2540363A592328F50F&quot; width=&quot;723&quot; height=&quot;787&quot; filename=&quot;문제.PNG&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;전형적인 스택 사용 문제&lt;/p&gt;&lt;p&gt;순차적으로 입력받은 문자열을 순회하면서 스택이 비어 있거나 최상단 문자와 다르면 푸시&lt;/p&gt;&lt;p&gt;최상단 문자와 같으면 팝 하는 과정을 반복 후에 스택이 비어있으면 모두 제거가능하다.&lt;/p&gt;&lt;p&gt;시간 복잡도 O(n)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;int solution(string s)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;stack&amp;lt;char&amp;gt; st;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;for(int i=0; i&amp;lt;s.length(); i++)&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;if(st.empty() || st.top() != s[i])&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;st.push(s[i]);&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;else if(st.top() == s[i])&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;{&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;st.pop();&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;}&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;return st.empty();&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/41</guid>
      <comments>https://healthydeveloper.tistory.com/41#entry41comment</comments>
      <pubDate>Tue, 23 May 2017 03:09:23 +0900</pubDate>
    </item>
    <item>
      <title>프로그래머스 - Summer coding 온라인 예선  3번</title>
      <link>https://healthydeveloper.tistory.com/40</link>
      <description>&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;월
&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;20&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;일 오후 한시에 있었던 &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;스타트업&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt; 인턴 채용을 위한 대회인&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;Summer
coding &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;온라인 예선에 참가하게 되었고 문제와 해답을 공유 합니다&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;. &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;제가 공유한 코드는 전부 만점이긴 하지만&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;대회라는 시간이 촉박한 상황에서 작성 했기 때문에 다소 지저분한
코드가 있을 수 있습니다&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;문제&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: 굴림; color: rgb(120, 144, 156); vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;N개의 스티커가 원형으로 연결되어 있습니다. 다음 그림은 N = 8인
경우의 예시입니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;vertical-align: baseline;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 350px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2146D64A59205E621D&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2146D64A59205E621D&quot; width=&quot;350&quot; height=&quot;350&quot; filename=&quot;그림5.jpg&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;vertical-align: baseline;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 210pt; font-family: 굴림; color: rgb(120, 144, 156); vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;원형으로
연결된 스티커에서 몇 장의 스티커를 뜯어내어 뜯어낸 스티커에 적힌 숫자의 합이 최대가 되도록 하고 싶습니다. 단 스티커 한 장을 뜯어내면
양쪽으로 인접해있는 스티커는 찢어져서 사용할 수 없게 됩니다.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;예를 들어 위 그림에서 14가 적힌 스티커를 뜯으면 인접해있는 10, 6이
적힌 스티커는 사용할 수 없습니다. 스티커에 적힌 숫자가 배열 형태로 주어질 때, 스티커를 뜯어내어 얻을 수 있는 숫자의 합의 최댓값을
return 하는 solution 함수를 완성해 주세요. 원형의 스티커 모양을 위해 배열의 첫 번째 원소와 마지막 원소가 서로 연결되어 있다고
간주합니다.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;제한 사항&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;sticker는 원형으로 연결된 스티커의 각 칸에 적힌 숫자가 순서대로
들어있는 배열로, 길이(N)는 1 이상 100,000 이하입니다.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;sticker의 각 원소는 스티커의 각 칸에 적힌 숫자이며, 각 칸에 적힌
숫자는 1 이상 100 이하의 자연수입니다.&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;/p&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; text-align: left; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size:12.0pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-variant-ligatures: normal; font-variant-caps: normal; color: rgb(166, 166, 166); text-transform: none; font-weight: normal; font-style: normal; vertical-align: baseline;&quot;&gt;원형의 스티커 모양을 위해 sticker 배열의 첫 번째 원소와 마지막
원소가 서로 연결되어있다고 간주합니다.&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); font-size: 14pt;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-weight: bold; color: rgb(166, 166, 166);&quot;&gt;입출력 예&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;553&quot; style=&quot;border-collapse:
 collapse;width:332pt;mso-yfti-tbllook:1536&quot;&gt;
 &lt;colgroup&gt;&lt;col width=&quot;276&quot; span=&quot;2&quot; style=&quot;mso-width-source:userset;width:166pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
 &lt;/span&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr&gt;
  &lt;td class=&quot;oa1&quot; width=&quot;276&quot; style=&quot;width:166pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;sticker&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa1&quot; width=&quot;276&quot; style=&quot;width:166pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;answer&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td class=&quot;oa2&quot; width=&quot;276&quot; style=&quot;width: 166pt; height: 64px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;[14,
  6, 5, 11, 3, 9, 2, 10]&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa2&quot; width=&quot;276&quot; style=&quot;width: 166pt; height: 64px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;36&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td class=&quot;oa3&quot; width=&quot;276&quot; style=&quot;width:166pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;[1,
  3, 2, 5, 4]&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa3&quot; width=&quot;276&quot; style=&quot;width:166pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;8&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-weight: bold; color: rgb(166, 166, 166);&quot;&gt;입출력 예 설명&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-size: 10pt;&quot;&gt;입출력 예 #1&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size:18.0pt;font-family:roboto;mso-ascii-font-family:굴림;mso-fareast-font-family:
roboto;mso-bidi-font-family:굴림;color:#78909C;mso-font-kerning:12.0pt;
language:ko;text-combine:letters;mso-style-textfill-type:solid;mso-style-textfill-fill-color:
#78909C;mso-style-textfill-fill-alpha:100.0%&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
6, 11, 9, 10이 적힌 스티커를 떼어 냈을 때 36으로 최대가 됩니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size:18.0pt;font-family:roboto;mso-ascii-font-family:굴림;mso-fareast-font-family:
roboto;mso-bidi-font-family:굴림;color:#78909C;mso-font-kerning:12.0pt;
language:ko;text-combine:letters;mso-style-textfill-type:solid;mso-style-textfill-fill-color:
#78909C;mso-style-textfill-fill-alpha:100.0%&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;입출력 예 #2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
3, 5가 적힌 스티커를 떼어 냈을 때 8로 최대가 됩니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-weight: bold; color: rgb(166, 166, 166);&quot;&gt;풀이&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;간단한 동적 계획법 문제인데, 가장 코드가 마음에 안드는 문제.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;처음 스티커를 제거하면 마지막 스티커를 획득 못하고, 마지막 스티커를 제거하면 처음 스티커를 획득 하지 못합니다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;이 조건 처리가 상당히 귀찮아서 캐싱 배열을 두배로 잡았습니다&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;처음 스티커를 획득하면 b = 0 / 아닌 경우는 b=1을 넣어서 호출합니다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;s번째 스티커를 때는 경우 = d[s+2] + sticker[s]&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;s번째 스티커를 안때는 경우 = d[s+1]&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;s번째 부터 끝까지 스티커를 때서 얻을 수 있는 최댓값 = max ( d[s+2] + sticker[s], d[s+1] )&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166);&quot;&gt;* 마지막 스터커 처리는 기저 조건에서 처음 스티커를 땠으면 마지막 스티커를 획득 못하게 합니다.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;int d[100001][2],len;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;int dp(const vector&amp;lt;int&amp;gt;&amp;amp;sticker, int s, int b)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;{&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; if(s&amp;gt;=len) return 0;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; if(s==len-1)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(b==0)return sticker[s];&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else return 0;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; int &amp;amp;ret= d[s][b];&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; if(ret != -1) return ret;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp;return ret = max(sticker[s]+dp(sticker,s+2,b) &amp;nbsp;, dp(sticker,s+1,b)); &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;}&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;int solve(const vector&amp;lt;int&amp;gt;&amp;amp;skicker)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;{&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; len =sticker.size();&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; memset(d,-1,sizeof(d));&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; return max(dp(sticker, 2, 1 ) + sticker[0] , dp(sticker,1,0));&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;}&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;int solution(vector&amp;lt;int&amp;gt; sticker)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;{&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; int answer = solve(sticker);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;&amp;nbsp; &amp;nbsp; return answer; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;}&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/40</guid>
      <comments>https://healthydeveloper.tistory.com/40#entry40comment</comments>
      <pubDate>Sun, 21 May 2017 00:26:58 +0900</pubDate>
    </item>
    <item>
      <title>프로그래머스 - Summer coding 온라인 예선  2번</title>
      <link>https://healthydeveloper.tistory.com/39</link>
      <description>&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;5월 20일 오후 한시에 있었던 &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;스타트업&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt; 인턴
채용을 위한 대회인&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;Summer
coding 온라인 예선에 참가하게 되었고 문제와 해답을 공유 합니다. 제가 공유한 코드는 전부 만점이긴 하지만, 대회라는 시간이 촉박한
상황에서 작성 했기 때문에 다소 지저분한 코드가 있을 수 있습니다.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 돋움; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 돋움; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); font-weight: bold; vertical-align: baseline;&quot;&gt;문제&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 돋움; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;N개의 아파트가 일렬로 쭉 늘어서 있습니다. 이 중에서 일부 아파트
옥상에는 4g 기지국이 설치되어 있습니다. 기술이 발전해 5g 수요가 높아져 4g 기지국을 5g 기지국으로 바꾸려 합니다. 그런데 5g
기지국은 4g 기지국보다 전달 범위가 좁아, 4g 기지국을 5g 기지국으로 바꾸면 어떤 아파트에는 전파가 도달하지 않습니다.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;예를 들어 11개의 아파트가 쭉 늘어서 있고, [4, 11] 번째 아파트
옥상에는 4g 기지국이 설치되어 있습니다. 만약 이 4g 기지국이 전파 도달 거리가 1인 5g 기지국으로 바뀔 경우 모든 아파트에 전파를
전달할 수 없습니다. (전파의 도달 거리가 W일 땐, 기지국이 설치된 아파트를 기준으로 전파를 양쪽으로 W만큼 전달할 수 있습니다.)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 4em; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: roboto;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;초기&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;에,
1, 2, 6, 7, 8, 9번째 아파트에는 전파가 전달되지 않습니다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 4em; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: roboto;&quot;&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 437px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/237A0E4159205ACC13&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F237A0E4159205ACC13&quot; width=&quot;437&quot; height=&quot;89&quot; filename=&quot;그림1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;1, 7,
9번째 아파트 옥상에 기지국을 설치할 경우, 모든 아파트에 전파를 전달할 수 있습니다.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 굴림;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 굴림;&quot;&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 435px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/22734A3D59205AF008&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F22734A3D59205AF008&quot; width=&quot;435&quot; height=&quot;88&quot; filename=&quot;그림2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;3개의
아파트보다 더 많은 아파트 옥상에 기지국을 설치할 경우에도 모든 아파트에 전파를 전달할 수 있습니다.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;이때, 우리는 기지국을&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-weight: bold; color: rgb(166, 166, 166);&quot;&gt;최소로 설치&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: roboto;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;하면서 모든 아파트에 전파를 전달하려고 합니다. 위의 예시에선 최소 3개의
아파트 &lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;옥상&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;에 기지국을 설치해야 모든 아파트에 전파를 전달할 수 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;아파트의 개수 N, 현재 기지국이 설치된 아파트의 번호가 담긴 1차원 배열
stations, 전파의 도달 거리 W가 매개변수로 주어질 때, 모든 아파트에 전파를 전달하기 위해 증설해야 할 기지국 개수의 최솟값을 &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;리턴하는&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
solution 함수를 완성해주세요&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;제한사항&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: roboto;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;N:
20,000,000 이하의 자연수&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;stations의
크기: 10,000 이하의 자연수&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;stations는
오름차순으로 정렬되어 있고, 배열에 담긴 수는 N보다 같거나 작은 자연수입니다.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;W:
10,000 이하의 자연수&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;시간제한:
7ms&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-indent: -0.38in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: roboto;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;line-height: normal; margin-top: 0pt; margin-right: 0in; margin-bottom: 0pt; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin-top: 0pt; margin-right: 0in; margin-bottom: 0pt; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); font-weight: bold; vertical-align: baseline;&quot;&gt;입출력 예&lt;/span&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); font-weight: bold; vertical-align: baseline;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin-top: 0pt; margin-right: 0in; margin-bottom: 0pt; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: Arial; color: rgb(166, 166, 166); font-weight: bold; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
 &lt;/span&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;553&quot; style=&quot;border-collapse:
 collapse;width:332pt;mso-yfti-tbllook:1536&quot;&gt;
 &lt;colgroup&gt;&lt;col width=&quot;138&quot; span=&quot;4&quot; style=&quot;mso-width-source:userset;width:83pt&quot;&gt;&lt;/colgroup&gt;&lt;tbody&gt;&lt;tr&gt;
  &lt;td class=&quot;oa1&quot; width=&quot;138&quot; style=&quot;width:83pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;N&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa1&quot; width=&quot;138&quot; style=&quot;width:83pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;stations&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa1&quot; width=&quot;138&quot; style=&quot;width: 110px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;W&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa1&quot; width=&quot;138&quot; style=&quot;width: 111px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: bottom;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;answer&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td class=&quot;oa2&quot; width=&quot;138&quot; style=&quot;width:83pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;11&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa2&quot; width=&quot;138&quot; style=&quot;width:83pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;[4,
  11]&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa2&quot; width=&quot;138&quot; style=&quot;width: 110px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;1&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa2&quot; width=&quot;138&quot; style=&quot;width: 111px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;3&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=&quot;51&quot; style=&quot;mso-height-source:userset;height:30.79pt&quot;&gt;
  &lt;td height=&quot;51&quot; class=&quot;oa3&quot; width=&quot;138&quot; style=&quot;height:30.79pt;width:83pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;16&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa3&quot; width=&quot;138&quot; style=&quot;width:83pt&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;[9]&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa3&quot; width=&quot;138&quot; style=&quot;width: 110px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;2&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;oa3&quot; width=&quot;138&quot; style=&quot;width: 111px;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;p style=&quot;margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; direction: ltr; unicode-bidi: embed; vertical-align: top;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166);&quot;&gt;3&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
  &lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: 돋움; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 14pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); font-weight: bold; vertical-align: baseline;&quot;&gt;입출력 예 설명&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: 돋움; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 12pt; font-family: roboto; color: rgb(120, 144, 156); vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;입출력 예 #1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
문제의 예시와 같습니다&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;입출력 예 #2&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;초기에, 1~6, 12~16번째 아파트에는 전파가 전달되지 않습니다.&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt; text-indent: 0in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;3, 6, 14번째 아파트 옥상에 기지국을 설치할 경우 모든 아파트에
전파를 전달할 수 있습니다.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 453px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/246CA64359205BE92C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F246CA64359205BE92C&quot; width=&quot;453&quot; height=&quot;61&quot; filename=&quot;그림3.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 453px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/242B2A4359205BE927&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F242B2A4359205BE927&quot; width=&quot;453&quot; height=&quot;65&quot; filename=&quot;그림4.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in 0pt 2em; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(166, 166, 166); vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-size: 14pt; font-weight: bold; text-indent: 0in;&quot;&gt;풀이&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;맑은 고딕&amp;quot;; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;왼쪽부터 탐색하다가 전파가 닿지 않는 공간이 나왔을 때, 가능한&amp;nbsp;오른쪽에 배치하는게 가장 최적의 해입니다. (그리디)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;따라서 n 위치가 전파가 닿지 않는다면 n+w에 기지국을 설치하고 n+w+w+1부터 탐색을 계속해 나가는 것이 최적 입니다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;s+w 위치에 기지국이 있다면 , 기지국을 설치할 수 있는 가장 오른쪽에 기지국을 설치합니다.&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;int solution(int n, vector&amp;lt;int&amp;gt; stations, int w)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;{ &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; int state = 0;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; int left = 1,count=0;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; while(true){&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //find left&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(state&amp;lt;stations.size() &amp;amp;&amp;amp; left &amp;gt;= stations[state] - w)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; left = stations[state]+w+1;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; state++; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else{&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int newleft = left+w; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;if( (state&amp;lt;=(int)stations.size()-2) &amp;amp;&amp;amp; newleft&amp;gt;=stations[state+1]-w )newleft = stations[state+1]-w-1; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt; &amp;nbsp; &amp;nbsp;left=newleft+w+1;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count++;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(left&amp;gt; n)break; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;return count;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;}&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;font color=&quot;#a6a6a6&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class=&quot;O0&quot; style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: &amp;quot;맑은 고딕&amp;quot;; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: rgb(166, 166, 166); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; margin: 0pt 0in; text-indent: 0in; direction: ltr; unicode-bidi: embed; vertical-align: baseline; word-break: keep-all;&quot;&gt;&lt;/p&gt;</description>
      <category>알고리즘</category>
      <author>quantdave</author>
      <guid isPermaLink="true">https://healthydeveloper.tistory.com/39</guid>
      <comments>https://healthydeveloper.tistory.com/39#entry39comment</comments>
      <pubDate>Sun, 21 May 2017 00:14:08 +0900</pubDate>
    </item>
  </channel>
</rss>