<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333287</guid>
        <pubDate>Wed, 07 Apr 2004 08:01:40 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333287</link>
        <description><![CDATA[experimenter: 2 Sazabis<br>так и нигде и не пересоздавал массив. там же везде ссылка стоит. а память, там сроду не должна была кроме одного раза как максимум перераспределиться.]]></description>
        <author>experimenter</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333243</guid>
        <pubDate>Wed, 07 Apr 2004 06:58:59 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333243</link>
        <description><![CDATA[Sazabis: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>experimenter</strong>, 7.04.04, 09:09<br>
здорово, конечно. а потом говорят, что ООП программирование такое же эффективное, как и процедурное.</div></div><br>
<br>
Я бы не стал так расстраиваться ;)  в конце концов в std, привиденных, вариантах<br>
( experimenter и flex ferrum ) не было использовано то, что массив нет необходимости пересоздовать&#33;, достаточно ограничивать вывод элементов массива  :yes: <br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>trainer</strong>, 7.04.04, 09:41<br>
P.S. Я так понимаю, народ понемногу созревает к соревнованиям на скорость.  </div></div><br>
<br>
e-e&#33; it&#39;s cool  :yes:]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333234</guid>
        <pubDate>Wed, 07 Apr 2004 06:48:54 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333234</link>
        <description><![CDATA[SVK : <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <span class='tag-quote__quote-info'>trainer,7.04.04, 09:21</span><div class='quote '>Придумай задачу - будем решать. :)</div></div><br>
Есть четырёхсвязный список элементов, т.е. в полной укомплектации это решетка .<br>
Задача: без использования рекурсии, расцепить все дочерние-нижестоящие элементы, начиная с указанного; без привлечения каких-либо дополнительных ресурсов, но элемент может содержать служебные поля (заполняемые в процессе разцепления и/или формирования). ЯВУ реализации - СИ.<br>
Примечание: можно принять допущение, что полной решетки быть не может, т.е. без циклов.]]></description>
        <author>SVK </author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333226</guid>
        <pubDate>Wed, 07 Apr 2004 06:41:16 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333226</link>
        <description><![CDATA[trainer: P.S. Я так понимаю, народ понемногу созревает к соревнованиям на скорость. :)]]></description>
        <author>trainer</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333219</guid>
        <pubDate>Wed, 07 Apr 2004 06:36:10 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333219</link>
        <description><![CDATA[tserega: Мне тоже понравилось&#33; Случайно заметил эту тему, решил поучаствовать. Жду следующую&#33;&#33;&#33;]]></description>
        <author>tserega</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333210</guid>
        <pubDate>Wed, 07 Apr 2004 06:21:32 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333210</link>
        <description><![CDATA[trainer: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>experimenter</strong>, 7.04.04, 09:09<br>
когда планируется следующая задачка?</div></div>На днях. :)<br>
<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>experimenter</strong>, 7.04.04, 09:09<br>
еще у меня что-то типа пожелания. <br>
эта задачка очень похожа на переборную и вместо вывода на экран лучше искать какой-то минимум на всей области решений или что-то типа того, тогда легче оценивать время.</div></div>Придумай задачу - будем решать. :)]]></description>
        <author>trainer</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333200</guid>
        <pubDate>Wed, 07 Apr 2004 06:09:10 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=333200</link>
        <description><![CDATA[experimenter: здорово, конечно. а потом говорят, что ООП программирование такое же эффективное, как и процедурное.<br>кстати, когда следующая задача планируется? мне очень нравится все, но какая конечная цель?<br>еще у меня что-то типа пожелания. <br>эта задачка очень похожа на переборную и вместо вывода на экран лучше искать какой-то минимум на всей области решений или что-то типа того, тогда легче оценивать время.<br>когда планируется следующая задачка? :)]]></description>
        <author>experimenter</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332824</guid>
        <pubDate>Tue, 06 Apr 2004 14:32:58 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332824</link>
        <description><![CDATA[tserega: Вау&#33; Вот это комментарии и исследование&#33;&#33;&#33;]]></description>
        <author>tserega</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332745</guid>
        <pubDate>Tue, 06 Apr 2004 13:11:46 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332745</link>
        <description><![CDATA[Sazabis: Итак, несколько слов о задаче:<br>
<br>
в общем все уже поняли алгоритм, дающий только нужные варианты, приведу свой код<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">void Analyze( unsigned rest, unsigned step, unsigned *prefix, unsigned prefix_size ){</div><div class="code_line">&nbsp;&nbsp;// Вывод</div><div class="code_line">&nbsp;&nbsp;if( !rest &amp;&amp; prefix_size &#62; 1 ){</div><div class="code_line">&nbsp;&nbsp; &nbsp;for( unsigned i=0;i&#60;prefix_size-1;i++ )cout&#60;&#60; prefix[ i ] &#60;&#60; &#39;+&#39;;</div><div class="code_line">&nbsp;&nbsp; &nbsp;cout&#60;&#60; prefix[ prefix_size-1 ] &#60;&#60; endl;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return;</div><div class="code_line">&nbsp;&nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;// Итерации</div><div class="code_line">&nbsp;&nbsp;for( unsigned i=rest &#60; step ? rest : step;i;--i ){</div><div class="code_line">&nbsp;&nbsp; &nbsp;prefix[ prefix_size ] = i;</div><div class="code_line">&nbsp;&nbsp; &nbsp;Analyze( rest - i, i, prefix, prefix_size + 1 );</div><div class="code_line">&nbsp;&nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
в, общем, логика у всех одинаковая, только разные типы данных, от того и разная скорость... однако, глядя на экран с ответами, можно увидеть &quot;треугольнички единиц&quot;, которые дополняют почти все варианты  B) Можно, использовать эту &quot;фишку&quot;, для этого в начале проинициализировать используемый массив (prefix) одними единицами:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">int main(int argc, char* argv[]){</div><div class="code_line">&nbsp;&nbsp;unsigned number = 0;</div><div class="code_line">&nbsp;&nbsp;cout &#60;&#60; &quot;Input number:&quot;; cin &#62;&#62; number;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;unsigned *prefix = new unsigned[ number ];</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for( unsigned i=0;i&#60;number;i++ )prefix[ i ] = 1; // маленькая фишка</div><div class="code_line">&nbsp;&nbsp;Analyze( number, number-1, prefix, 0 );</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;delete []prefix;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;cout &#60;&#60; endl &#60;&#60; &quot;Press any key...&quot;, getch();</div><div class="code_line">&nbsp;&nbsp;return 0;</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
теперь можно в блоке &quot;// Итерации&quot; функции Analyze использовать предзаполненные ячейки массива<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp;// Итерации</div><div class="code_line">&nbsp;&nbsp;for( unsigned i=rest &#60; step ? rest : step;i;--i ){</div><div class="code_line">&nbsp;&nbsp; &nbsp;prefix[ prefix_size ] = i;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if( i == 1 ){</div><div class="code_line">// сразу переходим к концу цикла с единицами!!</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Analyze( 0, i, prefix, prefix_size + (rest - i) + 1 );</div><div class="code_line">&nbsp;&nbsp; &nbsp;} else{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Analyze( rest - i, i, prefix, prefix_size + 1 );</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp;}</div></ol></div></div></div></div><br>
<br>
<br>
---<br>
Результаты без вывода на консоль для числа 75 мин:сек.доли_сек<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">trainer &nbsp; &nbsp; &nbsp;- 0:7.83</div><div class="code_line">tserega &nbsp; &nbsp; &nbsp;- 0:1.12</div><div class="code_line">experimenter - 1:13.8</div><div class="code_line">tserega2 &nbsp; &nbsp; - 0:1.35</div><div class="code_line">flex ferrum &nbsp;- 2:9.35</div></ol></div></div></div></div><br>
<br>
самый быстрый алгоритм у tserega :) запустил его на числе 120 и сравнил алгоритмом, что я описал выше<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">tserega &nbsp;- 5:2.49</div><div class="code_line">tserega2 - 6:31.83</div><div class="code_line">sazabis &nbsp;- 1:37.65</div></ol></div></div></div></div><br>
<br>
При росте числа - выгрыш растет в геометрической ? прогрессии :)<br>
<br>
Однако вариант предложенный trainer показал себя с наилучшей стороны и переплюнул все остальные почти в два раза  :yes:<br>
<br>
Но и его можно было улучшить используя данную &quot;фишку&quot;, только конкретно под этот вариант пришлось создать массив &quot;1+1+1+...+1&#092;n&#092;0&quot;; и подставлять в хвосты с соответствующим сдвигом :)<br>
<br>
время работы такого алгоритма для числа 75 - 0:1.30, для 120 - 4:54.3 ( набирает обороты при больших числах и обгоняет tserega :) )<br>
с выводом на эран обгоняет вариант trainer с разницей ~ в разницу работы алгоритмов.]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332243</guid>
        <pubDate>Mon, 05 Apr 2004 18:20:34 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332243</link>
        <description><![CDATA[redfred: Прошу мой вариант снять с конкурса. Он был нацарапан для примера, не претендовал на гениальность, и сразу оговаривалось, что не годится для больших чисел. Разумеется, более оптимальными являются решения, перебирающие не все возможные варианты, а только те которые по сумме совпадают :)]]></description>
        <author>redfred</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332128</guid>
        <pubDate>Mon, 05 Apr 2004 15:19:30 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332128</link>
        <description><![CDATA[tserega: А если без учета вывода на экран?]]></description>
        <author>tserega</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332114</guid>
        <pubDate>Mon, 05 Apr 2004 14:59:06 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=332114</link>
        <description><![CDATA[Sazabis: потестил на числе 40 хватило. Время в сек.доли_сек<br>
<br>
краткий обзор решений<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">redfred &nbsp; &nbsp; &nbsp;- недождался, нахождение решения медленние чем вывод на экран.</div><div class="code_line">trainer &nbsp; &nbsp; &nbsp;- 10.76</div><div class="code_line">tserega &nbsp; &nbsp; &nbsp;- 20.15</div><div class="code_line">experimenter - 20.53</div><div class="code_line">// спец. для tserega, другой вар, был прислан в приват</div><div class="code_line">tserega2 &nbsp; &nbsp; - 19.28</div><div class="code_line">flex ferrum &nbsp;- 19.64</div></ol></div></div></div></div><br>
<br>
Самым хитрым оказался trainer, он сразу формировал строку, а потом выводил на экран. В остальных случаях почти все время съедал вывод на экран. В варианте flex ferruma похоже все ушло на std::string, хотя для решения вполне достаточно 1 массива, вмещающего максимальный ряд.<br>
<br>
...<br>
еще добавлю коментарии завтра, сегодня уже мне пора.]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331731</guid>
        <pubDate>Mon, 05 Apr 2004 07:02:45 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331731</link>
        <description><![CDATA[Flex Ferrum: Ну, как еще один вариант:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;</div><div class="code_line">void DoSplit(int num, const std::string&amp; str, int max)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;char buff[16];</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;for (int n = min(max, num); n &#62; 0; n --)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;std::string tmp_str(str);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (!tmp_str.empty())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tmp_str +=&quot;+&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tmp_str += _itoa(n, buff, 10);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (n == num &amp;&amp; !str.empty())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;std::cout &#60;&#60; tmp_str &#60;&#60; std::endl;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DoSplit(num - n, tmp_str, n);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div><div class="code_line">void SplitInt(int num)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;DoSplit(num, &quot;&quot;, num);</div><div class="code_line">}</div></ol></div></div></div></div><br>
но эффективным его не назовешь...]]></description>
        <author>Flex Ferrum</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331693</guid>
        <pubDate>Mon, 05 Apr 2004 06:03:57 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331693</link>
        <description><![CDATA[Sazabis: Похоже вариантов больше не будет, сегодня подведу итоги и отпостю.]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331331</guid>
        <pubDate>Sun, 04 Apr 2004 07:44:35 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331331</link>
        <description><![CDATA[experimenter: а как оценивается эффективность? если я буду выводить резульат с пробелами, то может оказаться, что у меня программа как бы менее эффективна.<br>
тогда уж я их уберу<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;</div><div class="code_line">#include &#60;iostream&#62;</div><div class="code_line">#include &#60;vector&#62;</div><div class="code_line">#define MIN(a,b) a &#60; b ? a : b</div><div class="code_line">using namespace std;</div><div class="code_line">&nbsp;</div><div class="code_line">void ProduceSum(vector &#60;unsigned int&#62; &amp;n, unsigned int max);</div><div class="code_line">&nbsp;</div><div class="code_line">int main(int argc, char* argv[])</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;unsigned int num;</div><div class="code_line">&nbsp;&nbsp; &nbsp;vector &#60;unsigned int&#62; v;</div><div class="code_line">&nbsp;&nbsp; &nbsp;while(cin&#62;&#62;num)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; ProduceSum(v,num);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;return (0);</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">void ProduceSum(vector &#60;unsigned int&#62; &amp;n, unsigned int reminder)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;int i;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if(!reminder)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(n.size() == 1) return;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for(i = 0; i &#60; n.size() - 1; i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout&#60;&#60;n[i]&#60;&#60;&quot;+&quot;;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cout&#60;&#60;n[i]&#60;&#60;endl;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;unsigned int </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;newMax = (n.empty()) ? &nbsp;reminder : MIN(*(n.end() - 1), reminder);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for(i = 1; i &#60;= newMax; i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n.push_back(i); </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProduceSum(n, reminder - i);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n.erase(n.end() - 1);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">return;</div><div class="code_line">}</div></ol></div></div></div></div>]]></description>
        <author>experimenter</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331295</guid>
        <pubDate>Sun, 04 Apr 2004 06:15:33 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=331295</link>
        <description><![CDATA[trainer: Я так понимаю, вариантов больше не будет. :)<br>
<strong class='tag-b'>Sazabis</strong>, в качестве итога чего-нибудь скажешь?]]></description>
        <author>trainer</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328662</guid>
        <pubDate>Wed, 31 Mar 2004 14:22:35 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328662</link>
        <description><![CDATA[tserega: Мое решение (правда, выдает в обратном порядке):<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">#include &#60;iostream.h&#62;</div><div class="code_line">#define maxSize 10000</div><div class="code_line">&nbsp;</div><div class="code_line">void main() {</div><div class="code_line">&nbsp;&nbsp; &nbsp;long m[maxSize];</div><div class="code_line">&nbsp;&nbsp; &nbsp;long l = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;long N = 5;</div><div class="code_line">&nbsp;&nbsp; &nbsp;//Main code</div><div class="code_line">&nbsp;&nbsp; &nbsp;m[0] = N;</div><div class="code_line">&nbsp;&nbsp; &nbsp;while (1 == 1) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;int k = l;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;while (k &#62;= 0) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (m[k] &#62; 1) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;k--;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (k &#60; 0) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;m[k]--;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;long s = 1 + l - k;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;l = k;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;while (s &#62; 0) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;k++;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (s &#60; m[k - 1]) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m[k] = s;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m[k] = m[k - 1];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s -= m[k];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;l++;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (int i = 0; i &#60; l; i++) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cout &#60;&#60; m[i] &#60;&#60; &quot;+&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cout &#60;&#60; m[l] &#60;&#60; endl;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div>]]></description>
        <author>tserega</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328658</guid>
        <pubDate>Wed, 31 Mar 2004 14:18:58 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328658</link>
        <description><![CDATA[Sazabis: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>tserega</strong>, 31.03.04, 16:43<br>
Sazabis, какое ограничение по N? </div></div><br>
в общем нет, я просто посмотрю на цифре, на которой будет видна на глаз разница между разными алгоритмами<br>
<br>
я думаю больше 1000 не понадобится<br>
<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>tserega</strong>, 31.03.04, 16:43<br>
Ограничение по времени есть?</div></div><br>
<br>
тоже нет, просто сравню чей быстрее.<br>
Этот алгорим работает дольше чем больше цифра, потому все просто - если на 100 не будет видно разницы - запущу на 200<br>
<br>
Я олимпиадные задачки не вел, так что извиняюсь - все кустарным способом.<br>
зы Хотя было бы проще если все было в in.txt - out.txt и время работы проги...]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328626</guid>
        <pubDate>Wed, 31 Mar 2004 13:43:26 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328626</link>
        <description><![CDATA[tserega: <strong class='tag-b'>Sazabis</strong>, какое ограничение по N? Ограничение по времени есть?]]></description>
        <author>tserega</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328616</guid>
        <pubDate>Wed, 31 Mar 2004 13:35:05 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328616</link>
        <description><![CDATA[KAV: Будут, как только появится свободное время. Завтра на уроках, например :D]]></description>
        <author>KAV</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328528</guid>
        <pubDate>Wed, 31 Mar 2004 11:53:28 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328528</link>
        <description><![CDATA[Flex Ferrum: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>Sazabis</strong>, 31.03.04, 14:24<br>
2 ответа уже есть, будут еще желающие ? ( возможно реализовать более бысто ) </div></div><br>
Будут :)]]></description>
        <author>Flex Ferrum</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328498</guid>
        <pubDate>Wed, 31 Mar 2004 11:24:46 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328498</link>
        <description><![CDATA[Sazabis: 2 ответа уже есть, будут еще желающие ? ( возможно реализовать более бысто )]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328220</guid>
        <pubDate>Wed, 31 Mar 2004 04:13:19 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=328220</link>
        <description><![CDATA[trainer: Вот мой вариант.<br>Только не спрашивайте о том, как он работает. :D]]></description>
        <author>trainer</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327684</guid>
        <pubDate>Tue, 30 Mar 2004 13:04:54 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327684</link>
        <description><![CDATA[redfred: Верно. Каюсь. Небрежно закодировал :)<br>
<br>
Исправленный вариант:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">static int &nbsp; nN; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Заданное число.</div><div class="code_line">static int * pN; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Накопитель слагаемых.</div><div class="code_line">static int &nbsp; iN; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Счетчик накопителя.</div><div class="code_line">void GoProcedure( int x ); &nbsp;// Рекурсивная процедура.</div><div class="code_line">&nbsp;</div><div class="code_line">void ShowSumElems( int N )</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;nN = N;</div><div class="code_line">&nbsp;&nbsp;pN = new int[N+1];</div><div class="code_line">&nbsp;&nbsp;iN = 0;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for( int x=1; x&#60;N; x++ ) GoProcedure(x);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;delete pN;</div><div class="code_line">}//---------------------------------------------------------------------------</div><div class="code_line">&nbsp;</div><div class="code_line">int Sum() { int s=0; for( int i=0; i&#60;iN; i++ ) s += pN[i]; return s; }</div><div class="code_line">//---------------------------------------------------------------------------</div><div class="code_line">&nbsp;</div><div class="code_line">void GoProcedure( int x )</div><div class="code_line">{</div><div class="code_line">&nbsp;if(iN == nN) return; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Условия выхода из рекурсии.</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;pN[iN++] = x;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;if( nN == Sum() )</div><div class="code_line">&nbsp;&nbsp; {</div><div class="code_line">&nbsp;&nbsp; &nbsp; for( int i=0; i&#60;iN; i++ ) &nbsp; &nbsp; &nbsp; &nbsp; // Печатаем подходящий вариант.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if( i ) printf(&quot;+&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;%i&quot;,pN[i]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;\n&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto SKIP_RECURSION; &nbsp; &nbsp; &nbsp;// На зло противникам оператора goto :)</div><div class="code_line">&nbsp;&nbsp; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; for( int ix=x; ix &#60; nN; ix++ ) GoProcedure( ix ); // Выходим на следующую ступень рекурсии.</div><div class="code_line">&nbsp;</div><div class="code_line">SKIP_RECURSION: iN--;</div><div class="code_line">}//---------------------------------------------------------------------------</div></ol></div></div></div></div>]]></description>
        <author>redfred</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327666</guid>
        <pubDate>Tue, 30 Mar 2004 12:46:52 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327666</link>
        <description><![CDATA[Sazabis: <strong class='tag-b'>redfred</strong>, <br>
для 6:<br>
1+1+1+1+1+1<br>
1+1+1+1+2<br>
1+1+1+3<br>
1+1+2+2<br>
1+1+4<br>
1+2+3<br>
1+5<br>
<br>
например нет 3 + 3. 4 + 2 и т.д]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327640</guid>
        <pubDate>Tue, 30 Mar 2004 12:17:39 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327640</link>
        <description><![CDATA[redfred: Красивая задачка &#33;<br>
<br>
Для чисел N допускающих простой перебор вариантов сгодится такой рекурсивный вариант.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">static int &nbsp; nN; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Заданное число.</div><div class="code_line">static int * pN; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Накопитель слагаемых.</div><div class="code_line">static int &nbsp; iN; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Счетчик накопителя.</div><div class="code_line">void GoProcedure( int x ); &nbsp;// Рекурсивная процедура.</div><div class="code_line">&nbsp;</div><div class="code_line">void ShowSumElems( int N ) &nbsp;// РЕШЕНИЕ ЗАДАЧИ.</div><div class="code_line">{</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;nN = N;</div><div class="code_line">&nbsp;&nbsp;pN = new int[N+1];</div><div class="code_line">&nbsp;&nbsp;iN = 0;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;GoProcedure(1);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;delete pN;</div><div class="code_line">}//---------------------------------------------------------------------------</div><div class="code_line">&nbsp;</div><div class="code_line">int Sum() { int s=0; for( int i=0; i&#60;iN; i++ ) s += pN[i]; return s; }</div><div class="code_line">//---------------------------------------------------------------------------</div><div class="code_line">&nbsp;</div><div class="code_line">void GoProcedure( int x )</div><div class="code_line">{</div><div class="code_line">&nbsp;if(iN == nN) return; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Условия выхода из рекурсии.</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;pN[iN++] = x;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;if( nN == Sum() )</div><div class="code_line">&nbsp;&nbsp; {</div><div class="code_line">&nbsp;&nbsp; &nbsp; for( int i=0; i&#60;iN; i++ ) &nbsp; &nbsp; &nbsp; &nbsp; // Печатаем подходящий вариант.</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if( i ) printf(&quot;+&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;%i&quot;,pN[i]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;\n&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto SKIP_RECURSION; &nbsp; &nbsp; &nbsp;// На зло противникам оператора goto :)</div><div class="code_line">&nbsp;&nbsp; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; for( int ix=x; ix &#60; nN; ix++ ) GoProcedure( ix ); // Выходим на следующую ступень рекурсии.</div><div class="code_line">&nbsp;</div><div class="code_line">SKIP_RECURSION: iN--;</div><div class="code_line">}//---------------------------------------------------------------------------</div></ol></div></div></div></div><br>
<br>
Вариант перебирает N^N/2 вариантов. Думаю, на числе N=20 комп загнется. Для больших чисел нужны более изящные варианты :))]]></description>
        <author>redfred</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327588</guid>
        <pubDate>Tue, 30 Mar 2004 11:08:38 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327588</link>
        <description><![CDATA[Sazabis: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>trainer</strong>, 30.03.04, 13:55<br>
Комбинации, образованные перестановкой слагаемых - это один вариант или разные?<br>
Например, 1+2 и 2+1</div></div><br>
<br>
либо 1+2, либо 2+1<br>
<br>
аналогично для 4<br>
либо 2+1+1, либо 1+2+1, либо 1+1+2<br>
в ответе может быть только 1 вариант<br>
<br>
порядок не важен&#33; но так как проверятся это будет глазами :) желательно упорядоченно&#33;<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '><strong class='tag-b'>Lepricon</strong>, 30.03.04, 14:00<br>
N - натуральное или всё-таки целое? </div></div><br>
<br>
пусть N будет unsigned int ( все-таки программеры по своему цифры различают, нежели математики :) )]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327579</guid>
        <pubDate>Tue, 30 Mar 2004 11:00:22 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327579</link>
        <description><![CDATA[Lepricon: N - натуральное или всё-таки целое?]]></description>
        <author>Lepricon</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327575</guid>
        <pubDate>Tue, 30 Mar 2004 10:55:32 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327575</link>
        <description><![CDATA[trainer: Комбинации, образованные перестановкой слагаемых - это один вариант или разные?<br>Например, 1+2 и 2+1<br>Слагаемые в произвольном порядке или в порядке неубывания или возрастания?]]></description>
        <author>trainer</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327561</guid>
        <pubDate>Tue, 30 Mar 2004 10:37:34 +0000</pubDate>
        <title>Задача №4</title>
        <link>https://forum.sources.ru/index.php?showtopic=49720&amp;view=findpost&amp;p=327561</link>
        <description><![CDATA[Sazabis: Задача<br>Дано число от 1 до N, где N натуральное число.<br>Вывести на экран все возможные комбинации чисел ( от 1 до N-1 ) в сумме дающих заданное число. Формат вывода: &lt;число&gt;+&lt;число&gt;+ ... +&lt;число&gt;&lt;символ конца строки&gt;<br><br>Пример для числа 3<br>1+1+1<br>2+1<br><br>Пример для числа 5<br>1+1+1+1+1<br>2+1+1+1<br>2+2+1<br>3+2<br>3+1+1<br>4+1]]></description>
        <author>Sazabis</author>
        <category>Borland C++ Builder/Turbo C++ Explorer</category>
      </item>
	
      </channel>
      </rss>
	