<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=TugOfWar%2F%EC%9D%B4%EC%8A%B9%ED%95%9C</id>
	<title>TugOfWar/이승한 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=TugOfWar%2F%EC%9D%B4%EC%8A%B9%ED%95%9C"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=TugOfWar/%EC%9D%B4%EC%8A%B9%ED%95%9C&amp;action=history"/>
	<updated>2026-05-15T03:35:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=TugOfWar/%EC%9D%B4%EC%8A%B9%ED%95%9C&amp;diff=39787&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:28, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=TugOfWar/%EC%9D%B4%EC%8A%B9%ED%95%9C&amp;diff=39787&amp;oldid=prev"/>
		<updated>2021-02-07T05:28:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= TugOfWar/[[이승한]] =&lt;br /&gt;
150/200 빼고는 답이 나오긴 하지만. 분명히 틀린 알고리즘.&lt;br /&gt;
급기야는 오류가 보이자 땜빵으로 매꿔버리기도 하고...-_-ㅋ;;&lt;br /&gt;
 #include &amp;amp;lt;iostream&amp;amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 const int MAX= 100;&lt;br /&gt;
 &lt;br /&gt;
 int maxToZero(int input[]); //가장큰수를 0로 바꾸어주는 함&lt;br /&gt;
 int returnAver(int input[]);&lt;br /&gt;
 &lt;br /&gt;
 void main(){&lt;br /&gt;
 	&lt;br /&gt;
 	int weight[MAX] =	{0};&lt;br /&gt;
 	int outA[MAX]	=	{0};&lt;br /&gt;
 	int outB[MAX]	=	{0};&lt;br /&gt;
 &lt;br /&gt;
 	int teamA, teamB;&lt;br /&gt;
 	teamA = teamB	=	0;&lt;br /&gt;
 &lt;br /&gt;
 	int aver		=	0;&lt;br /&gt;
 	int maxInInput	=	0;&lt;br /&gt;
 	int N			=	0;&lt;br /&gt;
 	int inputN		=	0;&lt;br /&gt;
 	int input		=	0;&lt;br /&gt;
 	&lt;br /&gt;
 	int A, B;&lt;br /&gt;
 	A = B = 0;&lt;br /&gt;
 	&lt;br /&gt;
 	&lt;br /&gt;
 	cin&amp;amp;gt;&amp;amp;gt;N;&lt;br /&gt;
 	//23478&lt;br /&gt;
 	for(int n = 0; n&amp;amp;lt; N; n++)&lt;br /&gt;
 	{&lt;br /&gt;
 		cin.get();&lt;br /&gt;
 		cin&amp;amp;gt;&amp;amp;gt; inputN;&lt;br /&gt;
 		for(input =0; input&amp;amp;lt;inputN; input++){&lt;br /&gt;
 			cin&amp;amp;gt;&amp;amp;gt; weight[input];&lt;br /&gt;
 		}&lt;br /&gt;
 		cin.get();&lt;br /&gt;
 &lt;br /&gt;
 		teamA = teamB = A = B = 0;&lt;br /&gt;
 		aver = returnAver(weight);&lt;br /&gt;
 &lt;br /&gt;
 		for(int cycle=0; cycle &amp;amp;lt; MAX; cycle++){&lt;br /&gt;
 			maxInInput = maxToZero( weight);&lt;br /&gt;
 &lt;br /&gt;
 			if(	teamA + maxInInput == aver ){&lt;br /&gt;
 				teamA += maxInInput;&lt;br /&gt;
 			}else if( teamB + maxInInput == aver ){&lt;br /&gt;
 				teamB += maxInInput;&lt;br /&gt;
 			}else if( teamA &amp;amp;lt; teamB ){&lt;br /&gt;
 				teamA += maxInInput;&lt;br /&gt;
 			}else{&lt;br /&gt;
 				teamB += maxInInput;;&lt;br /&gt;
 			}&lt;br /&gt;
 		}&lt;br /&gt;
 		&lt;br /&gt;
 		outA[n] = teamA;&lt;br /&gt;
 		outB[n] = teamB;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	for(n=0; n&amp;amp;lt;N; n++)&lt;br /&gt;
 		cout&amp;amp;lt;&amp;amp;lt;outA[n]&amp;amp;lt;&amp;amp;lt;&amp;quot; &amp;quot;&amp;amp;lt;&amp;amp;lt;outB[n]&amp;amp;lt;&amp;amp;lt;endl;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int maxToZero(int * weight){&lt;br /&gt;
 	int max = 0;&lt;br /&gt;
 	int maxsIndex = 0;&lt;br /&gt;
 	for(int cycle=0; cycle &amp;amp;lt; MAX; cycle++){&lt;br /&gt;
 		if(max &amp;amp;lt; weight[cycle]){&lt;br /&gt;
 			max = weight[cycle];&lt;br /&gt;
 			maxsIndex = cycle;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 	weight[ maxsIndex ] = 0;&lt;br /&gt;
 	return max;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int returnAver(int * weight){&lt;br /&gt;
 	int sum  =0;&lt;br /&gt;
 	for(int cycle=0; cycle&amp;amp;lt;MAX ; cycle++){&lt;br /&gt;
 		sum += weight[cycle];&lt;br /&gt;
 	}&lt;br /&gt;
 	return ( sum / 2);&lt;br /&gt;
 }&lt;br /&gt;
----&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>