<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Ahoj,<br>
napred me napadlo take binarni deleni, ale pak me pod vlivem dalsich
prispevku napadlo neco jineho. Nahore se spoji postupne jeden (ten se
necha byt), dva, tri ctyri... az vsechny dojdou. Dole se vezme jeden a
k nemu se prozvoni vsechny ostatni. Ty, ktere pipaji, se spoji do
skupiny a dale se hleda jen mezi zbytkem. Tim dole identifikujeme
samostatny drat, dvojici, trojici atd. <br>
V kazde skupine pak pokracujeme rekurzivne, ale uz muzeme projit
vsechny skupiny zaroven na jednu cestu nahoru a dolu.<br>
Nakonec zbydou dvojice, ktere prozvonime proti prvnimu samostatnemu
dratu.<br>
<br>
Priklad pro N=21:<br>
<br>
1. krok: (1) (23) (456) (789A) (BCDEF) (GHIJKL)<br>
2. krok: (1) (23) (4) (56) (7) (89A) (BC) (DEF) (G) (HI) (JKL)<br>
3. krok: (1) (23) (4) (56) (7) (8) (9A) (BC) (D) (EF) (G) (HI) (J) (KL)<br>
4. krok (1259BEHK) (3) (6) (A) (C) (F) (I) (L)<br>
<br>
Je to tedy na 4 kroky a to bude lepsi nez puleni intervalu.<br>
<br>
Pro jina N nez je soucet rady prirozenych cisel by se musely brat vetsi
skupiny, aby zbytek nekolidoval s uz existujici skupinou stejne
velikosti:<br>
<br>
(1) (23) (45) -> nelze, jednoznacne je (12) (345), kde ale naroste
slozitost o jeden krok. Tech 21 jsem zvolil, protoze vychazi pekne.<br>
<br>
Snad jsem neudelal nejakou botu. Doufam, ze se mi ted povede vypnout
hlavu a usnout :-)<br>
<br>
Lada<br>
<br>
<br>
On 17.8.2012 16:16, Jaroslav Meduna wrote:
<blockquote cite="mid:011001cd7c82$ec1a9450$c44fbcf0$@mikroklima.cz"
type="cite">
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.StylE-mailovZprvy17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1789742147;
        mso-list-type:hybrid;
        mso-list-template-ids:-584676848 1377363854 67436547 67436549 67436545 67436547 67436549 67436545 67436547 67436549;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-CA">Sice tu uz bylo pekne patecni
(ctvrtecni) vlakno, ale neodpustim si vzpominku na skolu, kde jsem
vystudoval a zverejnim tu jednu tamni peknou elektrikarskou ulohu:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent: -18pt;"><!--[if !supportLists]--><span
lang="EN-CA"><span style="">-<span
style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">
</span></span></span><!--[endif]--><span lang="EN-CA">predstavte si,
ze jste elektrikar ve vyskove budove (desitky pater)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent: -18pt;"><!--[if !supportLists]--><span
lang="EN-CA"><span style="">-<span
style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">
</span></span></span><!--[endif]--><span lang="EN-CA">nejde proud,
asi i proto, ze se rozbil hlavni kabelovy svazek, citajici N vodicu
(budeme jim dale rikat draty)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent: -18pt;"><!--[if !supportLists]--><span
lang="EN-CA"><span style="">-<span
style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">
</span></span></span><!--[endif]--><span lang="EN-CA">kabelovy svazek
N dratu vede z prizemi az do posledniho patra<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent: -18pt;"><!--[if !supportLists]--><span
lang="EN-CA"><span style="">-<span
style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">
</span></span></span><!--[endif]--><span lang="EN-CA">v poslednim
patre muzete delat libovolne zkraty (napriklad spojit dva vodice, nebo
treba vsechny)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent: -18pt;"><!--[if !supportLists]--><span
lang="EN-CA"><span style="">-<span
style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">
</span></span></span><!--[endif]--><span lang="EN-CA">v prizemi
muzete merit, ktere vodice jsou spojeny<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent: -18pt;"><!--[if !supportLists]--><span
lang="EN-CA"><span style="">-<span
style="font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">
</span></span></span><!--[endif]--><span lang="EN-CA">vytah nejezdi,
proto je cilem minimalizovat pocet cest nahoru a dolu<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Ukolem je najit nejlepsi
algoritmus k identifikaci dratu tak, aby je slo oznacit od 1 do N v
prizemi i v poslednim patre.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">JM<o:p></o:p></span></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
HW-list mailing list - sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
</blockquote>
</body>
</html>