<?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>백준 10809번 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<atom:link href="https://lycos7560.com/tag/%EB%B0%B1%EC%A4%80-10809%EB%B2%88/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Thu, 23 Feb 2023 00:07:48 +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>백준 10809번 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>백준 10809번 (알파벳 찾기, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/10809-finding_alphabets-c-baekjoon/4220/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/10809-finding_alphabets-c-baekjoon/4220/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sun, 08 Jan 2023 14:27:46 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[10809]]></category>
		<category><![CDATA[10809번]]></category>
		<category><![CDATA[Baekjoon]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></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[백준 10809]]></category>
		<category><![CDATA[백준 10809번]]></category>
		<category><![CDATA[알고리즘]]></category>
		<category><![CDATA[알파벳 찾기]]></category>
		<category><![CDATA[코딩테스트]]></category>
		<category><![CDATA[코테]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=4220</guid>

					<description><![CDATA[<p>백준(BAEKJOON) 10809번 '알파벳 찾기' 문제에 대한 글입니다.  (This is an article about the problem of finding alphabets in BAEKJOON No. 10809.)</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/10809-finding_alphabets-c-baekjoon/4220/">백준 10809번 (알파벳 찾기, 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:40px" 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/10809" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/10809</a></p>



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



<figure id="problem-info" class="wp-block-table"><table><thead><tr><th>시간 제한</th><th>메모리 제한</th><th>제출</th><th>정답</th><th>맞힌 사람</th><th>정답 비율</th></tr></thead><tbody><tr><td>1 초</td><td>256 MB</td><td>160035</td><td>84955</td><td>70225</td><td>52.965%</td></tr></tbody></table></figure>



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



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



<p class="has-medium-font-size wp-block-paragraph">알파벳 소문자로만 이루어진 단어 S가 주어진다. </p>



<p class="has-medium-font-size wp-block-paragraph">각각의 알파벳에 대해서, 단어에 포함되어 있는 경우에는 처음 등장하는 위치를, </p>



<p class="has-medium-font-size wp-block-paragraph">포함되어 있지 않은 경우에는 -1을 출력하는 프로그램을 작성하시오.</p>



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



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



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



<p class="has-medium-font-size wp-block-paragraph">단어의 길이는 100을 넘지 않으며, 알파벳 소문자로만 이루어져 있다.</p>



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



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



<p class="has-medium-font-size wp-block-paragraph">각각의 알파벳에 대해서, a가 처음 등장하는 위치, </p>



<p class="has-medium-font-size wp-block-paragraph">b가 처음 등장하는 위치, &#8230; z가 처음 등장하는 위치를 공백으로 구분해서 출력한다.</p>



<p class="has-medium-font-size wp-block-paragraph">만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출력한다. </p>



<p class="has-medium-font-size wp-block-paragraph">단어의 첫 번째 글자는 0번째 위치이고, 두 번째 글자는 1번째 위치이다.</p>



<div style="height:56px" 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="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">baekjoon</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="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">1 0 -1 -1 2 -1 -1 -1 -1 4 3 -1 -1 7 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1</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/baekjoon" target="_blank" rel="noreferrer noopener">baekjoon</a></li>



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



<li>데이터를 추가한 사람: <a href="https://www.acmicpc.net/user/djm03178" target="_blank" rel="noreferrer noopener">djm03178</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>



<div style="height:36px" 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 class="has-medium-font-size wp-block-paragraph">문자열을 입력받고 입력받은 문자열을 순회하면서</p>



<p class="has-medium-font-size wp-block-paragraph">알파벳이 나오는 인덱스의 최솟값을 출력하는 기초적인 문제</p>



<p class="has-medium-font-size wp-block-paragraph">별다른 알고리즘이 없고 문제에서 요구하는 대로 구현하면 된다.</p>



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



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



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



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

// 알파벳의 등장 인덱스 초기값은 -1
int arr[26]; // 알파벳은 26개, 소문자로 이루어져있다.

int main()
{
	for (int i = 0; i &lt; 26; i++) {
		arr[i] = -1; // -1 로 초기화 해준다.
	}

	// 문자열을 입력받는다.
	string str;
	cin >> str;

	for (int i = 0; i &lt; str.length(); i++) {
		// 만약 값이 -1 이 라면 해당 알파벳은 
		// 전에 등장한 적이 없다는 뜻이다.
		// 처음이라면 등장한 인덱스를 대입해준다.
		if (arr[str[i] - 'a'] == -1) { arr[str[i] - 'a'] = i; }
	}

	// 정답을 출력한다.
	for (int i = 0; i &lt; 26; i++) { cout &lt;&lt; arr[i] &lt;&lt; " "; }

	return 0;
}</pre>



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



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1036" height="93" src="https://lycos7560.com/wp-content/uploads/image-870.png" alt="" class="wp-image-4227" srcset="https://lycos7560.com/wp-content/uploads/image-870.png 1036w, https://lycos7560.com/wp-content/uploads/image-870-300x27.png 300w, https://lycos7560.com/wp-content/uploads/image-870-768x69.png 768w" sizes="(max-width: 1036px) 100vw, 1036px" /></figure>



<div style="height:38px" 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/10809-finding_alphabets-c-baekjoon/4220/">백준 10809번 (알파벳 찾기, C++) [BAEKJOON]</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/cpp/baekjoon_online_judge/10809-finding_alphabets-c-baekjoon/4220/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
