<?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>백준 2193번 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<atom:link href="https://lycos7560.com/tag/%EB%B0%B1%EC%A4%80-2193%EB%B2%88/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Thu, 23 Feb 2023 00:11:14 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://lycos7560.com/wp-content/uploads/2022/11/cropped-cropped-cropped-log-1-150x150-1-80x80.png</url>
	<title>백준 2193번 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>백준 2193번 (이친수, C++, DP) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/2193-pinary-number-c-dp-baekjoon/4025/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/2193-pinary-number-c-dp-baekjoon/4025/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Fri, 06 Jan 2023 12:18:34 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[2193]]></category>
		<category><![CDATA[2193번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[DP]]></category>
		<category><![CDATA[DynamicProgramming]]></category>
		<category><![CDATA[pinary number]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[다이나믹 프로그래밍]]></category>
		<category><![CDATA[동적계획법]]></category>
		<category><![CDATA[백준]]></category>
		<category><![CDATA[백준 2193]]></category>
		<category><![CDATA[백준 2193번]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[이친수]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=4025</guid>

					<description><![CDATA[<p>백준(BAEKJOON) 2193번 '이친수' 문제에 대한 글입니다. DynamicProgramming을  이용하여 해결하였습니다. (This is an article on the issue of 'pinary number' in BAEKJOON No. 2193. It was solved using Dynamic Programming.)</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/2193-pinary-number-c-dp-baekjoon/4025/">백준 2193번 (이친수, C++, DP) [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:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h1 class="wp-block-heading">이친수</h1>



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



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



<figure id="problem-info" class="wp-block-table has-small-font-size"><table><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">80019</td><td class="has-text-align-left" data-align="left">33479</td><td class="has-text-align-left" data-align="left">25207</td><td class="has-text-align-left" data-align="left">40.237%</td></tr></tbody></table></figure>



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



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



<p class="has-medium-font-size wp-block-paragraph">0과 1로만 이루어진 수를 이진수라 한다. </p>



<p class="has-medium-font-size wp-block-paragraph">이러한 이진수 중 특별한 성질을 갖는 것들이 있는데, 이들을 이친수(pinary number)라 한다. </p>



<p class="has-medium-font-size wp-block-paragraph">이친수는 다음의 성질을 만족한다.</p>



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



<p class="has-medium-font-size wp-block-paragraph">1. 이친수는 0으로 시작하지 않는다.</p>



<p class="has-medium-font-size wp-block-paragraph">2. 이친수에서는 1이 두 번 연속으로 나타나지 않는다. 즉, 11을 부분 문자열로 갖지 않는다.</p>



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



<p class="has-medium-font-size wp-block-paragraph">예를 들면 1, 10, 100, 101, 1000, 1001 등이 이친수가 된다. </p>



<p class="has-medium-font-size wp-block-paragraph">하지만 0010101이나 101101은 각각 1, 2번 규칙에 위배되므로 이친수가 아니다.</p>



<p class="has-medium-font-size wp-block-paragraph">N(1 ≤ N ≤ 90)이 주어졌을 때, N자리 이친수의 개수를 구하는 프로그램을 작성하시오.</p>



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



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



<p class="has-medium-font-size wp-block-paragraph">첫째 줄에 N이 주어진다.</p>



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



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



<p class="has-medium-font-size wp-block-paragraph">첫째 줄에 N자리 이친수의 개수를 출력한다.</p>



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



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



<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">3</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="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">2</pre>



<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/user/ehay" target="_blank" rel="noreferrer noopener">ehay</a></li>



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



<div style="height:48px" 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>
</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 fetchpriority="high" decoding="async" width="969" height="1271" src="https://lycos7560.com/wp-content/uploads/image-835.png" alt="" class="wp-image-4031" srcset="https://lycos7560.com/wp-content/uploads/image-835.png 969w, https://lycos7560.com/wp-content/uploads/image-835-229x300.png 229w, https://lycos7560.com/wp-content/uploads/image-835-768x1007.png 768w" sizes="(max-width: 969px) 100vw, 969px" /></figure>



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



<p class="has-medium-font-size wp-block-paragraph">결국 이 문제는 피보나치 수열과 같다.</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-어제와-내일의-나-그-사이의-이야기 wp-block-embed-어제와-내일의-나-그-사이의-이야기"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="fEnqaUTmgx"><a href="https://lycos7560.com/?p=3966">알고리즘 &#8211; Dynamic Programming [DP] (다이나믹 프로그래밍 / 동적 계획법)</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;알고리즘 &#8211; Dynamic Programming [DP] (다이나믹 프로그래밍 / 동적 계획법)&#8221; &#8212; 어제와 내일의 나 그 사이의 이야기" src="https://lycos7560.com/?p=3966&#038;embed=true#?secret=L6IN8zhYkk#?secret=fEnqaUTmgx" data-secret="fEnqaUTmgx" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<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)"/>



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



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



<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>

using namespace std;

long long int arr[91]; // N은 최대 90

int main()
{
	// Tabulation: Bottom Up 방식

	long long int N = 0;

	cin >> N;

	arr[0] = 0, arr[1] = 1;

	for (int  i = 2; i &lt;= N; i++) {
		arr[i] = arr[i - 1] + arr[i - 2];
	}

	cout &lt;&lt; arr[N];

	return 0;
}</pre>



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



<figure class="wp-block-image size-full"><img decoding="async" width="1035" height="141" src="https://lycos7560.com/wp-content/uploads/image-836.png" alt="" class="wp-image-4032" srcset="https://lycos7560.com/wp-content/uploads/image-836.png 1035w, https://lycos7560.com/wp-content/uploads/image-836-300x41.png 300w, https://lycos7560.com/wp-content/uploads/image-836-768x105.png 768w" sizes="(max-width: 1035px) 100vw, 1035px" /></figure>



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



<p class="has-medium-font-size wp-block-paragraph">통과하지 못한 이유</p>



<p class="has-medium-font-size wp-block-paragraph">1. 범위 제출 시 int로 제출하여 오버플로우가 발생</p>



<p class="has-medium-font-size wp-block-paragraph">2. 점화식에 변수를 잘못넣음  => for문에서 i 에  N을 넣음 (미친듯)</p>



<div style="height:68px" 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/2193-pinary-number-c-dp-baekjoon/4025/">백준 2193번 (이친수, C++, DP) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/baekjoon_online_judge/2193-pinary-number-c-dp-baekjoon/4025/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
