<?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/%EC%A4%91%EA%B0%84%EA%B3%84-%EC%A0%84%EC%9F%81/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Sat, 13 May 2023 02:42:44 +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>중간계 전쟁 Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>백준 4435번 (중간계 전쟁, C++) [BAEKJOON]</title>
		<link>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-4435%eb%b2%88-%ec%a4%91%ea%b0%84%ea%b3%84-%ec%a0%84%ec%9f%81-c-baekjoon/34764/</link>
					<comments>https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-4435%eb%b2%88-%ec%a4%91%ea%b0%84%ea%b3%84-%ec%a0%84%ec%9f%81-c-baekjoon/34764/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Mon, 13 Mar 2023 02:42:25 +0000</pubDate>
				<category><![CDATA[BaekjoonOnlineJudge]]></category>
		<category><![CDATA[C++/CPP]]></category>
		<category><![CDATA[4435]]></category>
		<category><![CDATA[4435번]]></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[백준 4435]]></category>
		<category><![CDATA[백준 4435번]]></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=34764</guid>

					<description><![CDATA[<p>백준 4435번 '중간계 전쟁' 문제에 대한 글입니다. (This article is about the issue of 'Intermediate War' in Baekjoon Number 4435.)</p>
<p>The post <a href="https://lycos7560.com/cpp/baekjoon_online_judge/%eb%b0%b1%ec%a4%80-4435%eb%b2%88-%ec%a4%91%ea%b0%84%ea%b3%84-%ec%a0%84%ec%9f%81-c-baekjoon/34764/">백준 4435번 (중간계 전쟁, 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-f54aff6b      "
					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 wp-block-paragraph"><a href="https://www.acmicpc.net/problem/4435" target="_blank" rel="noreferrer noopener">https://www.acmicpc.net/problem/4435</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">3072</td><td class="has-text-align-left" data-align="left">1748</td><td class="has-text-align-left" data-align="left">1596</td><td class="has-text-align-left" data-align="left">58.504%</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 wp-block-paragraph">중간계에 전쟁이 일어나려고 한다. </p>



<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:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li>호빗 &#8211; 1</li>



<li>인간 &#8211; 2</li>



<li>엘프 &#8211; 3</li>



<li>드워프 &#8211; 3</li>



<li>독수리 &#8211; 4</li>



<li>마법사 &#8211; 10</li>
</ul>



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



<p class="has-medium-font-size wp-block-paragraph">사우론의 군대의 점수는 다음과 같다.</p>



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



<ul class="wp-block-list">
<li>오크 &#8211; 1</li>



<li>인간 &#8211; 2</li>



<li>워그(늑대) &#8211; 2</li>



<li>고블린 &#8211; 2</li>



<li>우럭하이 &#8211; 3</li>



<li>트롤 &#8211; 5</li>



<li>마법사 &#8211; 10</li>
</ul>



<div style="height:20px" 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">전투에 참여한 각 종족의 점수를 합한 뒤, 큰 쪽이 이긴다.</p>



<p class="has-medium-font-size wp-block-paragraph">전투에 참여한 종족의 수가 주어졌을 때, </p>



<p class="has-medium-font-size wp-block-paragraph">어느 쪽이 이기는지 구하는 프로그램을 작성하시오.</p>



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



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



<p class="wp-block-paragraph">첫째 줄에 전투의 개수 T가 주어진다. </p>



<p class="wp-block-paragraph">각 전투는 두 줄로 이루어져 있다. </p>



<p class="wp-block-paragraph">첫째 줄에 간달프 군대에 참여한 종족의 수가 주어진다. </p>



<p class="wp-block-paragraph">이 값은 공백으로 구분되어 있으며, 호빗, 인간, 엘프, 드워프, 독수리, 마법사 순서이다. </p>



<p class="wp-block-paragraph">둘째 줄에는 사우론 군대에 참여한 종족의 수가 주어진다. </p>



<p class="wp-block-paragraph">이 값 역시 공백으로 구분되어 있으며, 오크, 인간, 워그, 고블린, 우럭하이, 트롤, 마법사 순서이다. </p>



<p class="wp-block-paragraph">모든 값은 음이 아닌 정수이고, 각 군대의 점수의 합은 32비트 정수 제한을 넘지 않는다.</p>



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



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



<p class="wp-block-paragraph">각 전투에 대해서, &#8220;Battle&#8221;과 전투 번호를 출력한다. </p>



<p class="wp-block-paragraph">그 다음에 간달프의 군대가 이긴다면 &#8220;Good triumphs over Evil&#8221;를, </p>



<p class="wp-block-paragraph">사우론의 군대가 이긴다면 &#8220;Evil eradicates all trace of Good&#8221;, </p>



<p class="wp-block-paragraph">점수의 합이 같아 이기는 쪽이 없다면 &#8220;No victor on this battle field&#8221;를 출력한다.</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="">3
1 1 1 1 1 1
1 1 1 1 1 1 1
0 0 0 0 0 10
0 1 1 1 1 0 0
1 0 0 0 0 0
1 0 0 0 0 0 0</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="">Battle 1: Evil eradicates all trace of Good
Battle 2: Good triumphs over Evil
Battle 3: No victor on this battle field</pre>



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



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



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



<p class="wp-block-paragraph"><a href="https://www.acmicpc.net/category/1" target="_blank" rel="noreferrer noopener">ICPC</a> > <a href="https://www.acmicpc.net/category/7" target="_blank" rel="noreferrer noopener">Regionals</a> > <a href="https://www.acmicpc.net/category/8" target="_blank" rel="noreferrer noopener">North America</a> > <a href="https://www.acmicpc.net/category/33" target="_blank" rel="noreferrer noopener">Pacific Northwest Regional</a> > <a href="https://www.acmicpc.net/category/detail/125" target="_blank" rel="noreferrer noopener">2012 Pacific Northwest Region Programming Contest</a> A번</p>



<p class="wp-block-paragraph"><a href="https://www.acmicpc.net/category/97" target="_blank" rel="noreferrer noopener">High School</a> > <a href="https://www.acmicpc.net/category/96" target="_blank" rel="noreferrer noopener">PLU High School Programming Contest</a> > <a href="https://www.acmicpc.net/category/781" target="_blank" rel="noreferrer noopener">PLU 2013</a> > <a href="https://www.acmicpc.net/category/detail/463" target="_blank" rel="noreferrer noopener">Advanced</a> 4번</p>



<p class="wp-block-paragraph"><a href="https://www.acmicpc.net/category/97">High Sch</a><a href="https://www.acmicpc.net/category/97" target="_blank" rel="noreferrer noopener">o</a><a href="https://www.acmicpc.net/category/97">ol</a> > <a href="https://www.acmicpc.net/category/96" target="_blank" rel="noreferrer noopener">PLU High School Programming Contest</a> > <a href="https://www.acmicpc.net/category/781" target="_blank" rel="noreferrer noopener">PLU 2013</a> > <a href="https://www.acmicpc.net/category/detail/464" target="_blank" rel="noreferrer noopener">Novice</a> 8번</p>



<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/cprayer" target="_blank" rel="noreferrer noopener">cprayer</a>, <a href="https://www.acmicpc.net/user/kdk8361" target="_blank" rel="noreferrer noopener">kdk8361</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/124" target="_blank" rel="noreferrer noopener">수학</a></li>



<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/121" target="_blank" rel="noreferrer noopener">사칙연산</a></li>
</ul>



<div style="height:40px" 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)"/>



<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;iostream>
using namespace std;
int _T, _ResA, _ResB;
int _A[7] = { 1, 2, 3, 3, 4, 10 };
int _B[8] = { 1, 2, 2, 2, 3, 5, 10 };
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin >> _T;
	for (int j = 1; j &lt;= _T; j++)
	{
		_ResA = 0;
		_ResB = 0;
		for (int i = 0; i &lt; 6; i++) {
			cin >> _A[6];
			_ResA += _A[6] * _A[i];
		}
		for (int i = 0; i &lt; 7; i++) {
			cin >> _B[7];
			_ResB += _B[7] * _B[i];
		}

		if (_ResA &lt; _ResB) cout &lt;&lt; "Battle "&lt;&lt; j &lt;&lt;": Evil eradicates all trace of Good" &lt;&lt; "\n";
		else if (_ResA == _ResB) cout &lt;&lt; "Battle " &lt;&lt; j &lt;&lt; ": No victor on this battle field" &lt;&lt; "\n";
		else cout &lt;&lt; "Battle " &lt;&lt; j &lt;&lt; ": Good triumphs over Evil" &lt;&lt; "\n";
	}

	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 fetchpriority="high" decoding="async" src="https://lycos7560.com/wp-content/uploads/2023/05/image-77.png" alt="" class="wp-image-34765" width="987" height="81" srcset="https://lycos7560.com/wp-content/uploads/2023/05/image-77.png 964w, https://lycos7560.com/wp-content/uploads/2023/05/image-77-300x25.png 300w, https://lycos7560.com/wp-content/uploads/2023/05/image-77-768x63.png 768w" sizes="(max-width: 987px) 100vw, 987px" /></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-4435%eb%b2%88-%ec%a4%91%ea%b0%84%ea%b3%84-%ec%a0%84%ec%9f%81-c-baekjoon/34764/">백준 4435번 (중간계 전쟁, 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-4435%eb%b2%88-%ec%a4%91%ea%b0%84%ea%b3%84-%ec%a0%84%ec%9f%81-c-baekjoon/34764/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
