<?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=170362&amp;view=findpost&amp;p=2648628</guid>
        <pubDate>Wed, 21 Jul 2010 05:25:20 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=2648628</link>
        <description><![CDATA[azard: всем привет&#33;&#33; времени прошло много, но, в целом, не помешает реализация алгоритма, предложенного Aloha, на Паскале (в Delphi)..<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; &nbsp; &nbsp; &nbsp; &nbsp;n</div><div class="code_line">&nbsp;&nbsp; +---+ = = = = = -------------</div><div class="code_line">&nbsp;&nbsp; | &nbsp; |</div><div class="code_line">&nbsp;&nbsp; | 1 | 1 2 3 4 5 </div><div class="code_line">&nbsp;&nbsp; | &nbsp; |</div><div class="code_line">&nbsp;&nbsp; +---+------------------------</div><div class="code_line">&nbsp;&nbsp; | &nbsp; |</div><div class="code_line">&nbsp;&nbsp; | &nbsp; | 11 12 13 14 15 </div><div class="code_line">&nbsp;m | 2 | 23 24 25 </div><div class="code_line">&nbsp;&nbsp; | &nbsp; | 34 35 </div><div class="code_line">&nbsp;&nbsp; | &nbsp; | 45 </div><div class="code_line">&nbsp;&nbsp; | &nbsp; |</div><div class="code_line">&nbsp;&nbsp; +---+------------------------</div><div class="code_line">&nbsp;&nbsp; | &nbsp; |</div><div class="code_line">&nbsp;&nbsp; | &nbsp; | 123 124 125 134 135 145 </div><div class="code_line">&nbsp;&nbsp; | 3 | 234 235 245 </div><div class="code_line">&nbsp;&nbsp; | &nbsp; | 345 </div><div class="code_line">&nbsp;&nbsp; | &nbsp; |</div><div class="code_line">&nbsp;&nbsp; +---+------------------------}</div><div class="code_line">&nbsp;</div><div class="code_line">uses</div><div class="code_line">&nbsp;&nbsp;SysUtils, Math;</div><div class="code_line">&nbsp;</div><div class="code_line">const</div><div class="code_line">&nbsp;&nbsp;m = 3; &nbsp; &nbsp; // количество знаков (см. рис.)</div><div class="code_line">&nbsp;&nbsp;n = 5; &nbsp; &nbsp; // количество битов, т.е. используемых символов (см. рис.)</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;i, &nbsp; &nbsp; &nbsp; &nbsp; // количество чисел 1..2^n - 1</div><div class="code_line">&nbsp;&nbsp;j, &nbsp; &nbsp; &nbsp; &nbsp; // количество битов 1..5</div><div class="code_line">&nbsp;&nbsp;k, &nbsp; &nbsp; &nbsp; &nbsp; // количество знаков 1..3 (1 12 123) </div><div class="code_line">&nbsp;&nbsp;l, &nbsp; &nbsp; &nbsp; &nbsp; // подсчет количества чисел</div><div class="code_line">&nbsp;&nbsp;c, &nbsp; &nbsp; &nbsp; &nbsp; // подсчет количества знаков</div><div class="code_line">&nbsp;&nbsp;b: Word; &nbsp; // значение бита 2^x ( 1 2 4 8 16 32 64 128 256 512)</div><div class="code_line">&nbsp;&nbsp;s: String;</div><div class="code_line">&nbsp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;l := Trunc(IntPower(2, n)) - 1; // 2^n - 1</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for k := 1 to m do &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// массив выводимого количества символов, чтобы группировать по длине</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for i := 1 to l do begin &nbsp; &nbsp; &nbsp; &nbsp;// массив количества чисел ( 2^n - 1)</div><div class="code_line">&nbsp;&nbsp; &nbsp;c := 0; s := &#39;&#39;;</div><div class="code_line">&nbsp;&nbsp; &nbsp;for j := 0 to n-1 do begin &nbsp; &nbsp;// массив количества битов</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;b := Trunc(IntPower(2, j)); // 2^j</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if (i and b = 0) then &nbsp; &nbsp; &nbsp; // проверка битов</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Continue;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Inc(c); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // увеличение количества знаков в строке</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;s := s + IntToStr(j+1); &nbsp; &nbsp; // формирование строки</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (c &#60;&#62; k) then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// проверка длины</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Continue;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;Writeln(s); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // вывод</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;Readln;</div><div class="code_line">end.</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
всех всем благ..]]></description>
        <author>azard</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1449278</guid>
        <pubDate>Sun, 11 Feb 2007 12:34:53 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1449278</link>
        <description><![CDATA[Stratocoder: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1448993'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Bug Hunter &#064; <time class="tag-quote__quoted-time" datetime="2007-02-10T21:08:26+00:00">10.02.07, 21:08</time></span><div class='quote '>Не знаю, почему ты здесь называешь перебор поиском то ли в глубину, то ли в <br>
ширину, но обойтись без использования очередей и ассоциативных массивов <br>
можно запросто</div></div><br>
И как ты предлагаешь это называть??? Твой код реализует типичный поиск в глубину, а мой - в ширину.]]></description>
        <author>Stratocoder</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1448993</guid>
        <pubDate>Sat, 10 Feb 2007 21:08:26 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1448993</link>
        <description><![CDATA[Bug Hunter: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441381'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Stratocoder &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T14:03:53+00:00">05.02.07, 14:03</time></span><div class='quote '>Это не может работать&#33; Здесь надо использовать либо поиск в глубину, либо в ширину. А таким простым алгоритмом не отделаешься. </div></div><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">#include &#60;iostream&#62;</div><div class="code_line">#include &#60;vector&#62;</div><div class="code_line">#include &#60;string&#62;</div><div class="code_line">&nbsp;</div><div class="code_line">using namespace std;</div><div class="code_line">&nbsp;</div><div class="code_line">vector&#60; char &#62; v;</div><div class="code_line">int n;</div><div class="code_line">&nbsp;</div><div class="code_line">void rf(string s, int k, int i)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;if (k &#62; 0) </div><div class="code_line">&nbsp;&nbsp; &nbsp;for (int j = i; j &#60; (n-(k-1)); ++j)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;rf(s+v[j], k-1, j+1);</div><div class="code_line">&nbsp;&nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;cout&#60;&#60;s&#60;&#60;endl;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">int main()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;cout&#60;&#60;&quot;n? &quot;; cin&#62;&#62;n;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;v.resize(n);</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp;cout&#60;&#60;&quot;v? &quot;;</div><div class="code_line">&nbsp;&nbsp;for (int i = 0; i &#60; n; ++i)</div><div class="code_line">&nbsp;&nbsp; &nbsp;сin&#62;&#62;v[i];</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for (int k = 1; k&#60;=n; ++k)</div><div class="code_line">&nbsp;&nbsp; &nbsp;rf(&quot;&quot;, k, 0);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;v.resize(0);</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp;return 0;</div><div class="code_line">}</div></ol></div></div></div></div><br>
Ку?]]></description>
        <author>Bug Hunter</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1448060</guid>
        <pubDate>Fri, 09 Feb 2007 16:03:08 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1448060</link>
        <description><![CDATA[bizar: <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">function struktura_array($mas) {</div><div class="code_line">$col_el = count($mas);</div><div class="code_line">$col_zn = pow(2,$col_el)-1;</div><div class="code_line">&nbsp;</div><div class="code_line">for ($i=1; $i &#60;= $col_zn; $i++) {</div><div class="code_line">&nbsp;$dlina_i_bin = decbin($i);</div><div class="code_line">&nbsp;$zap_str = str_pad($dlina_i_bin, $col_el, &quot;0&quot;, STR_PAD_LEFT);</div><div class="code_line">&nbsp;$zap_dop = strrev($zap_str);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;$dooh = array();</div><div class="code_line">&nbsp;for($j=0; $j &#60; $col_el; $j++) {</div><div class="code_line">&nbsp;$dooh[] = $zap_dop[$j];</div><div class="code_line">&nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;$d = 0; $a = &#39;&#39;;</div><div class="code_line">&nbsp;foreach ($dooh as $k=&#62;$v) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;if ($v == 1) {$a[] .= $mas[$d];}</div><div class="code_line">&nbsp;&nbsp; &nbsp;$d++;</div><div class="code_line">&nbsp;}</div><div class="code_line">&nbsp;$return[] = $a;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">return $return;</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
<br>
Aloha ну ты мэн то что надо +++]]></description>
        <author>bizar</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1443362</guid>
        <pubDate>Tue, 06 Feb 2007 20:16:17 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1443362</link>
        <description><![CDATA[Aloha: <strong class='tag-b'>bizar</strong><br>
<br>
Похожий вопрос здесь на форуме уже поднимался. Я тогда приводил (правда на другом форуме) такой алгоритм:<br>
Как уже отметил <strong class='tag-b'>MBo</strong> таких наборов будет 2^n – 1 (не считая 0).<br>
<br>
Для n=5:<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">_____________________________________________________________</div><div class="code_line">десятичные | двоичные | меняем &nbsp;| заменяем &nbsp; &nbsp; &nbsp; &nbsp;| результат</div><div class="code_line">от &nbsp;1 &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| порядок | значимый бит &nbsp; &nbsp;|</div><div class="code_line">до &nbsp;2^n - 1| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| битов &nbsp; | на его номер &nbsp; &nbsp;|</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; | (слева направо) |</div><div class="code_line">___________|__________|_________|_________________|__________</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 1 &nbsp; | &nbsp; &nbsp;00001 | &nbsp; 10000 | &nbsp; &nbsp; &nbsp; &nbsp;1.... &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp;1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 2 &nbsp; | &nbsp; &nbsp;00010 | &nbsp; 01000 | &nbsp; &nbsp; &nbsp; &nbsp;.2... &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp;2</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 3 &nbsp; | &nbsp; &nbsp;00011 | &nbsp; 11000 | &nbsp; &nbsp; &nbsp; &nbsp;12... &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 4 &nbsp; | &nbsp; &nbsp;00100 | &nbsp; 00100 | &nbsp; &nbsp; &nbsp; &nbsp;..3.. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp;3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 5 &nbsp; | &nbsp; &nbsp;00101 | &nbsp; 10100 | &nbsp; &nbsp; &nbsp; &nbsp;1.3.. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 13</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 6 &nbsp; | &nbsp; &nbsp;00110 | &nbsp; 01100 | &nbsp; &nbsp; &nbsp; &nbsp;.23.. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 23</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 7 &nbsp; | &nbsp; &nbsp;00111 | &nbsp; 11100 | &nbsp; &nbsp; &nbsp; &nbsp;123.. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;123</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 8 &nbsp; | &nbsp; &nbsp;01000 | &nbsp; 00010 | &nbsp; &nbsp; &nbsp; &nbsp;...4. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp;4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; 9 &nbsp; | &nbsp; &nbsp;01001 | &nbsp; 10010 | &nbsp; &nbsp; &nbsp; &nbsp;1..4. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;10 &nbsp; | &nbsp; &nbsp;01010 | &nbsp; 01010 | &nbsp; &nbsp; &nbsp; &nbsp;.2.4. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 24</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;11 &nbsp; | &nbsp; &nbsp;01011 | &nbsp; 11010 | &nbsp; &nbsp; &nbsp; &nbsp;12.4. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;124</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;12 &nbsp; | &nbsp; &nbsp;01100 | &nbsp; 00110 | &nbsp; &nbsp; &nbsp; &nbsp;..34. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 34</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;13 &nbsp; | &nbsp; &nbsp;01101 | &nbsp; 10110 | &nbsp; &nbsp; &nbsp; &nbsp;1.34. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;134</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;14 &nbsp; | &nbsp; &nbsp;01110 | &nbsp; 01110 | &nbsp; &nbsp; &nbsp; &nbsp;.234. &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;234</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;15 &nbsp; | &nbsp; &nbsp;01111 | &nbsp; 11110 | &nbsp; &nbsp; &nbsp; &nbsp;1234. &nbsp; &nbsp;| &nbsp; &nbsp; 1234</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;16 &nbsp; | &nbsp; &nbsp;10000 | &nbsp; 00001 | &nbsp; &nbsp; &nbsp; &nbsp;....5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp;5</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;17 &nbsp; | &nbsp; &nbsp;10001 | &nbsp; 10001 | &nbsp; &nbsp; &nbsp; &nbsp;1...5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 15</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;18 &nbsp; | &nbsp; &nbsp;10010 | &nbsp; 01001 | &nbsp; &nbsp; &nbsp; &nbsp;.2..5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 25</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;19 &nbsp; | &nbsp; &nbsp;10011 | &nbsp; 11001 | &nbsp; &nbsp; &nbsp; &nbsp;12..5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;125</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;20 &nbsp; | &nbsp; &nbsp;10100 | &nbsp; 00101 | &nbsp; &nbsp; &nbsp; &nbsp;..3.5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 35</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;21 &nbsp; | &nbsp; &nbsp;10101 | &nbsp; 10101 | &nbsp; &nbsp; &nbsp; &nbsp;1.3.5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;135</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;22 &nbsp; | &nbsp; &nbsp;10110 | &nbsp; 01101 | &nbsp; &nbsp; &nbsp; &nbsp;.23.5 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;235</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;23 &nbsp; | &nbsp; &nbsp;10111 | &nbsp; 11101 | &nbsp; &nbsp; &nbsp; &nbsp;123.5 &nbsp; &nbsp;| &nbsp; &nbsp; 1235</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;24 &nbsp; | &nbsp; &nbsp;11000 | &nbsp; 00011 | &nbsp; &nbsp; &nbsp; &nbsp;...45 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; 45</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;25 &nbsp; | &nbsp; &nbsp;11001 | &nbsp; 10011 | &nbsp; &nbsp; &nbsp; &nbsp;1..45 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;145</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;26 &nbsp; | &nbsp; &nbsp;11010 | &nbsp; 01011 | &nbsp; &nbsp; &nbsp; &nbsp;.2.45 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;245</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;27 &nbsp; | &nbsp; &nbsp;11011 | &nbsp; 11011 | &nbsp; &nbsp; &nbsp; &nbsp;12.45 &nbsp; &nbsp;| &nbsp; &nbsp; 1245</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;28 &nbsp; | &nbsp; &nbsp;11100 | &nbsp; 00111 | &nbsp; &nbsp; &nbsp; &nbsp;..345 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;345</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;29 &nbsp; | &nbsp; &nbsp;11101 | &nbsp; 10111 | &nbsp; &nbsp; &nbsp; &nbsp;1.345 &nbsp; &nbsp;| &nbsp; &nbsp; 1345</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;30 &nbsp; | &nbsp; &nbsp;11110 | &nbsp; 01111 | &nbsp; &nbsp; &nbsp; &nbsp;.2345 &nbsp; &nbsp;| &nbsp; &nbsp; 2345</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;31 &nbsp; | &nbsp; &nbsp;11111 | &nbsp; 11111 | &nbsp; &nbsp; &nbsp; &nbsp;12345 &nbsp; &nbsp;| &nbsp; &nbsp;12345</div></ol></div></div></div></div><br>
остается отсортировать по возрастанию.]]></description>
        <author>Aloha</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1443171</guid>
        <pubDate>Tue, 06 Feb 2007 17:47:49 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1443171</link>
        <description><![CDATA[TheBug: Сочетания они и есть. Конечно не в чистом виде<br>Только надо в цикле по i=1..n выводить все C_n^k в лексикографическом порядке.]]></description>
        <author>TheBug</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1443057</guid>
        <pubDate>Tue, 06 Feb 2007 16:19:21 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1443057</link>
        <description><![CDATA[Bug Hunter: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441410'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>bizar &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T14:19:09+00:00">05.02.07, 14:19</time></span><div class='quote '>Да сложновато разобраться в ++ , не так хорошо знаю программирование. Всёж благодарен. Теперь нужно это добро в php переделать но сначала разобрать что куда. </div></div><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">const</div><div class="code_line">&nbsp;&nbsp;n = 5;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;a: array[1..n] of char;</div><div class="code_line">&nbsp;&nbsp;i, j, k: integer;</div><div class="code_line">&nbsp;&nbsp;s: string[n];</div><div class="code_line">&nbsp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;for j:=1 to n do a[j]:=chr(ord(&#39;0&#39;)+j);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for k:=1 to n do begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (k=1) then begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;write(a[1]); for j:=2 to n do write(&#39; &#39;, a[j]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;writeln;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end</div><div class="code_line">&nbsp;&nbsp; &nbsp;else begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;for i:=1 to n-(k-1) do begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;s:=&#39;&#39;; for j:=i to i+(k-1) do s:=s+a[j]; write(s);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for j:=k+i to n do begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s[k]:=a[j]; write(&#39; &#39;, s);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;writeln;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;writeln;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;readln;</div><div class="code_line">end.</div></ol></div></div></div></div><br>
<br>
Делает именно то, что ты писал в #3. <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-06T17:17:08+00:00">06.02.07, 17:17</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441376'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>bizar &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T14:00:59+00:00">05.02.07, 14:00</time></span><div class='quote '>Цитата (MakedoneZ @ Вчера, 16:31)<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">procedure GetCombs(n: Word);</div><div class="code_line">...</div></ol></div></div></div></div><br>
Можно комент. я на php переделаю. </div></div><br>
Можешь не париться - оно не то делает.]]></description>
        <author>Bug Hunter</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441410</guid>
        <pubDate>Mon, 05 Feb 2007 14:19:09 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441410</link>
        <description><![CDATA[bizar: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441332'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Stratocoder &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T13:41:10+00:00">05.02.07, 13:41</time></span><div class='quote '>#include &lt;vector&gt;<br>
#include &lt;map&gt;<br>
#include &lt;string&gt;<br>
#include &lt;iostream&gt;<br>
#include &lt;queue&gt;<br>
<br>
using namespace std;<br>
<br>
int main()<br>
{<br>
  vector&lt; char &gt; v;<br>
  map&lt; char, int &gt; mp;<br>
  int n;<br>
  cin&gt;&gt;n;<br>
  v.resize(n);<br>
  for (int i = 0; i &lt; n; ++i)<br>
  {<br>
    cin&gt;&gt;v[i];<br>
    mp[v[i]] = i;<br>
  }<br>
  queue&lt; string &gt; q;<br>
  for (int i = 0; i &lt; v.size(); ++i)<br>
    q.push(string() + v[i]);<br>
  while(&#33;q.empty())<br>
  {<br>
    string cur = q.front();<br>
    q.pop();<br>
    cout&lt;&lt;cur&lt;&lt;endl;<br>
    for (int i = mp[cur[cur.size() - 1]] + 1; i &lt; n; ++i)<br>
      q.push(cur + v[i]);<br>
  }<br>
  return 0;<br>
}</div></div><br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441381'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Stratocoder &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T14:03:53+00:00">05.02.07, 14:03</time></span><div class='quote '>&lt;vector&gt; - по сути массив, можно заменить<br>
&lt;map&gt; - ассоциативный массив, ставим в соответствие символу его индекс в массиве<br>
&lt;string&gt; - строки... это понятно<br>
&lt;iostream&gt; - ввод/вывод<br>
&lt;queue&gt; - очередь </div></div><br>
Да сложновато разобраться в ++ , не так хорошо знаю программирование. Всёж благодарен. Теперь нужно это добро в php переделать но сначала разобрать что куда.]]></description>
        <author>bizar</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441381</guid>
        <pubDate>Mon, 05 Feb 2007 14:03:53 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441381</link>
        <description><![CDATA[Stratocoder: &lt;vector&gt; - по сути массив, можно заменить<br>
&lt;map&gt; - ассоциативный массив, ставим в соответствие символу его индекс в массиве<br>
&lt;string&gt; - строки... это понятно<br>
&lt;iostream&gt; - ввод/вывод<br>
&lt;queue&gt; - очередь <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>-Added <time class="tag-mergetime" datetime="2007-02-05T14:09:40+00:00">05.02.07, 14:09</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441314'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>MakedoneZ &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T13:31:04+00:00">05.02.07, 13:31</time></span><div class='quote '><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">procedure GetCombs(n: Word);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;i,j,z: Word;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;h: ShortString;</div><div class="code_line">&nbsp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;h := &#39;&#39;;</div><div class="code_line">&nbsp;&nbsp;for z := 1 to n do</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;for i := z to n-1 do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for j := i+1 to n do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowMessage(h + IntToStr(i) + IntToStr(j));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;h := h + IntToStr(z);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">end;</div></ol></div></div></div></div></div></div><br>
Это не может работать&#33; Здесь надо использовать либо поиск в глубину, либо в ширину. А таким простым алгоритмом не отделаешься.]]></description>
        <author>Stratocoder</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441376</guid>
        <pubDate>Mon, 05 Feb 2007 14:00:59 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441376</link>
        <description><![CDATA[bizar: мне на php надо в ++ не селён для чего библиотеки &lt;vector&gt; . . . &lt;queue&gt; не знаю. <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-05T14:03:38+00:00">05.02.07, 14:03</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441314'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>MakedoneZ &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T13:31:04+00:00">05.02.07, 13:31</time></span><div class='quote '>procedure GetCombs(n: Word);<br>
var<br>
  i,j,z: Word;<br>
      h: ShortString;<br>
<br>
begin<br>
  h := &#39;&#39;;<br>
  for z := 1 to n do<br>
    begin<br>
      for i := z to n-1 do<br>
        for j := i+1 to n do<br>
          ShowMessage(h + IntToStr(i) + IntToStr(j));<br>
      h := h + IntToStr(z);<br>
    end;<br>
end;</div></div><br>
Можно комент. я на php переделаю.]]></description>
        <author>bizar</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441332</guid>
        <pubDate>Mon, 05 Feb 2007 13:41:10 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441332</link>
        <description><![CDATA[Stratocoder: Кривовато правда. Написал лишь бы работало - спешу.<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">#include &#60;vector&#62;</div><div class="code_line">#include &#60;map&#62;</div><div class="code_line">#include &#60;string&#62;</div><div class="code_line">#include &#60;iostream&#62;</div><div class="code_line">#include &#60;queue&#62;</div><div class="code_line">&nbsp;</div><div class="code_line">using namespace std;</div><div class="code_line">&nbsp;</div><div class="code_line">int main()</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;vector&#60; char &#62; v;</div><div class="code_line">&nbsp;&nbsp;map&#60; char, int &#62; mp;</div><div class="code_line">&nbsp;&nbsp;int n;</div><div class="code_line">&nbsp;&nbsp;cin&#62;&#62;n;</div><div class="code_line">&nbsp;&nbsp;v.resize(n);</div><div class="code_line">&nbsp;&nbsp;for (int i = 0; i &#60; n; ++i)</div><div class="code_line">&nbsp;&nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp;cin&#62;&#62;v[i];</div><div class="code_line">&nbsp;&nbsp; &nbsp;mp[v[i]] = i;</div><div class="code_line">&nbsp;&nbsp;}</div><div class="code_line">&nbsp;&nbsp;queue&#60; string &#62; q;</div><div class="code_line">&nbsp;&nbsp;for (int i = 0; i &#60; v.size(); ++i)</div><div class="code_line">&nbsp;&nbsp; &nbsp;q.push(string() + v[i]);</div><div class="code_line">&nbsp;&nbsp;while(!q.empty())</div><div class="code_line">&nbsp;&nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp;string cur = q.front();</div><div class="code_line">&nbsp;&nbsp; &nbsp;q.pop();</div><div class="code_line">&nbsp;&nbsp; &nbsp;cout&#60;&#60;cur&#60;&#60;endl;</div><div class="code_line">&nbsp;&nbsp; &nbsp;for (int i = mp[cur[cur.size() - 1]] + 1; i &#60; n; ++i)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;q.push(cur + v[i]);</div><div class="code_line">&nbsp;&nbsp;}</div><div class="code_line">&nbsp;&nbsp;return 0;</div><div class="code_line">}</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-05T13:44:39+00:00">05.02.07, 13:44</time></span></span><br>
Компилил на g++]]></description>
        <author>Stratocoder</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441331</guid>
        <pubDate>Mon, 05 Feb 2007 13:40:46 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441331</link>
        <description><![CDATA[MBo: таких наборов для N элементов будет 2^N-1 (если не учитывать пустой набор), так что просто пробегаем в цикле от 1 до 2^N, на каждой итерации выводя те элементы из набора, для которых в счетчике цикла биты единичные.]]></description>
        <author>MBo</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441314</guid>
        <pubDate>Mon, 05 Feb 2007 13:31:04 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441314</link>
        <description><![CDATA[MakedoneZ: <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">procedure GetCombs(n: Word);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;i,j,z: Word;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;h: ShortString;</div><div class="code_line">&nbsp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;h := &#39;&#39;;</div><div class="code_line">&nbsp;&nbsp;for z := 1 to n do</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;for i := z to n-1 do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for j := i+1 to n do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowMessage(h + IntToStr(i) + IntToStr(j));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;h := h + IntToStr(z);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">end;</div></ol></div></div></div></div><br>
<br>
Проверь-ка... <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-05T13:32:21+00:00">05.02.07, 13:32</time></span></span><br>
Черновой вариант...<br>
Ща подправлю...]]></description>
        <author>MakedoneZ</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441301</guid>
        <pubDate>Mon, 05 Feb 2007 13:21:08 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441301</link>
        <description><![CDATA[bizar: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441245'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>MakedoneZ &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T12:50:01+00:00">05.02.07, 12:50</time></span><div class='quote '>for i := 0 to n-1 do<br>
  for j := i + 1 to n do<br>
    WriteLn(i,j);<br>
<br>
<br>
<br>
Это для первого блока. </div></div><br>
Мне нужно что выставлялась для любого количества блоков.<br>
Первое мы можем определять количество блоков.<br>
А потом формировать это для каждого блока. Вопрос только как? <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-05T13:24:27+00:00">05.02.07, 13:24</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441297'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Stratocoder &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T13:20:19+00:00">05.02.07, 13:20</time></span><div class='quote '>Поиск в ширину. Заводим очередь строк. Сначала забиваем в очередь даные символы. А потом на каждом шаге запоминаем текущую строку, а в очередь ложим все строки полученные путем прибавления в конец текущей строки поочередно одного из символов, которые следуют в начальном массиве после последнего в текущей строке. </div></div><br>
А программно показать можешь?]]></description>
        <author>bizar</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441299</guid>
        <pubDate>Mon, 05 Feb 2007 13:21:03 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441299</link>
        <description><![CDATA[esperanto: Ок вот программа<br><br><br><br>int main() {<br><br><br>printf(&quot;1<br>2<br>3<br>12<br>13<br>23<br>123<br>&quot;);]]></description>
        <author>esperanto</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441297</guid>
        <pubDate>Mon, 05 Feb 2007 13:20:19 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441297</link>
        <description><![CDATA[Stratocoder: Поиск в ширину. Заводим очередь строк. Сначала забиваем в очередь даные символы. А потом на каждом шаге запоминаем текущую строку, а в очередь ложим все строки полученные путем прибавления в конец текущей строки поочередно одного из символов, которые следуют в начальном массиве после последнего в текущей строке.]]></description>
        <author>Stratocoder</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441275</guid>
        <pubDate>Mon, 05 Feb 2007 13:06:18 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441275</link>
        <description><![CDATA[MIF: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441239'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>bizar &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T12:45:54+00:00">05.02.07, 12:45</time></span><div class='quote '>1 2 3 4 5<br>
<br>
12 13 14 15<br>
23 24 25<br>
34 35<br>
45<br>
<br>
123 124 125<br>
234 235<br>
345<br>
<br>
1234 1235<br>
2345<br>
<br>
12345</div></div><br>
Это - что то из комбинаторикаи, если добавить несколько элементов (134, 135, 145, 245, 1245,1345). Однако, я ее забыл.]]></description>
        <author>MIF</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441245</guid>
        <pubDate>Mon, 05 Feb 2007 12:50:01 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441245</link>
        <description><![CDATA[MakedoneZ: <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">for i := 0 to n-1 do</div><div class="code_line">&nbsp;&nbsp;for j := i + 1 to n do</div><div class="code_line">&nbsp;&nbsp; &nbsp;WriteLn(i,j);</div></ol></div></div></div></div><br>
<br>
Это для первого блока.]]></description>
        <author>MakedoneZ</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441239</guid>
        <pubDate>Mon, 05 Feb 2007 12:45:54 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441239</link>
        <description><![CDATA[bizar: Вот как в принципе выглядит но алгоритмом записать не могу придумать.<br>
Array (1=&gt;&quot;1&quot;, 2=&gt;&quot;2&quot;, 3=&gt;&quot;3&quot;,  4=&gt;&quot;4&quot;, 5=&gt;&quot;5&quot;)<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">1 2 3 4 5</div><div class="code_line">&nbsp;</div><div class="code_line">12 13 14 15</div><div class="code_line">23 24 25</div><div class="code_line">34 35</div><div class="code_line">45</div><div class="code_line">&nbsp;</div><div class="code_line">123 124 125</div><div class="code_line">234 235</div><div class="code_line">345</div><div class="code_line">&nbsp;</div><div class="code_line">1234 1235</div><div class="code_line">2345</div><div class="code_line">&nbsp;</div><div class="code_line">12345</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2007-02-05T12:47:26+00:00">05.02.07, 12:47</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441235'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>MakedoneZ &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T12:43:58+00:00">05.02.07, 12:43</time></span><div class='quote '>Если элементов надо выдать штук 10 000,то конечно пиши алгоритм.<br>
Если 7,то нахрен надо морочится?</div></div><br>
Да, нужно будет 10 000.]]></description>
        <author>bizar</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441235</guid>
        <pubDate>Mon, 05 Feb 2007 12:43:58 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441235</link>
        <description><![CDATA[MakedoneZ: Индекс элемента массива,равен значению элемента с этим индексом.Так<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441222'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>bizar &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T12:35:41+00:00">05.02.07, 12:35</time></span><div class='quote '>Нужен алгоритм?? </div></div><br>
Алгоритм есть некая конечная последовательность выполнения инструкций,причем имеющая некую закономерность.<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=170362&view=findpost&p=1441222'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>bizar &#064; <time class="tag-quote__quoted-time" datetime="2007-02-05T12:35:41+00:00">05.02.07, 12:35</time></span><div class='quote '><br>
1<br>
2<br>
3<br>
12<br>
13<br>
23<br>
123</div></div><br>
Тут как я понимаю,есть закономерность.Некие сочитания.<br>
В данном случае надо исходить из того,чего будет выше,затрат на написание алгоритма,или выгоды от него.<br>
<br>
Если элементов надо выдать штук 10 000,то конечно пиши алгоритм.<br>
Если 7,то нахрен надо морочится?<br>
Юзеру наплевать как выполнена программа...]]></description>
        <author>MakedoneZ</author>
        <category>Алгоритмы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441222</guid>
        <pubDate>Mon, 05 Feb 2007 12:35:41 +0000</pubDate>
        <title>Алгоритм возможных значений</title>
        <link>https://forum.sources.ru/index.php?showtopic=170362&amp;view=findpost&amp;p=1441222</link>
        <description><![CDATA[bizar: Допустим у нас имеется массив array(1=&gt;&quot;1&quot;, 2=&gt;&quot;2&quot;, 3=&gt;&quot;3&quot;)<br>Алгоритм должен выдать следующее:<br>1<br>2<br>3<br>12<br>13<br>23<br>123<br>Нужен алгоритм??]]></description>
        <author>bizar</author>
        <category>Алгоритмы</category>
      </item>
	
      </channel>
      </rss>
	