<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>문자열 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<atom:link href="https://lycos7560.com/tag/%EB%AC%B8%EC%9E%90%EC%97%B4/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Mon, 10 Mar 2025 10:45:37 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://lycos7560.com/wp-content/uploads/2022/11/cropped-cropped-cropped-log-1-150x150-1-80x80.png</url>
	<title>문자열 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>백준 9935번 (문자열 폭발, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-9935%eb%b2%88-%eb%ac%b8%ec%9e%90%ec%97%b4-%ed%8f%ad%eb%b0%9c-c-baekjoon/39929/</link>
					<comments>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-9935%eb%b2%88-%eb%ac%b8%ec%9e%90%ec%97%b4-%ed%8f%ad%eb%b0%9c-c-baekjoon/39929/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Thu, 13 Feb 2025 10:37:52 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[9935]]></category>
		<category><![CDATA[9935번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[FRULA]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[문자열 폭발]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 9935번]]></category>
		<category><![CDATA[스택]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[자료 구조]]></category>
		<category><![CDATA[자료구조]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=39929</guid>

					<description><![CDATA[<p>문자열 폭발 https://www.acmicpc.net/problem/9935 시간 제한 메모리 제한 제출 정답 맞힌 사람 정답 비율 2 초 (추가 시간 없음) 128 MB 97727 27262 19242 27.023% 문제 상근이는 문자열에 폭발 문자열을 심어 놓았다. 폭발 문자열이 폭발하면 그 문자는 문자열에서 사라지며, 남은 문자열은 합쳐지게 된다. 폭발은 다음과 같은 과정으로 진행된다. 상근이는 모든 폭발이 끝난 후에 어떤 문자열이 남는지 [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-9935%eb%b2%88-%eb%ac%b8%ec%9e%90%ec%97%b4-%ed%8f%ad%eb%b0%9c-c-baekjoon/39929/">백준 9935번 (문자열 폭발, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">문자열 폭발 <img decoding="async" width="30" height="38" class="wp-image-37904" style="width: 30px;" src="https://lycos7560.com/wp-content/uploads/2024/03/Gold_4.jpg" alt="" srcset="https://lycos7560.com/wp-content/uploads/2024/03/Gold_4.jpg 400w, https://lycos7560.com/wp-content/uploads/2024/03/Gold_4-234x300.jpg 234w" sizes="(max-width: 30px) 100vw, 30px" /></h2>



<p><a href="https://www.acmicpc.net/problem/9935" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/9935</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">2 초 (추가 시간 없음)</td><td class="has-text-align-left" data-align="left">128 MB</td><td class="has-text-align-left" data-align="left">97727</td><td class="has-text-align-left" data-align="left">27262</td><td class="has-text-align-left" data-align="left">19242</td><td class="has-text-align-left" data-align="left">27.023%</td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">문제</h3>



<p>상근이는 문자열에 폭발 문자열을 심어 놓았다. </p>



<p>폭발 문자열이 폭발하면 그 문자는 문자열에서 사라지며, 남은 문자열은 합쳐지게 된다.</p>



<p>폭발은 다음과 같은 과정으로 진행된다.</p>



<ul class="wp-block-list">
<li>문자열이 폭발 문자열을 포함하고 있는 경우에, 모든 폭발 문자열이 폭발하게 된다. <br>남은 문자열을 순서대로 이어 붙여 새로운 문자열을 만든다.</li>



<li>새로 생긴 문자열에 폭발 문자열이 포함되어 있을 수도 있다.</li>



<li>폭발은 폭발 문자열이 문자열에 없을 때까지 계속된다.</li>
</ul>



<p>상근이는 모든 폭발이 끝난 후에 어떤 문자열이 남는지 구해보려고 한다. </p>



<p>남아있는 문자가 없는 경우가 있다. 이때는 &#8220;FRULA&#8221;를 출력한다.</p>



<p>폭발 문자열은 같은 문자를 두 개 이상 포함하지 않는다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">입력</h3>



<p>첫째 줄에 문자열이 주어진다. 문자열의 길이는 1보다 크거나 같고, 1,000,000보다 작거나 같다.</p>



<p>둘째 줄에 폭발 문자열이 주어진다. 길이는 1보다 크거나 같고, 36보다 작거나 같다.</p>



<p>두 문자열은 모두 알파벳 소문자와 대문자, 숫자 0, 1, &#8230;, 9로만 이루어져 있다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">출력</h3>



<p>첫째 줄에 모든 폭발이 끝난 후 남은 문자열을 출력한다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 입력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mirkovC4nizCC44
C4</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 출력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mirkovniz</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 입력 2</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">12ab112ab2ab
12ab</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 출력 2</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">FRULA</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">출처</h3>



<p><a href="https://www.acmicpc.net/category/45">Contest</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/17">Croatian Open Competition in Informatics</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/272">COCI 2013/2014</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/detail/1230">Contest #5</a>&nbsp;3번</p>



<ul class="wp-block-list">
<li>문제를 번역한 사람: <a href="https://www.acmicpc.net/user/baekjoon">baekjoon</a></li>



<li>문제의 오타를 찾은 사람: <a href="https://www.acmicpc.net/user/chan4928">chan4928</a></li>



<li>시간 제한을 수정한 사람: <a href="https://www.acmicpc.net/user/jh05013">jh05013</a></li>



<li>데이터를 추가한 사람: <a href="https://www.acmicpc.net/user/limequeen">limequeen</a>, <a href="https://www.acmicpc.net/user/mrseos">mrseos</a></li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">알고리즘 분류</h3>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/175" target="_blank" rel="noreferrer noopener">자료 구조</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/71" target="_blank" rel="noreferrer noopener">스택</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h3 class="wp-block-heading">통과된 코드</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>
#include &lt;string>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    string S, C;
    cin >> S >> C;

    string Res; 

    for (char ch : S)
    {
        Res.push_back(ch);

        // Res의 마지막 부분이 c와 같은지 확인
        if (Res.size() >= C.size() &amp;&amp; Res.substr(Res.size() - C.size()) == C)
        {
            // 문자열에서 폭발 문자열 제거
            Res.erase(Res.size() - C.size()); 
        }
    }

    cout &lt;&lt; (Res.empty() ? "FRULA" : Res);

    return 0;
}
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>예시 </strong><br><code>ch = 'm'</code>: <code>Res = "m"</code><br><code>ch = 'i'</code>: <code>Res = "mi"</code><br><code>ch = 'r'</code>: <code>Res = "mir"</code><br><code>ch = 'k'</code>: <code>Res = "mirk"</code><br><code>ch = 'o'</code>: <code>Res = "mirko"</code><br><code>ch = 'v'</code>: <code>Res = "mirkov"</code><br><code>ch = 'C'</code>: <code>Res = "mirkovC"</code><br><code>ch = '4'</code>: <code>Res = "mirkovC4"</code><br><code>ch = 'n'</code>: <code>Res = "mirkovn"</code><br><code>ch = 'i'</code>: <code>Res = "mirkovni"</code><br><code>ch = 'z'</code>: <code>Res = "mirkoviz"</code><br><code>ch = 'C'</code>: <code>Res = "mirkovnizC"</code><br><code>ch = 'C'</code>: <code>Res = "mirkovnizCC"</code><br><code>ch = '4'</code>: <code>Res = "mirkovnizCC4"</code><br><code>ch = '4'</code>: <code>Res = "mirkovnizC4"</code><br><em><strong>Res = &#8220;mirkovniz&#8221;</strong></em></p>



<p></p>
<p>The post <a href="https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-9935%eb%b2%88-%eb%ac%b8%ec%9e%90%ec%97%b4-%ed%8f%ad%eb%b0%9c-c-baekjoon/39929/">백준 9935번 (문자열 폭발, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-9935%eb%b2%88-%eb%ac%b8%ec%9e%90%ec%97%b4-%ed%8f%ad%eb%b0%9c-c-baekjoon/39929/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>백준 28702번 (FizzBuzz, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-28702%eb%b2%88-fizzbuzz-c-baekjoon/39926/</link>
					<comments>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-28702%eb%b2%88-fizzbuzz-c-baekjoon/39926/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Tue, 24 Dec 2024 09:35:33 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[28702]]></category>
		<category><![CDATA[28702번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[Buzz]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[Fizz]]></category>
		<category><![CDATA[FizzBuzz]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 28702번]]></category>
		<category><![CDATA[수학]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=39926</guid>

					<description><![CDATA[<p>FizzBuzz https://www.acmicpc.net/problem/28702 시간 제한 메모리 제한 제출 정답 맞힌 사람 정답 비율 0.5 초 1024 MB 13102 8022 7260 61.593% 문제 FizzBuzz 문제는 i=1,2,⋯ 에 대해 다음 규칙에 따라 문자열을 한 줄에 하나씩 출력하는 문제입니다. FizzBuzz 문제에서 연속으로 출력된 세 개의 문자열이 주어집니다. 이때, 이 세 문자열 다음에 올 문자열은 무엇일까요? 입력 FizzBuzz 문제에서 연속으로 출력된 세 [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-28702%eb%b2%88-fizzbuzz-c-baekjoon/39926/">백준 28702번 (FizzBuzz, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">FizzBuzz <img decoding="async" width="30" height="38" class="wp-image-37923" style="width: 30px;" src="https://lycos7560.com/wp-content/uploads/2024/03/Bronze_1.jpg" alt="" srcset="https://lycos7560.com/wp-content/uploads/2024/03/Bronze_1.jpg 1250w, https://lycos7560.com/wp-content/uploads/2024/03/Bronze_1-234x300.jpg 234w, https://lycos7560.com/wp-content/uploads/2024/03/Bronze_1-768x983.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/03/Bronze_1-1200x1536.jpg 1200w" sizes="(max-width: 30px) 100vw, 30px" /></h2>



<p><a href="https://www.acmicpc.net/problem/28702" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/28702</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">0.5 초</td><td class="has-text-align-left" data-align="left">1024 MB</td><td class="has-text-align-left" data-align="left">13102</td><td class="has-text-align-left" data-align="left">8022</td><td class="has-text-align-left" data-align="left">7260</td><td class="has-text-align-left" data-align="left">61.593%</td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">문제</h3>



<p>FizzBuzz 문제는 i=1,2,⋯ 에 대해 다음 규칙에 따라 문자열을 한 줄에 하나씩 출력하는 문제입니다.</p>



<ul class="wp-block-list">
<li> i가 3의 배수이면서 5의 배수이면 “<code>FizzBuzz</code>”를 출력합니다.</li>



<li> i가 3의 배수이지만 5의 배수가 아니면 “<code>Fizz</code>”를 출력합니다.</li>



<li> i가 3의 배수가 아니지만 5의 배수이면 “<code>Buzz</code>”를 출력합니다.</li>



<li> i가 3의 배수도 아니고 5의 배수도 아닌 경우 i를 그대로 출력합니다.</li>
</ul>



<p>FizzBuzz 문제에서 연속으로 출력된 세 개의 문자열이 주어집니다. </p>



<p>이때, 이 세 문자열 다음에 올 문자열은 무엇일까요?</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">입력</h3>



<p>FizzBuzz 문제에서 연속으로 출력된 세 개의 문자열이 한 줄에 하나씩 주어집니다. </p>



<p>각 문자열의 길이는 8 이하입니다. 입력이 항상 FizzBuzz 문제에서 연속으로 출력된 세 개의 문자열에 대응됨이 보장됩니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">출력</h3>



<p>연속으로 출력된 세 개의 문자열 다음에 올 문자열을 출력하세요. </p>



<p>여러 문자열이 올 수 있는 경우, 아무거나 하나 출력하세요.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 입력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Fizz
Buzz
11</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 출력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Fizz</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 입력 2</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">980803
980804
FizzBuzz</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">예제 출력 2</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">980806</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">힌트</h3>



<p>FizzBuzz 문제의 i = 1 ,⋯, 20에 대한 출력은 다음과 같습니다.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">출처</h3>



<p><a href="https://www.acmicpc.net/category/45" target="_blank" rel="noreferrer noopener">Contest</a> > <a href="https://www.acmicpc.net/category/859" target="_blank" rel="noreferrer noopener">solved.ac</a> > <a href="https://www.acmicpc.net/category/detail/3707" target="_blank" rel="noreferrer noopener">solved.ac Grand Arena #2</a> B번</p>



<ul class="wp-block-list">
<li>문제를 검수한 사람: <a href="https://www.acmicpc.net/user/ai4youej" target="_blank" rel="noreferrer noopener">ai4youej</a>, <a href="https://www.acmicpc.net/user/bnb2011" target="_blank" rel="noreferrer noopener">bnb2011</a>, <a href="https://www.acmicpc.net/user/chansol" target="_blank" rel="noreferrer noopener">chansol</a>, <a href="https://www.acmicpc.net/user/cologne" target="_blank" rel="noreferrer noopener">cologne</a>, <a href="https://www.acmicpc.net/user/cozyyg" target="_blank" rel="noreferrer noopener">cozyyg</a>, <a href="https://www.acmicpc.net/user/gs18115" target="_blank" rel="noreferrer noopener">gs18115</a>, <a href="https://www.acmicpc.net/user/havana723" target="_blank" rel="noreferrer noopener">havana723</a>, <a href="https://www.acmicpc.net/user/jh05013" target="_blank" rel="noreferrer noopener">jh05013</a>, <a href="https://www.acmicpc.net/user/moonrabbit2" target="_blank" rel="noreferrer noopener">moonrabbit2</a>, <a href="https://www.acmicpc.net/user/pichulia" target="_blank" rel="noreferrer noopener">pichulia</a>, <a href="https://www.acmicpc.net/user/shiftpsh" target="_blank" rel="noreferrer noopener">shiftpsh</a></li>



<li>문제를 만든 사람: <a href="https://www.acmicpc.net/user/cologne">cologne</a>, <a href="https://www.acmicpc.net/user/solvedac">solvedac</a></li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">알고리즘 분류</h3>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/124" target="_blank" rel="noreferrer noopener">수학</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h3 class="wp-block-heading">통과된 코드</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>
#include &lt;string>

using namespace std;

string Input[3];

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    for (int i = 0; i &lt; 3; i++)
        cin >> Input[i];

    for (int i = 0; i &lt; 3; i++) {
        if (Input[i][0] == 'F' || Input[i][0] == 'B')
            continue;

        int Num = stoi(Input[i]) + 3 - i;
        if (Num % 15 == 0) cout &lt;&lt; "FizzBuzz";
        else if (Num % 5 == 0) cout &lt;&lt; "Buzz";
        else if (Num % 3 == 0) cout &lt;&lt; "Fizz";
        else cout &lt;&lt; Num;
        return 0;
    }

    cout &lt;&lt; "FizzBuzz";

    return 0;
}
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="960" height="76" src="https://lycos7560.com/wp-content/uploads/2025/03/image-11.png" alt="" class="wp-image-39927" srcset="https://lycos7560.com/wp-content/uploads/2025/03/image-11.png 960w, https://lycos7560.com/wp-content/uploads/2025/03/image-11-300x24.png 300w, https://lycos7560.com/wp-content/uploads/2025/03/image-11-768x61.png 768w" sizes="(max-width: 960px) 100vw, 960px" /></figure>
<p>The post <a href="https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-28702%eb%b2%88-fizzbuzz-c-baekjoon/39926/">백준 28702번 (FizzBuzz, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-28702%eb%b2%88-fizzbuzz-c-baekjoon/39926/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>백준 2711번 (오타맨 고창영, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-2711%eb%b2%88-%ec%98%a4%ed%83%80%eb%a7%a8-%ea%b3%a0%ec%b0%bd%ec%98%81-c-baekjoon/37858/</link>
					<comments>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-2711%eb%b2%88-%ec%98%a4%ed%83%80%eb%a7%a8-%ea%b3%a0%ec%b0%bd%ec%98%81-c-baekjoon/37858/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Thu, 22 Feb 2024 15:52:58 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[2711]]></category>
		<category><![CDATA[2711번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[Bronze]]></category>
		<category><![CDATA[Bronze2]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[구현]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 2711]]></category>
		<category><![CDATA[백준 2711번]]></category>
		<category><![CDATA[브론즈2]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[오타맨 고창영]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=37858</guid>

					<description><![CDATA[<p>백준 2711번 '오타맨 고창영' 문제에 대한 글입니다. 단순한 구현 문제입니다. (This is about the issue of '오타맨 고창영' BaekJoon No. 2711. It's a simple implementation question.)</p>
<p>The post <a href="https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-2711%eb%b2%88-%ec%98%a4%ed%83%80%eb%a7%a8-%ea%b3%a0%ec%b0%bd%ec%98%81-c-baekjoon/37858/">백준 2711번 (오타맨 고창영, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-5698326622209671"
     data-ad-slot="5078714126"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-75779d84      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#오타맨-고창영" class="uagb-toc-link__trigger">오타맨 고창영</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">오타맨 고창영 <img decoding="async" width="30" height="38" class="wp-image-37893" style="width: 30px;" src="https://lycos7560.com/wp-content/uploads/2024/02/Bronze_2.jpg" alt="" srcset="https://lycos7560.com/wp-content/uploads/2024/02/Bronze_2.jpg 1250w, https://lycos7560.com/wp-content/uploads/2024/02/Bronze_2-234x300.jpg 234w, https://lycos7560.com/wp-content/uploads/2024/02/Bronze_2-768x983.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/02/Bronze_2-1200x1536.jpg 1200w" sizes="(max-width: 30px) 100vw, 30px" /></h1>



<p><a href="https://www.acmicpc.net/problem/2711" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/2711</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">1 초</td><td class="has-text-align-left" data-align="left">128 MB</td><td class="has-text-align-left" data-align="left">9891</td><td class="has-text-align-left" data-align="left">6611</td><td class="has-text-align-left" data-align="left">5977</td><td class="has-text-align-left" data-align="left">68.599%</td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">문제</h3>



<p>고창영은 맨날 오타를 낸다. 창영이가 오타를 낸 문장과 오타를 낸 위치가 주어졌을 때, 오타를 지운 문자열을 출력하는 프로그램을 작성하시오.</p>



<p>창영이는 오타를 반드시 1개만 낸다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">입력</h3>



<p>첫째 줄에 테스트 케이스의 개수 T(1&lt;=T&lt;=1,000)가 주어진다. </p>



<p>각 테스트 케이스는 한 줄로 구성되어 있다. 첫 숫자는 창영이가 오타를 낸 위치이고, 두 번째 문자열은 창영이가 친 문자열이다. </p>



<p>문자열의 가장 첫 문자는 1번째 문자이고, 문자열의 길이는 80을 넘지 않고, 대문자로만 이루어져 있다. </p>



<p>오타를 낸 위치는 문자열 길이보다 작거나 같다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">출력</h3>



<p>각 테스트 케이스에 대해 오타를 지운 문자열을 출력한다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">MISPELL
ROGRAMMING
CONTES
BALOON</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">출처</h3>



<p><a href="https://www.acmicpc.net/category/1" target="_blank" rel="noreferrer noopener">ICPC</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/7" target="_blank" rel="noreferrer noopener">Regionals</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/8" target="_blank" rel="noreferrer noopener">North America</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/9" target="_blank" rel="noreferrer noopener">Greater New York Region</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/detail/9" target="_blank" rel="noreferrer noopener">2007 Greater New York Programming Contest</a>&nbsp;A번</p>



<ul class="wp-block-list">
<li>문제를 번역한 사람:&nbsp;<a href="https://www.acmicpc.net/user/baekjoon" target="_blank" rel="noreferrer noopener">baekjoon</a></li>



<li>잘못된 데이터를 찾은 사람:&nbsp;<a href="https://www.acmicpc.net/user/occidere" target="_blank" rel="noreferrer noopener">occidere</a></li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">알고리즘 분류</h3>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/102" target="_blank" rel="noreferrer noopener">구현</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<p>단순한 구현 문제입니다. </p>



<p>특정 인덱스의 문자열을 어떤 방식으로 출력에서 제외할 것 인가를 구현하는 문제입니다.</p>



<p>아래의 코드는 주어진 문자열을 순회하면서 오타의 인덱스인지 확인 후 출력하는 코드입니다.</p>



<p> </p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-large-font-size">통과된 코드</h2>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>

using namespace std;

int main()
{
	int _TestCase, _TypingError;

	cin >> _TestCase;

	while (_TestCase--) 
	{
		string _Str;
		cin >> _TypingError >> _Str;
		int _l = _Str.length(); 
		_TypingError--;
		for (int i = 0; i &lt; _l; i++) 
		{
			if (i == _TypingError)
				continue;

			cout &lt;&lt; _Str[i];

		}

		cout &lt;&lt; '\n';
	}

	return 0;
}</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="967" height="84" src="https://lycos7560.com/wp-content/uploads/2024/02/image.png" alt="" class="wp-image-37859" srcset="https://lycos7560.com/wp-content/uploads/2024/02/image.png 967w, https://lycos7560.com/wp-content/uploads/2024/02/image-300x26.png 300w, https://lycos7560.com/wp-content/uploads/2024/02/image-768x67.png 768w" sizes="(max-width: 967px) 100vw, 967px" /></figure>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="autorelaxed"
     data-ad-client="ca-pub-5698326622209671"
     data-ad-slot="4386247858"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-2711%eb%b2%88-%ec%98%a4%ed%83%80%eb%a7%a8-%ea%b3%a0%ec%b0%bd%ec%98%81-c-baekjoon/37858/">백준 2711번 (오타맨 고창영, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/%eb%b0%b1%ec%a4%80-2711%eb%b2%88-%ec%98%a4%ed%83%80%eb%a7%a8-%ea%b3%a0%ec%b0%bd%ec%98%81-c-baekjoon/37858/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>백준 1316번 (그룹 단어 체커, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-1316%eb%b2%88-%ea%b7%b8%eb%a3%b9-%eb%8b%a8%ec%96%b4-%ec%b2%b4%ec%bb%a4-c-baekjoon/35608/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-1316%eb%b2%88-%ea%b7%b8%eb%a3%b9-%eb%8b%a8%ec%96%b4-%ec%b2%b4%ec%bb%a4-c-baekjoon/35608/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Thu, 29 Jun 2023 19:20:19 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[1316]]></category>
		<category><![CDATA[1316번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[구현]]></category>
		<category><![CDATA[그룹 단어 체커]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 1316]]></category>
		<category><![CDATA[백준 1316번]]></category>
		<category><![CDATA[순서]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=35608</guid>

					<description><![CDATA[<p>그룹 단어 체커 https://www.acmicpc.net/problem/1316 시간 제한 메모리 제한 제출 정답 맞힌 사람 정답 비율 2 초 128 MB 132279 68998 56934 52.549% 문제 그룹 단어란 단어에 존재하는 모든 문자에 대해서, 각 문자가 연속해서 나타나는 경우만을 말한다. 예를 들면, ccazzzzbb는 c, a, z, b가 모두 연속해서 나타나고, kin도 k, i, n이 연속해서 나타나기 때문에 그룹 단어이지만, [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-1316%eb%b2%88-%ea%b7%b8%eb%a3%b9-%eb%8b%a8%ec%96%b4-%ec%b2%b4%ec%bb%a4-c-baekjoon/35608/">백준 1316번 (그룹 단어 체커, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-3b5b5ebe      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#그룹-단어-체커" class="uagb-toc-link__trigger">그룹 단어 체커</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">그룹 단어 체커</h1>



<p class="has-medium-font-size"><a href="https://www.acmicpc.net/problem/1316" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/1316</a></p>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">2 초</td><td class="has-text-align-left" data-align="left">128 MB</td><td class="has-text-align-left" data-align="left">132279</td><td class="has-text-align-left" data-align="left">68998</td><td class="has-text-align-left" data-align="left">56934</td><td class="has-text-align-left" data-align="left">52.549%</td></tr></tbody></table></figure>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">문제</h3>



<p>그룹 단어란 단어에 존재하는 모든 문자에 대해서, </p>



<p>각 문자가 연속해서 나타나는 경우만을 말한다. </p>



<p>예를 들면, ccazzzzbb는 c, a, z, b가 모두 연속해서 나타나고, </p>



<p>kin도 k, i, n이 연속해서 나타나기 때문에 그룹 단어이지만, </p>



<p>aabbbccb는 b가 떨어져서 나타나기 때문에 그룹 단어가 아니다.</p>



<p>단어 N개를 입력으로 받아 그룹 단어의 개수를 출력하는 프로그램을 작성하시오.</p>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">입력</h3>



<p>첫째 줄에 단어의 개수 N이 들어온다. </p>



<p>N은 100보다 작거나 같은 자연수이다. </p>



<p>둘째 줄부터 N개의 줄에 단어가 들어온다. </p>



<p>단어는 알파벳 소문자로만 되어있고 중복되지 않으며, 길이는 최대 100이다.</p>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">출력</h3>



<p>첫째 줄에 그룹 단어의 개수를 출력한다.</p>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">3
happy
new
year</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 1</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">3</pre>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 2</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">4
aba
abab
abcabc
a</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 2</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1</pre>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 3</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">5
ab
aa
aca
ba
bb</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 3</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">4</pre>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 4</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">2
yzyzy
zyzyz</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 4</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">0</pre>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 5</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1
z</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 5</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1</pre>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 입력 6</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">9
aaa
aaazbz
babb
aazz
azbz
aabbaa
abacc
aba
zzaz</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">예제 출력 6</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">2</pre>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">출처</h3>



<ul class="wp-block-list">
<li>문제를 번역한 사람:&nbsp;<a href="https://www.acmicpc.net/user/baekjoon" target="_blank" rel="noreferrer noopener">baekjoon</a></li>



<li>데이터를 추가한 사람:&nbsp;<a href="https://www.acmicpc.net/user/djm03178" target="_blank" rel="noreferrer noopener">djm03178</a>,&nbsp;<a href="https://www.acmicpc.net/user/jh05013" target="_blank" rel="noreferrer noopener">jh05013</a></li>



<li>문제의 오타를 찾은 사람:&nbsp;<a href="https://www.acmicpc.net/user/joonas" target="_blank" rel="noreferrer noopener">joonas</a></li>
</ul>



<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading has-large-font-size">알고리즘 분류</h3>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/102" target="_blank" rel="noreferrer noopener">구현</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<figure class="wp-block-image size-full"><img decoding="async" width="1452" height="596" src="https://lycos7560.com/wp-content/uploads/2023/06/image-45.png" alt="" class="wp-image-35614" srcset="https://lycos7560.com/wp-content/uploads/2023/06/image-45.png 1452w, https://lycos7560.com/wp-content/uploads/2023/06/image-45-300x123.png 300w, https://lycos7560.com/wp-content/uploads/2023/06/image-45-768x315.png 768w" sizes="(max-width: 1452px) 100vw, 1452px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-large-font-size">통과된 코드</h2>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>
#include &lt;vector>
using namespace std;
int _N, _Res;
string _Str;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin >> _N;
	for (int i = 0; i &lt; _N; i++) {
		vector&lt;int> _Arr[26];
		cin >> _Str;
		for (int i = 0; i &lt; _Str.length(); i++)
			_Arr[_Str[i] - 'a'].push_back(i);
		bool _Check = true;
		for (int i = 0; i &lt; 26 &amp;&amp; _Check; i++) {
			if (_Arr[i].size() &lt;= 1) continue;
			for (int j = 0; j &lt; _Arr[i].size() - 1; j++)
				if (_Arr[i][j + 1] - _Arr[i][j] >= 2)
					_Check = false;
		}
		if (_Check) 
			_Res++;
	}
	cout &lt;&lt; _Res;
} </pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/06/image-46.png" alt="" class="wp-image-35616" width="1320" height="53" srcset="https://lycos7560.com/wp-content/uploads/2023/06/image-46.png 1206w, https://lycos7560.com/wp-content/uploads/2023/06/image-46-300x12.png 300w, https://lycos7560.com/wp-content/uploads/2023/06/image-46-768x31.png 768w" sizes="(max-width: 1320px) 100vw, 1320px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-1316%eb%b2%88-%ea%b7%b8%eb%a3%b9-%eb%8b%a8%ec%96%b4-%ec%b2%b4%ec%bb%a4-c-baekjoon/35608/">백준 1316번 (그룹 단어 체커, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-1316%eb%b2%88-%ea%b7%b8%eb%a3%b9-%eb%8b%a8%ec%96%b4-%ec%b2%b4%ec%bb%a4-c-baekjoon/35608/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Programmers 72410 신규 아이디 추천 [2021 KAKAO BLIND RECRUITMENT]</title>
		<link>https://lycos7560.com/cpp/programmers/programmers-72410-%ec%8b%a0%ea%b7%9c-%ec%95%84%ec%9d%b4%eb%94%94-%ec%b6%94%ec%b2%9c-2021-kakao-blind-recruitment/34792/</link>
					<comments>https://lycos7560.com/cpp/programmers/programmers-72410-%ec%8b%a0%ea%b7%9c-%ec%95%84%ec%9d%b4%eb%94%94-%ec%b6%94%ec%b2%9c-2021-kakao-blind-recruitment/34792/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sun, 14 May 2023 21:25:12 +0000</pubDate>
				<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[programmers]]></category>
		<category><![CDATA[[2021 KAKAO BLIND RECRUITMENT]]]></category>
		<category><![CDATA[<string>]]></category>
		<category><![CDATA[2021 KAKAO BLIND RECRUITMENT]]></category>
		<category><![CDATA[72410]]></category>
		<category><![CDATA[72410번]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[Programmers 72410]]></category>
		<category><![CDATA[Programmers 72410번]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[신규 아이디 추천]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<category><![CDATA[파싱]]></category>
		<category><![CDATA[프로그래머스]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=34792</guid>

					<description><![CDATA[<p>Programmers 72410번 '신규 아이디 추천' 문제에 대한 글입니다. (This article is about the 'New ID Recommendation' problem in Programmers Number 72410) [2021 KAKAO BLIND RECRUITMENT]</p>
<p>The post <a href="https://lycos7560.com/cpp/programmers/programmers-72410-%ec%8b%a0%ea%b7%9c-%ec%95%84%ec%9d%b4%eb%94%94-%ec%b6%94%ec%b2%9c-2021-kakao-blind-recruitment/34792/">Programmers 72410 신규 아이디 추천 [2021 KAKAO BLIND RECRUITMENT]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-8d2b0414      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#신규-아이디-추천" class="uagb-toc-link__trigger">신규 아이디 추천</a><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a><li class="uagb-toc__list"><a href="#더-효율적인-코드" class="uagb-toc-link__trigger">더 효율적인 코드</a></ol>					</div>
									</div>
				</div>
			


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">신규 아이디 추천</h1>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><a href="https://school.programmers.co.kr/learn/courses/30/lessons/72410" target="_blank" rel="noreferrer noopener">https://school.programmers.co.kr/learn/courses/30/lessons/72410</a></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">카카오에 입사한 신입 개발자 <code>네오</code>는 &#8220;카카오계정개발팀&#8221;에 배치되어, </p>



<p class="has-medium-font-size">카카오 서비스에 가입하는 유저들의 아이디를 생성하는 업무를 담당하게 되었습니다. </p>



<p class="has-medium-font-size">&#8220;네오&#8221;에게 주어진 첫 업무는 새로 가입하는 유저들이 카카오 아이디 규칙에 맞지 않는 아이디를 입력했을 때, </p>



<p class="has-medium-font-size">입력된 아이디와 유사하면서 규칙에 맞는 아이디를 추천해주는 프로그램을 개발하는 것입니다.</p>



<p class="has-medium-font-size">다음은 카카오 아이디의 규칙입니다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li>아이디의 길이는 3자 이상 15자 이하여야 합니다.</li>



<li>아이디는 알파벳 소문자, 숫자, 빼기(<code>-</code>), 밑줄(<code>_</code>), 마침표(<code>.</code>) 문자만 사용할 수 있습니다.</li>



<li>단, 마침표(<code>.</code>)는 처음과 끝에 사용할 수 없으며 또한 연속으로 사용할 수 없습니다.</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">&#8220;네오&#8221;는 다음과 같이 7단계의 순차적인 처리 과정을 통해 </p>



<p class="has-medium-font-size">신규 유저가 입력한 아이디가 카카오 아이디 규칙에 맞는 지 검사하고 규칙에 맞지 않은 경우 </p>



<p class="has-medium-font-size">규칙에 맞는 새로운 아이디를 추천해 주려고 합니다.</p>



<p class="has-medium-font-size">신규 유저가 입력한 아이디가 <code>new_id</code> 라고 한다면,</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1단계 new_id의 모든 대문자를 대응되는 소문자로 치환합니다.
2단계 new_id에서 알파벳 소문자, 숫자, 빼기(-), 밑줄(_), 마침표(.)를 제외한 모든 문자를 제거합니다.
3단계 new_id에서 마침표(.)가 2번 이상 연속된 부분을 하나의 마침표(.)로 치환합니다.
4단계 new_id에서 마침표(.)가 처음이나 끝에 위치한다면 제거합니다.
5단계 new_id가 빈 문자열이라면, new_id에 "a"를 대입합니다.
6단계 new_id의 길이가 16자 이상이면, new_id의 첫 15개의 문자를 제외한 나머지 문자들을 모두 제거합니다.
     만약 제거 후 마침표(.)가 new_id의 끝에 위치한다면 끝에 위치한 마침표(.) 문자를 제거합니다.
7단계 new_id의 길이가 2자 이하라면, new_id의 마지막 문자를 new_id의 길이가 3이 될 때까지 반복해서 끝에 붙입니다.</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">예를 들어, new_id 값이 &#8220;&#8230;!@BaT#*..y.abcdefghijklm&#8221; 라면, </p>



<p class="has-medium-font-size">위 7단계를 거치고 나면 new_id는 아래와 같이 변경됩니다.</p>



<p class="has-medium-font-size">1단계 대문자 &#8216;B&#8217;와 &#8216;T&#8217;가 소문자 &#8216;b&#8217;와 &#8216;t&#8217;로 바뀌었습니다.<br><code>"...!@BaT#*..y.abcdefghijklm"</code>&nbsp;→&nbsp;<code>"...!@bat#*..y.abcdefghijklm"</code></p>



<p class="has-medium-font-size">2단계 &#8216;!&#8217;, &#8216;@&#8217;, &#8216;#&#8217;, &#8216;*&#8217; 문자가 제거되었습니다.<br><code>"...!@bat#*..y.abcdefghijklm"</code>&nbsp;→&nbsp;<code>"...bat..y.abcdefghijklm"</code></p>



<p class="has-medium-font-size">3단계 &#8216;&#8230;&#8217;와 &#8216;..&#8217; 가 &#8216;.&#8217;로 바뀌었습니다.<br><code>"...bat..y.abcdefghijklm"</code>&nbsp;→&nbsp;<code>".bat.y.abcdefghijklm"</code></p>



<p class="has-medium-font-size">4단계 아이디의 처음에 위치한 &#8216;.&#8217;가 제거되었습니다.<br><code>".bat.y.abcdefghijklm"</code>&nbsp;→&nbsp;<code>"bat.y.abcdefghijklm"</code></p>



<p class="has-medium-font-size">5단계 아이디가 빈 문자열이 아니므로 변화가 없습니다.<br><code>"bat.y.abcdefghijklm"</code>&nbsp;→&nbsp;<code>"bat.y.abcdefghijklm"</code></p>



<p class="has-medium-font-size">6단계 아이디의 길이가 16자 이상이므로, 처음 15자를 제외한 나머지 문자들이 제거되었습니다.<br><code>"bat.y.abcdefghijklm"</code>&nbsp;→&nbsp;<code>"bat.y.abcdefghi"</code></p>



<p class="has-medium-font-size">7단계 아이디의 길이가 2자 이하가 아니므로 변화가 없습니다.<br><code>"bat.y.abcdefghi"</code>&nbsp;→&nbsp;<code>"bat.y.abcdefghi"</code></p>



<p class="has-medium-font-size">따라서 신규 유저가 입력한 new_id가 &#8220;&#8230;!@BaT#*..y.abcdefghijklm&#8221;일 때, </p>



<p class="has-medium-font-size">네오의 프로그램이 추천하는 새로운 아이디는 &#8220;bat.y.abcdefghi&#8221; 입니다.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>[문제]</strong></h2>



<p class="has-medium-font-size">신규 유저가 입력한 아이디를 나타내는 new_id가 매개변수로 주어질 때, </p>



<p class="has-medium-font-size">&#8220;네오&#8221;가 설계한 7단계의 처리 과정을 거친 후의 추천 아이디를 return 하도록 solution 함수를 완성해 주세요.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>[제한사항]</strong></h2>



<p class="has-medium-font-size">new_id는 길이 1 이상 1,000 이하인 문자열입니다.</p>



<p class="has-medium-font-size">new_id는 알파벳 대문자, 알파벳 소문자, 숫자, 특수문자로 구성되어 있습니다.</p>



<p class="has-medium-font-size">new_id에 나타날 수 있는 특수문자는 <code>-_.~!@#$%^&amp;*()=+[{]}:?,&lt;>/</code> 로 한정됩니다.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>[입출력 예]</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">no</th><th class="has-text-align-left" data-align="left">new_id</th><th class="has-text-align-left" data-align="left">result</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">예1</td><td class="has-text-align-left" data-align="left"><code>"...!@BaT#*..y.abcdefghijklm"</code></td><td class="has-text-align-left" data-align="left"><code>"bat.y.abcdefghi"</code></td></tr><tr><td class="has-text-align-left" data-align="left">예2</td><td class="has-text-align-left" data-align="left"><code>"z-+.^."</code></td><td class="has-text-align-left" data-align="left"><code>"z--"</code></td></tr><tr><td class="has-text-align-left" data-align="left">예3</td><td class="has-text-align-left" data-align="left"><code>"=.="</code></td><td class="has-text-align-left" data-align="left"><code>"aaa"</code></td></tr><tr><td class="has-text-align-left" data-align="left">예4</td><td class="has-text-align-left" data-align="left"><code>"123_.def"</code></td><td class="has-text-align-left" data-align="left"><code>"123_.def"</code></td></tr><tr><td class="has-text-align-left" data-align="left">예5</td><td class="has-text-align-left" data-align="left"><code>"abcdefghijklmn.p"</code></td><td class="has-text-align-left" data-align="left"><code>"abcdefghijklmn"</code></td></tr></tbody></table></figure>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>입출력 예에 대한 설명</strong></h2>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="has-medium-font-size"><strong>입출력 예 #1</strong></p>



<p class="has-medium-font-size">문제의 예시와 같습니다.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>입출력 예 #2</strong></p>



<p class="has-medium-font-size">7단계를 거치는 동안 new_id가 변화하는 과정은 아래와 같습니다.</p>



<p class="has-medium-font-size">1단계 변화 없습니다.<br>2단계&nbsp;<code>"z-+.^."</code>&nbsp;→&nbsp;<code>"z-.."</code><br>3단계&nbsp;<code>"z-.."</code>&nbsp;→&nbsp;<code>"z-."</code><br>4단계&nbsp;<code>"z-."</code>&nbsp;→&nbsp;<code>"z-"</code><br>5단계 변화 없습니다.<br>6단계 변화 없습니다.<br>7단계&nbsp;<code>"z-"</code>&nbsp;→&nbsp;<code>"z--"</code></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>입출력 예 #3</strong></p>



<p class="has-medium-font-size">7단계를 거치는 동안 new_id가 변화하는 과정은 아래와 같습니다.</p>



<p class="has-medium-font-size">1단계 변화 없습니다.<br>2단계&nbsp;<code>"=.="</code>&nbsp;→&nbsp;<code>"."</code><br>3단계 변화 없습니다.<br>4단계&nbsp;<code>"."</code>&nbsp;→&nbsp;<code>""</code>&nbsp;(new_id가 빈 문자열이 되었습니다.)<br>5단계&nbsp;<code>""</code>&nbsp;→&nbsp;<code>"a"</code><br>6단계 변화 없습니다.<br>7단계&nbsp;<code>"a"</code>&nbsp;→&nbsp;<code>"aaa"</code></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>입출력 예 #4</strong></p>



<p class="has-medium-font-size">1단계에서 7단계까지 거치는 동안 new_id(&#8220;123_.def&#8221;)는 변하지 않습니다. </p>



<p class="has-medium-font-size">즉, new_id가 처음부터 카카오의 아이디 규칙에 맞습니다.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>입출력 예 #5</strong></p>



<p class="has-medium-font-size">1단계 변화 없습니다.<br>2단계 변화 없습니다.<br>3단계 변화 없습니다.<br>4단계 변화 없습니다.<br>5단계 변화 없습니다.<br>6단계 <code>"abcdefghijklmn.p"</code> → <code>"abcdefghijklmn."</code> → <code>"abcdefghijklmn"</code><br>7단계 변화 없습니다.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h1 class="wp-block-heading">통과된 코드</h1>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;string>
#include &lt;vector>
#include &lt;iostream>

using namespace std;

string solution(string new_id) {

    string answer = "";

	// 1단계
	for (int i = 0; i &lt; new_id.length(); i++) {
		if (new_id[i] >= 65 &amp;&amp; new_id[i] &lt;= 90)
			new_id[i] += 32;
	}

	// 2단계
	for (int i = 0; i &lt; new_id.length(); i++) {
		if ((new_id[i] >= 97 &amp;&amp; new_id[i] &lt;= 122) || new_id[i] == '-' || new_id[i] == '_' 
			|| new_id[i] == '.' || (new_id[i] >= 48 &amp;&amp; new_id[i] &lt;= 57))
			answer.push_back(new_id[i]);	
	}

	// 3단계
	new_id = answer;
	answer = "";
	bool check = false;
	for (int i = 0; i &lt; new_id.length(); i++) {
		if (new_id[i] == '.') {
			if (check) continue;
			answer.push_back(new_id[i]);
			check = true;
			continue;
		}
		answer.push_back(new_id[i]);
		check = false;
	}

	//4단계
	while (true) {
		if (answer[0] == '.')  {
			answer.erase(answer.begin());
			continue;
		}
		if (answer[answer.length() - 1] == '.') {
			answer.erase(answer.begin() + answer.length() - 1);
			continue;
		}
		break;
	}

	// 5단계
	if (answer.length() == 0) answer.push_back('a');
	
	// 6단계
	if (answer.length() >= 16) {
		answer = answer.substr(0, 15);
		while (true) {
			if (answer[answer.length() - 1] == '.') {
				answer.erase(answer.begin() + answer.length() - 1);
				continue;
			}
			break;
		}
	}

	// 7단계
	while (answer.length() &lt; 3) {
		answer.push_back(answer[answer.length() - 1]);
	}

    return answer;
}</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="414" height="698" src="https://lycos7560.com/wp-content/uploads/2023/05/image-84.png" alt="" class="wp-image-34799" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-84.png 414w, https://lycos7560.com/wp-content/uploads/2023/05/image-84-178x300.png 178w" sizes="(max-width: 414px) 100vw, 414px" /></figure>



<div style="height:150px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">더 효율적인 코드</h1>



<p class="has-medium-font-size"><a href="https://school.programmers.co.kr/learn/courses/30/lessons/72410/solution_groups?language=cpp" target="_blank" rel="noreferrer noopener">https://school.programmers.co.kr/learn/courses/30/lessons/72410/solution_groups?language=cpp</a></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;bits/stdc++.h>
using namespace std;

string solution(string new_id) {
    for (char&amp; ch : new_id) if ('A' &lt;= ch &amp;&amp; ch &lt;= 'Z') ch |= 32;

    string ret;
    for (char&amp; ch: new_id) {
        if ('a' &lt;= ch &amp;&amp; ch &lt;= 'z' ||
            '0' &lt;= ch &amp;&amp; ch &lt;= '9' ||
            strchr("-_.", ch)) ret += ch;
    }

    new_id = ret;
    ret.clear();
    for (char&amp; ch: new_id) {
        if (!ret.empty() &amp;&amp; ret.back() == '.' &amp;&amp; ch == '.') continue;
        ret += ch;
    }

    if (ret.front() == '.') ret.erase(ret.begin());
    if (ret.back() == '.') ret.pop_back();

    if (ret.empty()) ret = "a";
    if (ret.size() >= 16) ret = ret.substr(0, 15);
    if (ret.back() == '.') ret.pop_back();
    while (ret.size() &lt;= 2) ret += ret.back();

    return ret;
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="399" height="711" src="https://lycos7560.com/wp-content/uploads/2023/05/image-85.png" alt="" class="wp-image-34802" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-85.png 399w, https://lycos7560.com/wp-content/uploads/2023/05/image-85-168x300.png 168w" sizes="(max-width: 399px) 100vw, 399px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/programmers/programmers-72410-%ec%8b%a0%ea%b7%9c-%ec%95%84%ec%9d%b4%eb%94%94-%ec%b6%94%ec%b2%9c-2021-kakao-blind-recruitment/34792/">Programmers 72410 신규 아이디 추천 [2021 KAKAO BLIND RECRUITMENT]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/programmers/programmers-72410-%ec%8b%a0%ea%b7%9c-%ec%95%84%ec%9d%b4%eb%94%94-%ec%b6%94%ec%b2%9c-2021-kakao-blind-recruitment/34792/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Programmers 72414 광고 삽입 [2021 KAKAO BLIND RECRUITMENT]</title>
		<link>https://lycos7560.com/cpp/programmers/programmers-72414-%ea%b4%91%ea%b3%a0-%ec%82%bd%ec%9e%85-2021-kakao-blind-recruitment/34776/</link>
					<comments>https://lycos7560.com/cpp/programmers/programmers-72414-%ea%b4%91%ea%b3%a0-%ec%82%bd%ec%9e%85-2021-kakao-blind-recruitment/34776/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sun, 14 May 2023 13:39:28 +0000</pubDate>
				<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[programmers]]></category>
		<category><![CDATA[[2021 KAKAO BLIND RECRUITMENT]]]></category>
		<category><![CDATA[2021 KAKAO BLIND RECRUITMENT]]></category>
		<category><![CDATA[72414]]></category>
		<category><![CDATA[72414번]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[Programmers 72414]]></category>
		<category><![CDATA[Programmers 72414번]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[광고 삽입]]></category>
		<category><![CDATA[기본]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<category><![CDATA[타임라인]]></category>
		<category><![CDATA[파싱]]></category>
		<category><![CDATA[파싱(parsing)]]></category>
		<category><![CDATA[프로그래머스]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=34776</guid>

					<description><![CDATA[<p>Programmers 72414번 '광고 삽입' 문제에 대한 글입니다. (This article is about the 'insert advertisement' problem in Programmers Number 72414.) [2021 KAKAO BLIND RECRUITMENT]</p>
<p>The post <a href="https://lycos7560.com/cpp/programmers/programmers-72414-%ea%b4%91%ea%b3%a0-%ec%82%bd%ec%9e%85-2021-kakao-blind-recruitment/34776/">Programmers 72414 광고 삽입 [2021 KAKAO BLIND RECRUITMENT]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-01c05211      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#광고-삽입" class="uagb-toc-link__trigger">광고 삽입</a><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a></ol>					</div>
									</div>
				</div>
			


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">광고 삽입</h1>



<p class="has-medium-font-size"><a href="https://school.programmers.co.kr/learn/courses/30/lessons/72414" target="_blank" rel="noreferrer noopener">https://school.programmers.co.kr/learn/courses/30/lessons/72414</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">문제 설명</h2>



<p class="has-medium-font-size"><code>카카오TV</code>에서 유명한 크리에이터로 활동 중인 <code>죠르디</code>는 환경 단체로부터 </p>



<p class="has-medium-font-size">자신의 가장 인기있는 동영상에 지구온난화의 심각성을 알리기 위한 공익광고를 넣어 달라는 요청을 받았습니다. </p>



<p class="has-medium-font-size">평소에 환경 문제에 관심을 가지고 있던 &#8220;죠르디&#8221;는 요청을 받아들였고 </p>



<p class="has-medium-font-size">광고효과를 높이기 위해 시청자들이 가장 많이 보는 구간에 공익광고를 넣으려고 합니다. </p>



<p class="has-medium-font-size">&#8220;죠르디&#8221;는 시청자들이 해당 동영상의 어떤 구간을 재생했는 지 알 수 있는 재생구간 기록을 구했고, </p>



<p class="has-medium-font-size">해당 기록을 바탕으로 공익광고가 삽입될 최적의 위치를 고를 수 있었습니다.</p>



<p class="has-medium-font-size">참고로 광고는 재생 중인 동영상의 오른쪽 아래에서 원래 영상과 <code>동시에 재생되는</code> PIP(Picture in Picture) 형태로 제공됩니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="989" height="560" src="https://lycos7560.com/wp-content/uploads/2023/05/image-80.jpg" alt="" class="wp-image-34777" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-80.jpg 989w, https://lycos7560.com/wp-content/uploads/2023/05/image-80-300x170.jpg 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-80-768x435.jpg 768w" sizes="(max-width: 989px) 100vw, 989px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">다음은 &#8220;죠르디&#8221;가 공익광고가 삽입될 최적의 위치를 고르는 과정을 그림으로 설명한 것입니다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1090" height="355" src="https://lycos7560.com/wp-content/uploads/2023/05/image-80.png" alt="" class="wp-image-34779" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-80.png 1090w, https://lycos7560.com/wp-content/uploads/2023/05/image-80-300x98.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-80-768x250.png 768w" sizes="(max-width: 1090px) 100vw, 1090px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li>그림의 파란색 선은 광고를 검토 중인 &#8220;죠르디&#8221; 동영상의 전체 재생 구간을 나타냅니다.
<ul class="wp-block-list">
<li>위 그림에서, &#8220;죠르디&#8221; 동영상의 총 재생시간은&nbsp;<code>02시간 03분 55초</code>&nbsp;입니다.</li>
</ul>
</li>



<li>그림의 검은색 선들은 각 시청자들이 &#8220;죠르디&#8221;의 동영상을 재생한 구간의 위치를 표시하고 있습니다.
<ul class="wp-block-list">
<li>검은색 선의 가운데 숫자는 각 재생 기록을 구분하는 ID를 나타냅니다.</li>



<li>검은색 선에 표기된 왼쪽 끝 숫자와 오른쪽 끝 숫자는 시청자들이 재생한 동영상 구간의 시작 시각과 종료 시각을 나타냅니다.</li>



<li>위 그림에서, 3번 재생 기록은 <code>00시 25분 50초</code> 부터 <code>00시 48분 29초</code> 까지 총 <code>00시간 22분 39초</code> 동안 죠르디의 동영상을 재생했습니다.</li>



<li>위 그림에서, 1번 재생 기록은&nbsp;<code>01시 20분 15초</code>&nbsp;부터&nbsp;<code>01시 45분 14초</code>&nbsp;까지 총&nbsp;<code>00시간 24분 59초</code>&nbsp;동안 죠르디의 동영상을 재생했습니다.</li>
</ul>
</li>



<li>그림의 빨간색 선은 &#8220;죠르디&#8221;가 선택한 최적의 공익광고 위치를 나타냅니다.
<ul class="wp-block-list">
<li>만약 공익광고의 재생시간이 <code>00시간 14분 15초</code>라면, 위의 그림처럼 <code>01시 30분 59초</code> 부터 <br><code>01시 45분 14초</code> 까지 공익광고를 삽입하는 것이 가장 좋습니다. 이 구간을 시청한 시청자들의 누적 재생시간이 가장 크기 때문입니다.</li>



<li><code>01시 30분 59초</code> 부터 <code>01시 45분 14초</code> 까지의 누적 재생시간은 다음과 같이 계산됩니다.
<ul class="wp-block-list">
<li><code>01시 30분 59초</code>&nbsp;부터&nbsp;<code>01시 37분 44초</code>&nbsp;까지 : 4번, 1번 재생 기록이 두차례 있으므로 재생시간의 합은&nbsp;<code>00시간 06분 45초</code>&nbsp;X 2 =&nbsp;<code>00시간 13분 30초</code></li>



<li><code>01시 37분 44초</code>&nbsp;부터&nbsp;<code>01시 45분 14초</code>&nbsp;까지 : 4번, 1번, 5번 재생 기록이 세차례 있으므로 재생시간의 합은&nbsp;<code>00시간 07분 30초</code>&nbsp;X 3 =&nbsp;<code>00시간 22분 30초</code></li>



<li>따라서, 이 구간 시청자들의 누적 재생시간은&nbsp;<code>00시간 13분 30초</code>&nbsp;+&nbsp;<code>00시간 22분 30초</code>&nbsp;=&nbsp;<code>00시간 36분 00초</code>입니다.</li>
</ul>
</li>
</ul>
</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>[문제]</strong></h2>



<p class="has-medium-font-size">&#8220;죠르디&#8221;의 동영상 재생시간 길이 play_time, 공익광고의 재생시간 길이 adv_time, </p>



<p class="has-medium-font-size">시청자들이 해당 동영상을 재생했던 구간 정보 logs가 매개변수로 주어질 때, </p>



<p class="has-medium-font-size">시청자들의 누적 재생시간이 가장 많이 나오는 곳에 공익광고를 삽입하려고 합니다. </p>



<p class="has-medium-font-size">이때, 공익광고가 들어갈 <code>시작 시각</code>을 구해서 return 하도록 solution 함수를 완성해주세요. </p>



<p class="has-medium-font-size">만약, 시청자들의 누적 재생시간이 가장 많은 곳이 여러 곳이라면, </p>



<p class="has-medium-font-size">그 중에서 <code>가장 빠른 시작 시각</code>을 return 하도록 합니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>[제한사항]</strong></h2>



<ul class="wp-block-list">
<li>play_time, adv_time은 길이 8로 고정된 문자열입니다.
<ul class="wp-block-list">
<li>play_time, adv_time은&nbsp;<code>HH:MM:SS</code>&nbsp;형식이며,&nbsp;<code>00:00:01</code>&nbsp;이상&nbsp;<code>99:59:59</code>&nbsp;이하입니다.</li>



<li>즉, 동영상 재생시간과 공익광고 재생시간은&nbsp;<code>00시간 00분 01초</code>&nbsp;이상&nbsp;<code>99시간 59분 59초</code>&nbsp;이하입니다.</li>



<li>공익광고 재생시간은 동영상 재생시간보다 짧거나 같게 주어집니다.</li>
</ul>
</li>



<li>logs는 크기가 1 이상 300,000 이하인 문자열 배열입니다.
<ul class="wp-block-list">
<li>logs 배열의 각 원소는 시청자의 재생 구간을 나타냅니다.</li>



<li>logs 배열의 각 원소는 길이가 17로 고정된 문자열입니다.</li>



<li>logs 배열의 각 원소는 <code>H1:M1:S1-H2:M2:S2</code> 형식입니다.
<ul class="wp-block-list">
<li><code>H1:M1:S1</code>은 동영상이 시작된 시각,&nbsp;<code>H2:M2:S2</code>는 동영상이 종료된 시각을 나타냅니다.</li>



<li><code>H1:M1:S1</code>는&nbsp;<code>H2:M2:S2</code>보다 1초 이상 이전 시각으로 주어집니다.</li>



<li><code>H1:M1:S1</code>와&nbsp;<code>H2:M2:S2</code>는 play_time 이내의 시각입니다.</li>
</ul>
</li>
</ul>
</li>



<li>시간을 나타내는 <code>HH, H1, H2</code>의 범위는 00~99, 분을 나타내는 <code>MM, M1, M2</code>의 범위는 00~59, <br>초를 나타내는 <code>SS, S1, S2</code>의 범위는 00~59까지 사용됩니다. <br>잘못된 시각은 입력으로 주어지지 않습니다. (예: <code>04:60:24</code>, <code>11:12:78</code>, <code>123:12:45</code> 등)</li>



<li>return 값의 형식
<ul class="wp-block-list">
<li>공익광고를 삽입할 시각을&nbsp;<code>HH:MM:SS</code>&nbsp;형식의 8자리 문자열로 반환합니다.</li>
</ul>
</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>[입출력 예]</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">play_time</th><th class="has-text-align-left" data-align="left">adv_time</th><th class="has-text-align-left" data-align="left">logs</th><th class="has-text-align-left" data-align="left">result</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>"02:03:55"</code></td><td class="has-text-align-left" data-align="left"><code>"00:14:15"</code></td><td class="has-text-align-left" data-align="left"><code>["01:20:15-01:45:14", "00:40:31-01:00:00", "00:25:50-00:48:29", "01:30:59-01:53:29", "01:37:44-02:02:30"]</code></td><td class="has-text-align-left" data-align="left"><code>"01:30:59"</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>"99:59:59"</code></td><td class="has-text-align-left" data-align="left"><code>"25:00:00"</code></td><td class="has-text-align-left" data-align="left"><code>["69:59:59-89:59:59", "01:00:00-21:00:00", "79:59:59-99:59:59", "11:00:00-31:00:00"]</code></td><td class="has-text-align-left" data-align="left"><code>"01:00:00"</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>"50:00:00"</code></td><td class="has-text-align-left" data-align="left"><code>"50:00:00"</code></td><td class="has-text-align-left" data-align="left"><code>["15:36:51-38:21:49", "10:14:18-15:36:51", "38:21:49-42:51:45"]</code></td><td class="has-text-align-left" data-align="left"><code>"00:00:00"</code></td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>입출력 예에 대한 설명</strong></h2>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>입출력 예 #1</strong></p>



<p>문제 예시와 같습니다.</p>



<p class="has-medium-font-size"><strong>입출력 예 #2</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1094" height="321" src="https://lycos7560.com/wp-content/uploads/2023/05/image-81.png" alt="" class="wp-image-34781" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-81.png 1094w, https://lycos7560.com/wp-content/uploads/2023/05/image-81-300x88.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-81-768x225.png 768w" sizes="(max-width: 1094px) 100vw, 1094px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><code>01:00:00</code>에 공익광고를 삽입하면 <code>26:00:00</code>까지 재생되며, 이곳이 가장 좋은 위치입니다. </p>



<p class="has-medium-font-size">이 구간의 시청자 누적 재생시간은 다음과 같습니다.</p>



<ul class="wp-block-list">
<li><code>01:00:00-11:00:00</code>&nbsp;: 해당 구간이 1회(2번 기록) 재생되었으므로 누적 재생시간은&nbsp;<code>10시간 00분 00초</code>&nbsp;입니다.</li>



<li><code>11:00:00-21:00:00</code>&nbsp;: 해당 구간이 2회(2번, 4번 기록) 재생되었으므로 누적 재생시간은&nbsp;<code>20시간 00분 00초</code>&nbsp;입니다.</li>



<li><code>21:00:00-26:00:00</code>&nbsp;: 해당 구간이 1회(4번 기록) 재생되었으므로 누적 재생시간은&nbsp;<code>05시간 00분 00초</code>&nbsp;입니다.</li>



<li>따라서, 이 구간의 시청자 누적 재생시간은&nbsp;<code>10시간 00분 00초</code>&nbsp;+&nbsp;<code>20시간 00분 00초</code>&nbsp;+&nbsp;<code>05시간 00분 00초</code>&nbsp;=&nbsp;<code>35시간 00분 00초</code>&nbsp;입니다.</li>



<li>초록색으로 표시된 구간(<code>69:59:59-94:59:59</code>)에 광고를 삽입해도 동일한 결과를 얻을 수 있으나,&nbsp;<code>01:00:00</code>이&nbsp;<code>69:59:59</code>&nbsp;보다 빠른 시각이므로,&nbsp;<code>"01:00:00"</code>을 return 합니다.</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>입출력 예 #</strong>3</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1096" height="323" src="https://lycos7560.com/wp-content/uploads/2023/05/image-82.png" alt="" class="wp-image-34782" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-82.png 1096w, https://lycos7560.com/wp-content/uploads/2023/05/image-82-300x88.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-82-768x226.png 768w" sizes="(max-width: 1096px) 100vw, 1096px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">동영상 재생시간과 공익광고 재생시간이 같으므로, </p>



<p class="has-medium-font-size">삽입할 수 있는 위치는 맨 처음(<code>00:00:00</code>)이 유일합니다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p><code>동영상 재생시간 = 재생이 종료된 시각 - 재생이 시작된 시각</code></p>



<p>(예를 들어, <code>00시 00분 01초</code>부터 <code>00시 00분 10초</code>까지 동영상이 재생되었다면, 동영상 재생시간은 <code>9초</code> 입니다.) </p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h1 class="wp-block-heading">통과된 코드</h1>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230514_223043316.jpg" alt="" class="wp-image-34788" width="1076" height="1440" srcset="https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230514_223043316.jpg 1434w, https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230514_223043316-224x300.jpg 224w, https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230514_223043316-768x1028.jpg 768w, https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230514_223043316-1147x1536.jpg 1147w" sizes="(max-width: 1076px) 100vw, 1076px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><strong>주의</strong></h2>



<p class="has-medium-font-size">logs는 크기가 1 이상 300,000 이하인 문자열 배열</p>



<p class="has-medium-font-size">동영상 시간의 최대 범위는 360,000초</p>



<p class="has-medium-font-size">300,000 * 360,000 = 108,000,000,000</p>



<p class="has-medium-font-size">int의 범위 <strong>-2,147,483,648 ~ 2,147,483,647</strong>를 벗어난다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;string>
#include &lt;vector>
#include &lt;sstream>
#include &lt;cstdlib>
#include &lt;string>

using namespace std;

int Total_PT_Int, Total_ADV_Time, TimeLine[360000];
long long int _Res;

vector&lt;pair&lt;int, int>> Logs_Times;

int StringTimeConverter(string time) {
    int second;

    int to_hour = ((time[0] - '0') * 10) + (time[1] - '0');
    int to_min = ((time[3] - '0') * 10) + (time[4] - '0');
    int to_sec = ((time[6] - '0') * 10) + (time[7] - '0');
    second = to_hour * 3600 + to_min * 60 + to_sec;

    return second;
}

string IntToTimeString(int timeInSeconds) {
    int hours = timeInSeconds / 3600;
    int minutes = (timeInSeconds % 3600) / 60;
    int seconds = (timeInSeconds % 3600) % 60;
    string str;
    if (hours &lt; 10) str += "0" + to_string(hours) + ":";
    else str += to_string(hours) + ":";
    if (minutes &lt; 10) str += "0" + to_string(minutes) + ":";
    else str += to_string(minutes) + ":";
    if (seconds &lt; 10) str += "0" + to_string(seconds);
    else str += to_string(seconds);
    return str;
}

string solution(string play_time, string adv_time, vector&lt;string> logs) {
    string answer = "";
    Total_PT_Int = StringTimeConverter(play_time);
    Total_ADV_Time = StringTimeConverter(adv_time);
    for (auto&amp; it : logs)
    {
        vector&lt;string> _ResV;
        istringstream ss(it);
        string _temp;
        while (getline(ss, _temp, '-'))
            _ResV.push_back(_temp);
        int _Start = StringTimeConverter(_ResV[0]);
        int _End = StringTimeConverter(_ResV[1]); 
        Logs_Times.push_back(make_pair(_Start, _End));
        TimeLine[_Start]++;
        TimeLine[_End]--;
    }

    for (int i = 1; i &lt; Total_PT_Int; i++) 
        TimeLine[i] += TimeLine[i - 1];

    // 0 부터 시작
    int STime = 0;
    for (int i = 1; i &lt; Total_ADV_Time; i++)
        _Res += TimeLine[i - 1];
    long long int Max = _Res;


    for (int i = Total_ADV_Time; i &lt; Total_PT_Int; i++) {
        _Res += TimeLine[i];
        _Res -= TimeLine[i - Total_ADV_Time];
        if (_Res > Max) {
            Max = _Res;
           STime = i - Total_ADV_Time + 1;
        }
    }
    return IntToTimeString(STime);
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/05/image-83.png" alt="" class="wp-image-34784" width="475" height="974" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-83.png 358w, https://lycos7560.com/wp-content/uploads/2023/05/image-83-146x300.png 146w" sizes="(max-width: 475px) 100vw, 475px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/programmers/programmers-72414-%ea%b4%91%ea%b3%a0-%ec%82%bd%ec%9e%85-2021-kakao-blind-recruitment/34776/">Programmers 72414 광고 삽입 [2021 KAKAO BLIND RECRUITMENT]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/programmers/programmers-72414-%ea%b4%91%ea%b3%a0-%ec%82%bd%ec%9e%85-2021-kakao-blind-recruitment/34776/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>백준 28074번 (모비스, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-28074%eb%b2%88-%eb%aa%a8%eb%b9%84%ec%8a%a4-c-baekjoon/35252/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-28074%eb%b2%88-%eb%aa%a8%eb%b9%84%ec%8a%a4-c-baekjoon/35252/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Wed, 10 May 2023 04:55:39 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[28074]]></category>
		<category><![CDATA[28074번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[구현]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[모비스]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 28074]]></category>
		<category><![CDATA[백준 28074번]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=35252</guid>

					<description><![CDATA[<p>백준 28074번 '모비스' 문제에 대한 글입니다. 단순한 구현 문제 입니다. (This article is about the issue of "Mobis" in Baekjoon Number 28074.<br />
It's a simple implementation problem.)</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-28074%eb%b2%88-%eb%aa%a8%eb%b9%84%ec%8a%a4-c-baekjoon/35252/">백준 28074번 (모비스, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-11141553      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#모비스" class="uagb-toc-link__trigger">모비스</a><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a></ol>					</div>
									</div>
				</div>
			


<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">모비스</h1>



<p class="has-medium-font-size"><a href="https://www.acmicpc.net/problem/28074" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/28074</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">1 초</td><td class="has-text-align-left" data-align="left">1024 MB</td><td class="has-text-align-left" data-align="left">921</td><td class="has-text-align-left" data-align="left">690</td><td class="has-text-align-left" data-align="left">659</td><td class="has-text-align-left" data-align="left">77.804%</td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">문제</h2>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="750" height="262" src="https://lycos7560.com/wp-content/uploads/2023/05/image-160.png" alt="" class="wp-image-35254" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-160.png 750w, https://lycos7560.com/wp-content/uploads/2023/05/image-160-300x105.png 300w" sizes="(max-width: 750px) 100vw, 750px" /></figure>



<ul class="wp-block-list">
<li>Innovations for Humanity, Mobility for Tomorrow</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">현대 모비스의&nbsp;<strong>MOBIS</strong>는 어떤 뜻을 가지고 있을까?</p>



<p class="has-medium-font-size"><strong>MOBIS</strong>는 기존에는 Mobile + System의 합성어에서 시작되었지만, </p>



<p class="has-medium-font-size">현재는 &#8220;Mobility Beyond Integrated Solution&#8221; 라는 의미로 재정의 되었다.</p>



<p class="has-medium-font-size">이는 사용자의 경험을 혁신하고, 고객의 요구에 최적화된 통합 솔루션, </p>



<p class="has-medium-font-size">그 이상의 가치를 전달하는 모빌리티 플랫폼 프로바이더로 도약하겠다는 뜻을 가지고 있다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="667" height="365" src="https://lycos7560.com/wp-content/uploads/2023/05/image-161.png" alt="" class="wp-image-35255" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-161.png 667w, https://lycos7560.com/wp-content/uploads/2023/05/image-161-300x164.png 300w" sizes="(max-width: 667px) 100vw, 667px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">이 뜻에 매료된 진익이는 스티커 용지에 인쇄되어 있는 문자들 중<strong>&nbsp;&#8216;M&#8217;, &#8216;O&#8217;, &#8216;B&#8217;, &#8216;I&#8217;, &#8216;S&#8217;&nbsp;</strong>만을 오리고 </p>



<p class="has-medium-font-size">적절히 배치하여 노트북에&nbsp;<strong>MOBIS</strong>를 붙여놓고자 한다.</p>



<p class="has-medium-font-size">스티커 용지에 인쇄되어 있는 문자열이 주어진다. </p>



<p class="has-medium-font-size">이 문자들을 이용해 MOBIS를 만들 수 있을까?</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">입력</h2>



<p class="has-medium-font-size">첫째 줄에 문자열이 주어진다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">출력</h2>



<p class="has-medium-font-size">주어진 문자열에 포함된 알파벳 대문자들을 이용해&nbsp;<strong>MOBIS</strong>를 만들 수 있으면 &#8220;<code>YES</code>&#8220;, </p>



<p class="has-medium-font-size">그렇지 않으면 &#8220;<code>NO</code>&#8220;를 출력한다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">제한</h2>



<ul class="wp-block-list">
<li>1 ≤ 문자열의 길이 ≤ 100</li>



<li>문자열은 알파벳 대문자로만 이루어져 있다.</li>
</ul>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 1</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">MOIISB</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 1</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">YES</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 2</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">MOBI</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 2</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">NO</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 3</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">INHACTP</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 3</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">NO</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">출처</h2>



<p><a href="https://www.acmicpc.net/category/5" target="_blank" rel="noreferrer noopener">University</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/336" target="_blank" rel="noreferrer noopener">인하대학교</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/846" target="_blank" rel="noreferrer noopener">2023 인하대학교 프로그래밍 경진대회(IUPC)</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/detail/3584" target="_blank" rel="noreferrer noopener">Contest</a>&nbsp;A번</p>



<p><a href="https://www.acmicpc.net/category/5" target="_blank" rel="noreferrer noopener">University</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/336">인하대학교</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/846" target="_blank" rel="noreferrer noopener">2023 인하대학교 프로그래밍 경진대회(IUPC)</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/detail/3585" target="_blank" rel="noreferrer noopener">Open Contest</a>&nbsp;A번</p>



<ul class="wp-block-list">
<li>문제를 검수한 사람:&nbsp;<a href="https://www.acmicpc.net/user/39dll" target="_blank" rel="noreferrer noopener">39dll</a>,&nbsp;<a href="https://www.acmicpc.net/user/eaststar" target="_blank" rel="noreferrer noopener">eaststar</a>,&nbsp;<a href="https://www.acmicpc.net/user/gumgood" target="_blank" rel="noreferrer noopener">gumgood</a>,&nbsp;<a href="https://www.acmicpc.net/user/jthis" target="_blank" rel="noreferrer noopener">jthis</a>,&nbsp;<a href="https://www.acmicpc.net/user/wjdclgns12" target="_blank" rel="noreferrer noopener">wjdclgns12</a>,&nbsp;<a href="https://www.acmicpc.net/user/yooshnn" target="_blank" rel="noreferrer noopener">yooshnn</a></li>



<li>문제를 만든 사람:&nbsp;<a href="https://www.acmicpc.net/user/jinik9903" target="_blank" rel="noreferrer noopener">jinik9903</a></li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">알고리즘 분류</h2>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/102" target="_blank" rel="noreferrer noopener">구현</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h1 class="wp-block-heading">통과된 코드</h1>



<p>Boolean 배열로 나올 수 있는 알파벳을 전부 체크</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>
using namespace std;
bool _Check[26];
int main()
{
	string str;
	cin >> str;
	for (int i = 0; i &lt; str.length(); i++)
		_Check[str[i] - 'A'] = true;
	if (_Check['M' - 'A'] &amp;&amp; _Check['O' - 'A'] &amp;&amp; _Check['I' - 'A']
		&amp;&amp; _Check['S' - 'A'] &amp;&amp; _Check['B' - 'A']) cout &lt;&lt; "YES";
	else cout &lt;&lt; "NO";
	return 0;
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/05/image-162.png" alt="" class="wp-image-35256" width="1124" height="92" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-162.png 1446w, https://lycos7560.com/wp-content/uploads/2023/05/image-162-300x24.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-162-768x63.png 768w" sizes="(max-width: 1124px) 100vw, 1124px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-28074%eb%b2%88-%eb%aa%a8%eb%b9%84%ec%8a%a4-c-baekjoon/35252/">백준 28074번 (모비스, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-28074%eb%b2%88-%eb%aa%a8%eb%b9%84%ec%8a%a4-c-baekjoon/35252/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>백준 9251번 (LCS, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-9251%eb%b2%88-lcs-c-baekjoon/34481/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-9251%eb%b2%88-lcs-c-baekjoon/34481/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Tue, 25 Apr 2023 21:56:53 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[9251]]></category>
		<category><![CDATA[9251번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[DP]]></category>
		<category><![CDATA[DynamicProgramming]]></category>
		<category><![CDATA[LCS]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[기본]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[다이나믹 프로그래밍]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 9251]]></category>
		<category><![CDATA[백준 9251번]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[추가 반례]]></category>
		<category><![CDATA[추가 예제]]></category>
		<category><![CDATA[추가반례]]></category>
		<category><![CDATA[추가예제]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=34481</guid>

					<description><![CDATA[<p>백준 9251번 'LCS' 문제에 대한 글입니다. (This is an article about the problem of "LCS" in Baekjoon<br />
 Number 9251)</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-9251%eb%b2%88-lcs-c-baekjoon/34481/">백준 9251번 (LCS, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-8a34d67c      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#lcs" class="uagb-toc-link__trigger">LCS</a><li class="uagb-toc__list"><a href="#추가-반례" class="uagb-toc-link__trigger">추가 반례</a><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a></ol>					</div>
									</div>
				</div>
			


<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">LCS</h1>



<p class="has-medium-font-size"><a href="https://www.acmicpc.net/problem/9251" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/9251</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">0.1 초 (<a href="https://www.acmicpc.net/problem/9251#" target="_blank" rel="noreferrer noopener">하단 참고</a>)</td><td class="has-text-align-left" data-align="left">256 MB</td><td class="has-text-align-left" data-align="left">69404</td><td class="has-text-align-left" data-align="left">28234</td><td class="has-text-align-left" data-align="left">20700</td><td class="has-text-align-left" data-align="left">40.213%</td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">문제</h2>



<p class="has-medium-font-size">LCS(Longest Common Subsequence, 최장 공통 부분 수열)문제는 두 수열이 주어졌을 때, </p>



<p class="has-medium-font-size">모두의 부분 수열이 되는 수열 중 가장 긴 것을 찾는 문제이다.</p>



<p class="has-medium-font-size">예를 들어, ACAYKP와 CAPCAK의 LCS는 ACAK가 된다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">입력</h2>



<p class="has-medium-font-size">첫째 줄과 둘째 줄에 두 문자열이 주어진다. </p>



<p class="has-medium-font-size">문자열은 알파벳 대문자로만 이루어져 있으며, 최대 1000글자로 이루어져 있다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">출력</h2>



<p class="has-medium-font-size">첫째 줄에 입력으로 주어진 두 문자열의 LCS의 길이를 출력한다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 1</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ACAYKP
CAPCAK</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 1</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">4</pre>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">추가 반례</h1>



<p class="has-medium-font-size"><a href="https://www.acmicpc.net/board/search/all/problem/9251/84485" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/board/search/all/problem/9251/84485</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 A</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ACAA
AAACBA</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 A</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">3</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 B</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ABCDEFG
BCDEFGA</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 B</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">6</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 C</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXAAAAAAAAAAA</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 C</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">999</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 D</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">A
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 D</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">출처</h2>



<ul class="wp-block-list">
<li>문제를 만든 사람: <a href="https://www.acmicpc.net/user/baekjoon" target="_blank" rel="noreferrer noopener">baekjoon</a></li>



<li>데이터를 추가한 사람: <a href="https://www.acmicpc.net/user/bang627" target="_blank" rel="noreferrer noopener">bang627</a>, <a href="https://www.acmicpc.net/user/eric00513" target="_blank" rel="noreferrer noopener">eric00513</a>, <a href="https://www.acmicpc.net/user/qpwoeiruty" target="_blank" rel="noreferrer noopener">qpwoeiruty</a></li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">알고리즘 분류</h2>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/25" target="_blank" rel="noreferrer noopener">다이나믹 프로그래밍</a></li>



<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h1 class="wp-block-heading">통과된 코드</h1>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="756" height="1920" src="https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230509_065443079.jpg" alt="" class="wp-image-34490" srcset="https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230509_065443079.jpg 756w, https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230509_065443079-118x300.jpg 118w, https://lycos7560.com/wp-content/uploads/2023/05/KakaoTalk_20230509_065443079-605x1536.jpg 605w" sizes="(max-width: 756px) 100vw, 756px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>

using namespace std;

string _StrA, _StrB, _TempStr;
int _Res, _DP[1001];

int main()
{
	cin >> _StrA >> _StrB;

	int _Max = max(_StrA.size(), _StrB.size());

	for (int i = 0; i &lt; _StrB.length(); i++) {
		int _Temp = 0;
		for (int j = 0; j &lt; _StrA.length(); j++) {
			if (_Temp &lt; _DP[j]) 
				_Temp = _DP[j];
			else if (_StrB[i] == _StrA[j]) 
				_DP[j] = _Temp + 1;
		}
	}

	for (int i = 0; i &lt; _Max; i++)
		_Res = max(_DP[i], _Res);

	cout &lt;&lt; _Res;

	return 0;
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/05/image-12.png" alt="" class="wp-image-34482" width="947" height="129" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-12.png 827w, https://lycos7560.com/wp-content/uploads/2023/05/image-12-300x41.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-12-768x105.png 768w" sizes="(max-width: 947px) 100vw, 947px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-9251%eb%b2%88-lcs-c-baekjoon/34481/">백준 9251번 (LCS, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-9251%eb%b2%88-lcs-c-baekjoon/34481/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>백준 21955번 (Split, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-21955%eb%b2%88-split-c-baekjoon/35097/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-21955%eb%b2%88-split-c-baekjoon/35097/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Mon, 24 Apr 2023 02:25:40 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[21955]]></category>
		<category><![CDATA[21955번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[Split]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 21955]]></category>
		<category><![CDATA[백준 21955번]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=35097</guid>

					<description><![CDATA[<p>백준 21955번 'Split' 문제에 대한 글입니다. 단순한 문자열 Split 연습 문제 입니다. (This article is about the question of "Split" in Baekjoon Number 21955. This is a simple string Split exercise problem.)</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-21955%eb%b2%88-split-c-baekjoon/35097/">백준 21955번 (Split, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-6282763f      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#split" class="uagb-toc-link__trigger">Split</a><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a></ol>					</div>
									</div>
				</div>
			


<div style="height:62px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">Split</h1>



<p class="has-medium-font-size"><a href="https://www.acmicpc.net/problem/21955" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/21955</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">시간 제한</th><th class="has-text-align-left" data-align="left">메모리 제한</th><th class="has-text-align-left" data-align="left">제출</th><th class="has-text-align-left" data-align="left">정답</th><th class="has-text-align-left" data-align="left">맞힌 사람</th><th class="has-text-align-left" data-align="left">정답 비율</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">1 초</td><td class="has-text-align-left" data-align="left">512 MB</td><td class="has-text-align-left" data-align="left">147</td><td class="has-text-align-left" data-align="left">135</td><td class="has-text-align-left" data-align="left">122</td><td class="has-text-align-left" data-align="left">92.424%</td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">문제</h2>



<p class="has-medium-font-size">In order to teach Mihai to write figures neatly, his teacher gave him for homework to write several numbers.</p>



<p class="has-medium-font-size">Because he was rushing to finish his homework as quick as possible so that he can play on the computer, </p>



<p class="has-medium-font-size">he wrote the numbers so close that some of them were attached.</p>



<p class="has-medium-font-size">When his mother looked on Mihai’s notebook, she noticed this thing and she thought of a challenge for the little boy. </p>



<p class="has-medium-font-size">She writes a number with an even number of digits and Mihai should split this number in two equal parts and should write the two numbers which are formed after this move.</p>



<p class="has-medium-font-size">This thing will help Mihai learn how to write numbers neatly in a funny way.</p>



<p class="has-medium-font-size">Help Mihai find two numbers which form the number said by his mother, if we attach the second number at the end of the first one.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">입력</h2>



<p class="has-medium-font-size">The first line of the input contains only one integer, N&nbsp;– the number told by Mihai’s mother.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">출력</h2>



<p class="has-medium-font-size">The output contains two integers separated by space, the numbers which form the number told by Mihai’s mother.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">제한</h2>



<ul class="wp-block-list">
<li>1 ≤ N ≤ 10<sup>18</sup>.</li>



<li>N has even number of digits.</li>



<li>All digits are different from 0.</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 1</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">2341</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 1</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">23 41</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 입력 2</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">238445</pre>



<div style="height:31px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">예제 출력 2</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">238 445</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">출처</h2>



<p><a href="https://www.acmicpc.net/category/45" target="_blank" rel="noreferrer noopener">Contest</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/532" target="_blank" rel="noreferrer noopener">&nbsp;infO(1) Cup</a>&nbsp;&gt;&nbsp;<a href="https://www.acmicpc.net/category/detail/2570">infO(1) Cup 2019 N</a><a href="https://www.acmicpc.net/category/detail/2570" target="_blank" rel="noreferrer noopener">a</a><a href="https://www.acmicpc.net/category/detail/2570">tional Round</a>&nbsp;1번</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">알고리즘 분류</h2>



<ul class="wp-block-list">
<li><a href="https://www.acmicpc.net/problem/tag/158" target="_blank" rel="noreferrer noopener">문자열</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h1 class="wp-block-heading">통과된 코드</h1>



<p class="has-medium-font-size">이 문제가 브론즈2 ???</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;iostream>
#include &lt;string>
using namespace std;
string str;
int main()
{
	cin >> str;
	int _Pivot = str.length() * 0.5f;
	cout &lt;&lt; str.substr(0, _Pivot) &lt;&lt; " " &lt;&lt; str.substr(_Pivot, str.length());
	return 0;
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1208" height="99" src="https://lycos7560.com/wp-content/uploads/2023/05/image-148.png" alt="" class="wp-image-35099" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-148.png 1208w, https://lycos7560.com/wp-content/uploads/2023/05/image-148-300x25.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-148-768x63.png 768w" sizes="(max-width: 1208px) 100vw, 1208px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-21955%eb%b2%88-split-c-baekjoon/35097/">백준 21955번 (Split, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-21955%eb%b2%88-split-c-baekjoon/35097/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Programmers 42888 오픈채팅방 [2019 KAKAO BLIND RECRUITMENT]</title>
		<link>https://lycos7560.com/cpp/programmers/programmers-42888-%ec%98%a4%ed%94%88%ec%b1%84%ed%8c%85%eb%b0%a9-2019-kakao-blind-recruitment/34142/</link>
					<comments>https://lycos7560.com/cpp/programmers/programmers-42888-%ec%98%a4%ed%94%88%ec%b1%84%ed%8c%85%eb%b0%a9-2019-kakao-blind-recruitment/34142/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Mon, 20 Mar 2023 05:18:02 +0000</pubDate>
				<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[programmers]]></category>
		<category><![CDATA[[2019 KAKAO BLIND RECRUITMENT]]]></category>
		<category><![CDATA[2019 KAKAO BLIND RECRUITMENT]]></category>
		<category><![CDATA[42888]]></category>
		<category><![CDATA[42888번]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[Programmers 42888]]></category>
		<category><![CDATA[Programmers 42888번]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[기본]]></category>
		<category><![CDATA[기초]]></category>
		<category><![CDATA[문자열]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[오픈채팅방]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<category><![CDATA[파싱]]></category>
		<category><![CDATA[파싱(parsing)]]></category>
		<category><![CDATA[프로그래머스]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=34142</guid>

					<description><![CDATA[<p>Programmers 42888번 '오픈채팅방' 문제에 대한 글입니다. [2019 KAKAO BLIND RECRUITMENT] (This article is about the 'Open Chat Room' problem in Programmers 42888. [2019 KAKAO BLIND RECRUITMENT])</p>
<p>The post <a href="https://lycos7560.com/cpp/programmers/programmers-42888-%ec%98%a4%ed%94%88%ec%b1%84%ed%8c%85%eb%b0%a9-2019-kakao-blind-recruitment/34142/">Programmers 42888 오픈채팅방 [2019 KAKAO BLIND RECRUITMENT]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<!-- HorizontalAD -->
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5698326622209671" data-ad-slot="6908948342" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-711c0f90      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							목차 테이블						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#오픈채팅방" class="uagb-toc-link__trigger">오픈채팅방</a><li class="uagb-toc__list"><a href="#통과된-코드" class="uagb-toc-link__trigger">통과된 코드</a><li class="uagb-toc__list"><a href="#더-효율적인-코드" class="uagb-toc-link__trigger">더 효율적인 코드</a></ol>					</div>
									</div>
				</div>
			


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">오픈채팅방</h1>



<p class="has-medium-font-size"><a href="https://school.programmers.co.kr/learn/courses/30/lessons/42888" target="_blank" rel="noreferrer noopener">https://school.programmers.co.kr/learn/courses/30/lessons/42888</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">카카오톡 오픈채팅방에서는 친구가 아닌 사람들과 대화를 할 수 있는데, </p>



<p class="has-medium-font-size">본래 닉네임이 아닌 가상의 닉네임을 사용하여 채팅방에 들어갈 수 있다.</p>



<p class="has-medium-font-size">신입사원인 김크루는 카카오톡 오픈 채팅방을 개설한 사람을 위해, 다양한 사람들이 들어오고, </p>



<p class="has-medium-font-size">나가는 것을 지켜볼 수 있는 관리자창을 만들기로 했다. </p>



<p class="has-medium-font-size">채팅방에 누군가 들어오면 다음 메시지가 출력된다.</p>



<p class="has-medium-font-size">&#8220;[닉네임]님이 들어왔습니다.&#8221;</p>



<p class="has-medium-font-size">채팅방에서 누군가 나가면 다음 메시지가 출력된다.</p>



<p class="has-medium-font-size">&#8220;[닉네임]님이 나갔습니다.&#8221;</p>



<p class="has-medium-font-size">채팅방에서 닉네임을 변경하는 방법은 다음과 같이 두 가지이다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>채팅방을 나간 후, 새로운 닉네임으로 다시 들어간다.<br>채팅방에서 닉네임을 변경한다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">닉네임을 변경할 때는 기존에 채팅방에 출력되어 있던 메시지의 닉네임도 전부 변경된다.</p>



<p class="has-medium-font-size">예를 들어, 채팅방에 &#8220;Muzi&#8221;와 &#8220;Prodo&#8221;라는 닉네임을 사용하는 사람이 순서대로 들어오면 </p>



<p class="has-medium-font-size">채팅방에는 다음과 같이 메시지가 출력된다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>&#8220;Muzi님이 들어왔습니다.&#8221;<br>&#8220;Prodo님이 들어왔습니다.&#8221;</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">채팅방에 있던 사람이 나가면 채팅방에는 다음과 같이 메시지가 남는다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>&#8220;Muzi님이 들어왔습니다.&#8221;<br>&#8220;Prodo님이 들어왔습니다.&#8221;<br>&#8220;Muzi님이 나갔습니다.&#8221;</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">Muzi가 나간후 다시 들어올 때, Prodo 라는 닉네임으로 들어올 경우 </p>



<p class="has-medium-font-size">기존에 채팅방에 남아있던 Muzi도 Prodo로 다음과 같이 변경된다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>&#8220;Prodo님이 들어왔습니다.&#8221;<br>&#8220;Prodo님이 들어왔습니다.&#8221;<br>&#8220;Prodo님이 나갔습니다.&#8221;<br>&#8220;Prodo님이 들어왔습니다.&#8221;</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">채팅방은 중복 닉네임을 허용하기 때문에, 현재 채팅방에는 Prodo라는 닉네임을 사용하는 사람이 두 명이 있다. </p>



<p class="has-medium-font-size">이제, 채팅방에 두 번째로 들어왔던 Prodo가 Ryan으로 닉네임을 변경하면 채팅방 메시지는 다음과 같이 변경된다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>&#8220;Prodo님이 들어왔습니다.&#8221;<br>&#8220;Ryan님이 들어왔습니다.&#8221;<br>&#8220;Prodo님이 나갔습니다.&#8221;<br>&#8220;Prodo님이 들어왔습니다.&#8221;</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size">채팅방에 들어오고 나가거나, 닉네임을 변경한 기록이 담긴 문자열 배열 record가 매개변수로 주어질 때, </p>



<p class="has-medium-font-size">모든 기록이 처리된 후, </p>



<p class="has-medium-font-size">최종적으로 방을 개설한 사람이 보게 되는 메시지를 문자열 배열 형태로 return 하도록 solution 함수를 완성하라.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading has-large-font-size">제한사항</h5>



<ul class="wp-block-list">
<li>record는 다음과 같은 문자열이 담긴 배열이며, 길이는&nbsp;<code>1</code>&nbsp;이상&nbsp;<code>100,000</code>&nbsp;이하이다.</li>



<li>다음은 record에 담긴 문자열에 대한 설명이다.
<ul class="wp-block-list">
<li>모든 유저는 [유저 아이디]로 구분한다.</li>



<li>[유저 아이디] 사용자가 [닉네임]으로 채팅방에 입장 &#8211; &#8220;Enter [유저 아이디] [닉네임]&#8221; (ex. &#8220;Enter uid1234 Muzi&#8221;)</li>



<li>[유저 아이디] 사용자가 채팅방에서 퇴장 &#8211; &#8220;Leave [유저 아이디]&#8221; (ex. &#8220;Leave uid1234&#8221;)</li>



<li>[유저 아이디] 사용자가 닉네임을 [닉네임]으로 변경 &#8211; &#8220;Change [유저 아이디] [닉네임]&#8221; (ex. &#8220;Change uid1234 Muzi&#8221;)</li>



<li>첫 단어는 Enter, Leave, Change 중 하나이다.</li>



<li>각 단어는 공백으로 구분되어 있으며, 알파벳 대문자, 소문자, 숫자로만 이루어져있다.</li>



<li>유저 아이디와 닉네임은 알파벳 대문자, 소문자를 구별한다.</li>



<li>유저 아이디와 닉네임의 길이는&nbsp;<code>1</code>&nbsp;이상&nbsp;<code>10</code>&nbsp;이하이다.</li>



<li>채팅방에서 나간 유저가 닉네임을 변경하는 등 잘못 된 입력은 주어지지 않는다.</li>
</ul>
</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">입출력 예</h5>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">record</th><th class="has-text-align-left" data-align="left">result</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>["Enter uid1234 Muzi", "Enter uid4567 Prodo","Leave uid1234","Enter uid1234 Prodo","Change uid4567 Ryan"]</code></td><td class="has-text-align-left" data-align="left"><code>["Prodo님이 들어왔습니다.", "Ryan님이 들어왔습니다.", "Prodo님이 나갔습니다.", "Prodo님이 들어왔습니다."]</code></td></tr></tbody></table></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">입출력 예 설명</h5>



<p class="has-medium-font-size">입출력 예 #1</p>



<p class="has-medium-font-size">문제의 설명과 같다.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h1 class="wp-block-heading">통과된 코드</h1>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;string>
#include &lt;vector>
#include &lt;sstream>
#include &lt;map>

using namespace std;

map&lt;string, string> userRegistMap;
multimap&lt;int , pair&lt;string, int>> dialogue;
string suffix[] = { "님이 들어왔습니다.", "님이 나갔습니다." };

vector&lt;string> solution(vector&lt;string> record) {
    vector&lt;string> answer;
	int diaCnt = 0;
	for (auto &amp;it : record) {
		string command, uid, nickname;
		int pivot = 0;
		for (int i = 0; i &lt; it.length(); i++) {
			if (it[i] != ' ') command.push_back(it[i]);		
			else {
				pivot = i + 1;
				break;
			}
		}

		for (int i = pivot; i &lt; it.length(); i++) {
			if (it[i] != ' ') uid.push_back(it[i]);			
			else {
				pivot = i + 1;
				break;
			}
		}

		if (command == "Enter" || command == "Change") {
			for (int i = pivot; i &lt; it.length(); i++) nickname.push_back(it[i]);
			auto it2 = userRegistMap.find(uid);
			if (command == "Enter") {
				if (it2 == userRegistMap.end()) userRegistMap.insert(make_pair(uid, nickname));			
				else it2->second = nickname;
				dialogue.insert(make_pair(diaCnt, make_pair(uid, 0)));
			}
			else it2->second = nickname;
		}
		else dialogue.insert(make_pair(diaCnt, make_pair(uid, 1)));
		diaCnt++;
	}

	for (auto &amp;it : dialogue) {
		string str;
		str.insert(0, userRegistMap.find(it.second.first)->second);
		str.insert(str.length(), suffix[it.second.second]);
		answer.push_back(str);
	}

    return answer;
}</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/03/image-66.png" alt="" class="wp-image-34154" width="631" height="1007" srcset="https://lycos7560.com/wp-content/uploads/2023/03/image-66.png 525w, https://lycos7560.com/wp-content/uploads/2023/03/image-66-188x300.png 188w" sizes="(max-width: 631px) 100vw, 631px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">더 효율적인 코드</h1>



<p class="has-medium-font-size"><a href="https://school.programmers.co.kr/learn/courses/30/lessons/42888/solution_groups?language=cpp&amp;type=all" target="_blank" rel="noreferrer noopener">https://school.programmers.co.kr/learn/courses/30/lessons/42888/solution_groups?language=cpp&amp;type=all</a></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include &lt;string>
#include &lt;vector>
#include &lt;sstream>
#include &lt;iostream>
#include &lt;map>
using namespace std;


vector&lt;string> solution(vector&lt;string> record) {
    vector&lt;string> answer;
    string command;
    string ID;
    string uid;
   map&lt;string,string> m;


    for(string input:record)
    {
        stringstream ss(input);
        ss>>command;
        ss>>uid;
        if(command=="Enter" || command=="Change")
        {
            ss>>ID;
            m[uid]=ID;
        }
    }

   for(string input:record)
    {
        stringstream ss(input);
        ss>>command;
        ss>>uid;
        if(command=="Enter")
        {
         ID=(m.find(uid)->second);

            string temp = ID+"님이 들어왔습니다.";
         answer.push_back(temp);

        }
      else if(command=="Leave")
      {
         ID=(m.find(uid)->second);
            string temp = ID+"님이 나갔습니다.";
         answer.push_back(temp);
      }
    }
    return answer;
}
</pre>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5698326622209671" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5698326622209671" data-ad-slot="4245812909"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<p>The post <a href="https://lycos7560.com/cpp/programmers/programmers-42888-%ec%98%a4%ed%94%88%ec%b1%84%ed%8c%85%eb%b0%a9-2019-kakao-blind-recruitment/34142/">Programmers 42888 오픈채팅방 [2019 KAKAO BLIND RECRUITMENT]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/programmers/programmers-42888-%ec%98%a4%ed%94%88%ec%b1%84%ed%8c%85%eb%b0%a9-2019-kakao-blind-recruitment/34142/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
