<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-719006376003785905</id><updated>2024-08-28T08:05:51.431+02:00</updated><category term="Esercizi C++"/><category term="Linux"/><category term="Ubuntu"/><category term="O.S."/><category term="Open Source"/><category term="Sviluppo"/><category term="C++"/><category term="Windows"/><category term="web"/><category term="Android"/><category term="HTML"/><category term="Ripristino"/><category term="grafica"/><category term="Boot"/><category term="CAD"/><category term="ROM"/><category term="Ubuntu Touch"/><category term="Chrome"/><category term="Code Blocks"/><category term="Firefox"/><category term="GRUB"/><category term="JS"/><category term="Raspberry"/><category term="UDOO"/><category term="XAMMP"/><category term="musica"/><title type='text'>Info Guide</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14423819907305476067</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>69</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-2830378003120305881</id><published>2014-08-07T18:19:00.001+02:00</published><updated>2014-08-07T18:19:08.595+02:00</updated><title type='text'>ATTENZIONE</title><content type='html'>&lt;span style=&quot;font-size: x-large;&quot;&gt;ATTENZIONE!!!!!!!!!!!!!!!!!!!!!!!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;ci siamo trasferiti a :&lt;a href=&quot;http://dakation.altervista.org/infoguide/&quot;&gt;&amp;nbsp;http://dakation.altervista.org/infoguide/&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/2830378003120305881/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/08/attenzione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2830378003120305881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2830378003120305881'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/08/attenzione.html' title='ATTENZIONE'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-8081285903564700154</id><published>2014-07-19T14:16:00.001+02:00</published><updated>2014-07-19T14:16:33.717+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grafica"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Convertire un pdf in bianco e nero in un comando con Linux</title><content type='html'>Grazie al software opensource To Black and White potremmo convertire i nostri documenti in bianco e nero in pochi secondi:&lt;br /&gt;
&lt;br /&gt;
Installiamo To Black and White:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo add-apt-repository ppa:dpd-/ppa -y&lt;br /&gt;sudo apt-get update -y&lt;br /&gt;sudo apt-get install tobw -y&lt;/blockquote&gt;
L&#39;utilizzo è semplice:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
tobw file.pdf&lt;/blockquote&gt;
E otterremo il file risultante nella stessa cartella dell&#39;input.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;&lt;/blockquote&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/8081285903564700154/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/07/convertire-un-pdf-in-bianco-e-nero-in.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/8081285903564700154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/8081285903564700154'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/07/convertire-un-pdf-in-bianco-e-nero-in.html' title='Convertire un pdf in bianco e nero in un comando con Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-6450046565934473862</id><published>2014-07-19T13:16:00.001+02:00</published><updated>2014-07-21T09:58:52.590+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="Sviluppo"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Creare un pacchetto e pubblicarlo su Launchpad</title><content type='html'>Abbiamo realizzato un programma in bash, c, c++, python, gambas, .... e vogliamo pubblicarlo? ecco come si fa:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Inanzitutto compiliamo il nostro file come script eseguibile senza dargli l&#39;estensione &quot;.sh&quot;.&lt;br /&gt;
Il nome che scegliamo è importante in quanto sarà il shortname con cui richiameremo il programma dal terminale: se salviamo il file come &quot;app&quot; nel terminale sarà:&lt;br /&gt;
utente@pc:~$app&lt;br /&gt;
Questo implica il fatto che il nostro programma potrebbe avere problemi se si chiama come iun altro programma di un altro sviluppatore!&lt;br /&gt;
&lt;br /&gt;
Bene ora si comincia: creiamo le seguenti cartelle (i nomi in corsivo sono a vostra scelta):&lt;br /&gt;
$ cd ~&lt;br /&gt;
$ mkdir &lt;i&gt;pacchetti&lt;/i&gt;&lt;br /&gt;
$ cd&lt;i&gt; pacchetti&lt;/i&gt;&lt;br /&gt;
$ mkdir &lt;i&gt;app&lt;/i&gt;-1.0.0&lt;br /&gt;
$ cd &lt;i&gt;app&lt;/i&gt;-1.0.0&lt;br /&gt;
&lt;br /&gt;
Ora creiamo lo scheletro del pacchetto con debhelper:&lt;br /&gt;
$ dh_make -n&lt;br /&gt;
&lt;br /&gt;
rispondiamo &quot;s&quot; alla prima domanda (stiamo creando un pacchetto singolo) e premiamo &quot;invio&quot; alla seconda domanda per accettare i suggerimenti su e-mail, nome del maintainer, licenza, ...&lt;br /&gt;
A questo punto si può notare che è stata creata una directory &quot;debian&quot;.&lt;br /&gt;
&lt;br /&gt;
In parte alla cartella &quot;debian&quot; creiamo una cartella &quot;script&quot; dove metteremo i nostri eseguibili.&lt;br /&gt;
Assicuriamoci che essi abbiamo i corretti permessi di esecuzione:&lt;br /&gt;
$ chmod 755 script1 script2....&lt;br /&gt;
&lt;br /&gt;
Ora entriamo nella cartella &quot;debian&quot;:&lt;br /&gt;
&lt;u&gt;file control:&lt;/u&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Source: &lt;i&gt;app&amp;nbsp;&lt;/i&gt;Section: &lt;i&gt;utils&lt;/i&gt;&lt;br /&gt;
Priority: optional&lt;br /&gt;
Maintainer: &lt;i&gt;Nome Cognome &lt;/i&gt;&amp;lt;&lt;i&gt;mail&lt;/i&gt;&amp;gt;&lt;br /&gt;
Build-Depends: debhelper (&amp;gt;= 8.0.0)&lt;br /&gt;
Standards-Version: 3.9.4&lt;br /&gt;
Homepage:&lt;br /&gt;
Package: tobw&lt;br /&gt;
Architecture: all&lt;br /&gt;
Description: &lt;i&gt;Descrizione breve&lt;/i&gt;&amp;nbsp;&lt;i&gt;Descrizione lunga&lt;/i&gt;&lt;i&gt;&amp;nbsp;Usare lo spazio a inizio riga per la descrizione&lt;/i&gt;&lt;/blockquote&gt;
&amp;nbsp;Se abbiamo bisogno di dipendenze possiamo aggiungerle: Depends: &lt;i&gt;ghostscript &lt;/i&gt;(&amp;gt;=&lt;i&gt;1.0.0&lt;/i&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;file changelog&lt;/u&gt;&lt;br /&gt;
Qui dobbiamo cambiare la scritta unstable (o stable) con la versione attuale di Ubuntu (es.: &lt;i&gt;trusty&lt;/i&gt;)&lt;br /&gt;
&lt;br /&gt;
Ora creiamo un file install dove scriveremo:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: monospace, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 14.300000190734863px;&quot;&gt;script/* usr/bin/&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
A indicare che copi tutto il contenuto della cartella script in /usr/bin&lt;br /&gt;
&lt;br /&gt;
Ora è tutto pronto per creare il pacchetto. Spostiamoci nella directory &quot;&lt;i&gt;app&lt;/i&gt;-1.0&quot; ed eseguiamo:&lt;br /&gt;
$ dpkg-buildpackage -us -uc&lt;br /&gt;
&lt;br /&gt;
Ora che abbiamo un pacchetto dobbiamo firmarlo:&lt;br /&gt;
&lt;br /&gt;
Per prima cosa creiamo una chiave GPG:&lt;br /&gt;
$ gpg --gen-key&lt;br /&gt;
&lt;br /&gt;
rispondiamo &quot;1&quot;alla prima domanda ovvero DSA e ElGamal, diamo invio;&lt;br /&gt;
come dimensione lasciamo pure 1024, diamo invio;&lt;br /&gt;
mettiamo &quot;0&quot; come scadenza, diamo invio;&lt;br /&gt;
rispondiamo &quot;s&quot;, diamo invio;&lt;br /&gt;
ora ci verrà chiesto Nome e Cognome,indirizzo email e il commento per la coppia di chiavi&lt;br /&gt;
ora premiamo &#39;o&#39; e invio;&lt;br /&gt;
ora ci verrà richiesta la password per le chiavi, inseriamola e invio.&lt;br /&gt;
&lt;br /&gt;
In debian/changelog dobbiamo scrivere&amp;nbsp;&lt;i&gt;Nome Cognome&amp;nbsp;&lt;/i&gt;(&lt;i&gt;commento&lt;/i&gt;)&amp;nbsp;&amp;lt;&lt;i&gt;mail&amp;gt;&lt;/i&gt;&amp;nbsp;con i dati spora inseriti.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmt3mEQGixjad7YoEW0TOj1Xa881hJtfwVpqeefLsMojayDojOqrTJaj7xhb3dGpw1ibNaAZPNk4Ocg1gdFUwSof7lBlC6fvGzbT62vUXmHn6ntt8ygGDw_X39-LEbEr27WX8pq2ASOJ0/s1600/Schermata+da+2014-07-19+13:38:46.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmt3mEQGixjad7YoEW0TOj1Xa881hJtfwVpqeefLsMojayDojOqrTJaj7xhb3dGpw1ibNaAZPNk4Ocg1gdFUwSof7lBlC6fvGzbT62vUXmHn6ntt8ygGDw_X39-LEbEr27WX8pq2ASOJ0/s1600/Schermata+da+2014-07-19+13:38:46.png&quot; height=&quot;155&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;Per caricare un pacchetto in rete dobbiamo registrare la nostra chiave presso il server di Ubuntu:&lt;br /&gt;
Apriamo Password e Chiavi e selezioniamo la nostra chiave.&lt;br /&gt;
Remoto&lt;em&gt; -&amp;gt; Sincronizza e pubblica chiavi&lt;/em&gt;. e sincronizza chiave con hkp://keyserver.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
Spostiamoci nella directory &quot;&lt;i&gt;app&lt;/i&gt;-1.0.0&quot; ed eseguiamo:&lt;br /&gt;
$ dpkg-buildpackage -s&lt;br /&gt;
&lt;br /&gt;
Ora dobbiamo registrarci su Launchpad:&lt;br /&gt;
Colleghiamoci a&amp;nbsp;&lt;a href=&quot;http://launchpad.net/&quot; target=&quot;_blank&quot;&gt;launchpad.net&lt;/a&gt;&amp;nbsp;e seguiamo la procedura guidata di log on.&lt;br /&gt;
&lt;br /&gt;
Ora nella nostra Dashboard clicchiamo sulla matita nel cerchio giallo vicino a OpenPGP Keys:&lt;br /&gt;
diamo $gpg --fingerprint &amp;nbsp;e copiamo la chiave nella casella di testo e premiamo import key.&lt;br /&gt;
&lt;br /&gt;
Ora riceveremo una mail con un link di conferma, essendo cifrata per poterla leggere occorre un plugin il cui link è nella mail stessa.&lt;br /&gt;
&lt;br /&gt;
Ora possiamo premere Create a new PPA e seguire la procedura guidata.&lt;br /&gt;
&lt;br /&gt;
E ora:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
dput ppa:&lt;i&gt;nostroppa&lt;/i&gt; &#39;&lt;i&gt;*&lt;/i&gt;source.changes&#39;&amp;nbsp;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH_FclC7UH9WdIxMrvAdGWiRtrobOo932xFBdAMR6Zaa9aqxA4DPY_enkqxCmm8q-zuNGsZkNpWtnZJ8Vdoe6GAYWOO-9PZ4i9cU72e_7bx6tdwrAAkWb7JIyUiVviN_MfR3fUVoORkOz8/s1600/Schermata+da+2014-07-19+13:40:55.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH_FclC7UH9WdIxMrvAdGWiRtrobOo932xFBdAMR6Zaa9aqxA4DPY_enkqxCmm8q-zuNGsZkNpWtnZJ8Vdoe6GAYWOO-9PZ4i9cU72e_7bx6tdwrAAkWb7JIyUiVviN_MfR3fUVoORkOz8/s1600/Schermata+da+2014-07-19+13:40:55.png&quot; height=&quot;356&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Per effettuare modifiche lavoriamo sulla directory di prima (se la abbiamo cancellata basta dare&amp;nbsp;dpkg-source -x app_1.0.0.dsc per ricrearla) e alla fine dare:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
dch -i&lt;/blockquote&gt;
Che mette la data di aggiornamento e ci permette di scrivere un commento su ciò che abbiamo modificato.&lt;br /&gt;
&lt;br /&gt;
Poi basta ridare &amp;nbsp;dpkg-buildpackage -s e dput ppa:&lt;i&gt;nostroppa&lt;/i&gt;&amp;nbsp;&#39;&lt;i&gt;app-1.0.0_&lt;/i&gt;source.changes&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/6450046565934473862/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/07/creare-un-pacchetto-e-pubblicarlo-su.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6450046565934473862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6450046565934473862'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/07/creare-un-pacchetto-e-pubblicarlo-su.html' title='Creare un pacchetto e pubblicarlo su Launchpad'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmt3mEQGixjad7YoEW0TOj1Xa881hJtfwVpqeefLsMojayDojOqrTJaj7xhb3dGpw1ibNaAZPNk4Ocg1gdFUwSof7lBlC6fvGzbT62vUXmHn6ntt8ygGDw_X39-LEbEr27WX8pq2ASOJ0/s72-c/Schermata+da+2014-07-19+13:38:46.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-9041014272099431087</id><published>2014-06-09T15:25:00.001+02:00</published><updated>2014-06-10T15:27:33.624+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="O.S."/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>UEFI Secure Boot: è sicuro per noi o per loro?</title><content type='html'>Microsoft ha imposto già da tempo ai produttori di computer di venderli con UEFI attivato, ma cos&#39;è &lt;br /&gt;
UEFI?&lt;br /&gt;
&lt;br /&gt;
UEFI è un&#39;alternativa al BIOS nelle schede madri che dovrebbe avere questi vantaggi:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Miglioramento della sicurezza nella fase di avvio.&lt;/li&gt;
&lt;li&gt;Maggiore velocità dei tempi di avvio e di ripresa dallo stato di ibernazione.&lt;/li&gt;
&lt;li&gt;Supporto di unità maggiori di 2,2 terabyte (TB).&lt;/li&gt;
&lt;li&gt;Supporto di driver di dispositivi firmware a 64 bit che il sistema può utilizzare per indirizzare più di 17,2 miliardi di gigabyte (GB) di memoria durante l&#39;avvio.&lt;/li&gt;
&lt;li&gt;Possibilità di utilizzare il BIOS con hardware UEFI.&lt;br /&gt;&lt;div style=&quot;text-align: right;&quot;&gt;
Fonte:&amp;nbsp;&lt;a href=&quot;http://windows.microsoft.com/it-it/windows-8/what-uefi&quot; target=&quot;_blank&quot;&gt;Microsoft&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgME0Sl4bgUm-mewpuGSP_W7Wwj0UFma-i04J83SEW2R1pol3rfGyi3d8xkxDjLHEN1JpbhfXcy01Y9Et_-PKKNGdbRDpaiXNofh-7VIn-HO4VUf2KhuJq4viqFKV4DuBF6Vsj_58pC0ivK/s1600/Compatible_with_Windows_7_icon_by_f.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgME0Sl4bgUm-mewpuGSP_W7Wwj0UFma-i04J83SEW2R1pol3rfGyi3d8xkxDjLHEN1JpbhfXcy01Y9Et_-PKKNGdbRDpaiXNofh-7VIn-HO4VUf2KhuJq4viqFKV4DuBF6Vsj_58pC0ivK/s1600/Compatible_with_Windows_7_icon_by_f.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Il bollino traditore, simbolo della presenza di UEFI.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Ma in pratica è una garanzia per la Microsoft dal momento in cui su una macchina UEFI puoi installare solo Windows e da Win 8 in poi; e una garanzia per i produttori di schede in quanto funzionano solo le schede certificate (il certificato è a pagamento).&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Questo chiude il mondo dell&#39; open: i&lt;b&gt; &lt;u&gt;sistemi open source come Linux non potranno più essere installati&lt;/u&gt;&lt;/b&gt; e molte schede open hardware non potranno essere utilizzate.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Microsoft si difende dicendo che non obbliga a usare UEFI: obbliga solo a vendere pc con UEFI attivato e che gli utenti possono disattivarlo dalle impostazioni del BIOS, ma il problema è che non in tutti i computer si può disattivare: in molti è obbligatorio!&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
La Free Software Foundation ha aperto una &lt;u style=&quot;font-weight: bold;&quot;&gt;petizione&lt;/u&gt;&amp;nbsp;contro il UEFI obbligatorio: se vuoi partecipare clicca su &lt;a href=&quot;http://www.fsf.org/campaigns/secure-boot-vs-restricted-boot/statement-it&quot; target=&quot;_blank&quot;&gt;questo link!&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Comunque Windows 8 e 8.1 si possono installare anche con UEFI disabilitato, quindi permettendo la coesistenza Win-Linux.&lt;br /&gt;
&lt;br /&gt;
Per i computer con UEFI non disabilitabile si possono usare alcune versioni di Linux contenenti una chiave UEFI comprata da&amp;nbsp;Matthew Garrett integrata nel loader Shim:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;Ubuntu 12.10 (solo nella versione 64 bit) e Ubuntu 13.04&lt;/li&gt;
&lt;li&gt;Fedora 18&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Sabayon 11&lt;/li&gt;
&lt;li&gt;Arch Linux (&lt;a href=&quot;https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface&quot; target=&quot;_blank&quot;&gt;vedi Wiki&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;openSUSE 12.3&lt;/li&gt;
&lt;li&gt;Linux Mint 15 Olivia (anche se non confermato dovrebbe supportare UEFI)&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/9041014272099431087/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/06/uefi-secure-boot-e-sicuro-per-noi-o-per.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/9041014272099431087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/9041014272099431087'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/06/uefi-secure-boot-e-sicuro-per-noi-o-per.html' title='UEFI Secure Boot: è sicuro per noi o per loro?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgME0Sl4bgUm-mewpuGSP_W7Wwj0UFma-i04J83SEW2R1pol3rfGyi3d8xkxDjLHEN1JpbhfXcy01Y9Et_-PKKNGdbRDpaiXNofh-7VIn-HO4VUf2KhuJq4viqFKV4DuBF6Vsj_58pC0ivK/s72-c/Compatible_with_Windows_7_icon_by_f.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-1087803126672720008</id><published>2014-06-03T18:34:00.001+02:00</published><updated>2014-06-03T18:35:24.055+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>VLC volume a 150%? portalo a 200%!</title><content type='html'>Con gli ultimi aggiornamenti di VLC non si può alzare il volume più del 125%, questo è stato pensato &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTx54o9rxs-E6-G3ve05fTcql2in75buMlwExQSjPFL3UJ1PyZ3Y6ZmKM1AaTRk-HxNdQKhyphenhyphenQnugVAgYWcW574DJr524wvAOvite3pfOO_xiZV_ajzCm7zNeR743_jyXxdS89eiSdtkHq/s1600/Schermata+da+2014-06-03+18:25:16.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTx54o9rxs-E6-G3ve05fTcql2in75buMlwExQSjPFL3UJ1PyZ3Y6ZmKM1AaTRk-HxNdQKhyphenhyphenQnugVAgYWcW574DJr524wvAOvite3pfOO_xiZV_ajzCm7zNeR743_jyXxdS89eiSdtkHq/s1600/Schermata+da+2014-06-03+18:25:16.png&quot; height=&quot;271&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
per evitare distorsioni, ma quando si ascoltano canzoni a basso volume occorre alzare oltre questa soglia.&lt;br /&gt;
&lt;br /&gt;
In realtà in VLC il volume si può alzare fino al 300%: basta solo impostare il livello-soglia:&lt;br /&gt;
&lt;br /&gt;
Aprite VLC, andate su strumenti-&amp;gt; preferenze&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW4iKm63E0tiT4TG-q8pkpXllWXaPe97V1Gf5D8gTyWFW3w8Pyc-QQ0Oypk2K0mN9NoKul6r2NGrd1ECIPQLjw6CuGkZGONlpK0DYkaj65ZFULi_UvB3D0FICqLqndHb6oJYAwkWDxJbiP/s1600/Schermata+da+2014-06-03+18:26:06.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW4iKm63E0tiT4TG-q8pkpXllWXaPe97V1Gf5D8gTyWFW3w8Pyc-QQ0Oypk2K0mN9NoKul6r2NGrd1ECIPQLjw6CuGkZGONlpK0DYkaj65ZFULi_UvB3D0FICqLqndHb6oJYAwkWDxJbiP/s1600/Schermata+da+2014-06-03+18:26:06.png&quot; /&gt;&lt;/a&gt;Ora aprite la visualizzazione tutto (1), poi andate su interfaccia (2) -&amp;gt; Qt (3) e in fondo trovate la voce &quot;Volume massimo visualizzato&quot; dove (4) potete mettere la vostra soglia fino a 300. Infine salvate (5).</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/1087803126672720008/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/06/vlc-volume-150-portalo-200.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/1087803126672720008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/1087803126672720008'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/06/vlc-volume-150-portalo-200.html' title='VLC volume a 150%? portalo a 200%!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTx54o9rxs-E6-G3ve05fTcql2in75buMlwExQSjPFL3UJ1PyZ3Y6ZmKM1AaTRk-HxNdQKhyphenhyphenQnugVAgYWcW574DJr524wvAOvite3pfOO_xiZV_ajzCm7zNeR743_jyXxdS89eiSdtkHq/s72-c/Schermata+da+2014-06-03+18:25:16.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-5245845385751673260</id><published>2014-05-22T15:00:00.001+02:00</published><updated>2014-05-22T15:00:22.146+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sviluppo"/><title type='text'>Storia del computer</title><content type='html'>È noto quasi a tutti che fin dalla prima metà dello scorso millennio i cinesi ebbero un particolare &lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlvztFn9BQaNaohqQodvLQuGWLwIWtmzvCjDc7NCL1LJFLNKOBPNJ6-hzhUOWFHYT9n-5Di2Qo9olYKqnKUQ-tITklB9XsMbqqpzh77tCrz97vaX4og5lJn5_e7mbHVmvJxMLazHP8uw56/s1600/abaco.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlvztFn9BQaNaohqQodvLQuGWLwIWtmzvCjDc7NCL1LJFLNKOBPNJ6-hzhUOWFHYT9n-5Di2Qo9olYKqnKUQ-tITklB9XsMbqqpzh77tCrz97vaX4og5lJn5_e7mbHVmvJxMLazHP8uw56/s1600/abaco.jpg&quot; height=&quot;320&quot; width=&quot;230&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abaco cinese e abaco moderno&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
interesse per la matematica e per l&#39;automazione dei calcoli: esempi che possiamo ancora vedere ai giorni nostri sono abaco e pallottoliere; ma pochi sanno che fin dal XIX secolo si sono create macchine molto vicine ai moderni computer.&lt;br /&gt;
La macchina analitica di Charles Babbage ne è l&#39;esempio per eccellenza: era una macchina, di grandi dimensioni, che permetteva di fare le principali operazioni matematiche e di visualizzarne il risultato grazie a delle ruote con impresse le dieci cifre, inoltre il progetto originale prevedeva un sistema per stampare su carta la cronologia dei calcoli effettuati, ma non furono trovati i fondi necessari a costruirla. Recentemente è stata realizzata una macchina analitica compresa di &quot;stampante&quot; funzionante seguendo i progetti originali e utilizzando solo materiali all&#39;epoca conosciuti: secondo alcuni esperti, se si fossero trovati i fondi necessari, i moderni computer potrebbero aver visto luce molti anni prima.&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE1iQgYHWVeHEWCuUCTtSOCuXS0zYQAgkhfGJXNXHmYEML-OzUSp_rzacdMfrhnmE3MXKh4LUwfu4j5UhM5nWhKFwPXN1CNNPvzVCAzAiR3_q-eUnGrY7FjpmQYQ3k5PWJluyZqbnAjG-l/s1600/analitica.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE1iQgYHWVeHEWCuUCTtSOCuXS0zYQAgkhfGJXNXHmYEML-OzUSp_rzacdMfrhnmE3MXKh4LUwfu4j5UhM5nWhKFwPXN1CNNPvzVCAzAiR3_q-eUnGrY7FjpmQYQ3k5PWJluyZqbnAjG-l/s1600/analitica.jpg&quot; height=&quot;298&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Macchina analitica&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Ada Lovelace, figlia del poeta inglese Lord Byron e anche vissuta nel XIX secolo, compì studi approfonditi sulla macchina analitica e scrisse il primo programma della storia, appunto per questa macchina: si tratta di una serie di istruzioni, scritte su schede perforate, per calcolare i numeri della serie di Bernoulli.&lt;br /&gt;
Per molti anni le istruzioni vennero scritte su schede perforate. Un esempio famoso ne è l&#39;Eniac, anche per un preciso fatto: un giorno un insetto (in inglese &lt;i&gt;bug&lt;/i&gt;) si infilò in una scheda perforata danneggiando gravemente la macchina, è per questo che oggi quando c&#39;è un problema o un errore in un programma informatico si parla di bug.&lt;br /&gt;
&lt;br /&gt;
Agli inizi dello scorso secolo Alan Turing descrisse una macchina (Macchina di Turing) che non faceva &lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZntbHYLCI1vxghG9WIegjw1YLx-_jvUSOBJzK1xy4ZPqVzasGFDaMRnohwewZgDb-g0MKR_93dc6XEuJV1-NgntRcS29ZqIavtQathD-TMHQxTkz8DZ5kpkU_a06HRk_AjZ3tZwi4bBYL/s1600/legono+macchina+analitica.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZntbHYLCI1vxghG9WIegjw1YLx-_jvUSOBJzK1xy4ZPqVzasGFDaMRnohwewZgDb-g0MKR_93dc6XEuJV1-NgntRcS29ZqIavtQathD-TMHQxTkz8DZ5kpkU_a06HRk_AjZ3tZwi4bBYL/s1600/legono+macchina+analitica.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Versione della macchina analitica realizzata coi Lego&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
solo determinate operazioni, ma tante quante ne erano descritte nei vari programmi: la macchina leggeva una serie di uni e di zeri che descrivevano i processi da fare.&lt;br /&gt;
Questo permetteva di sviluppare algoritmi per ogni tipo di problema, a patto di dover semplificare ogni problema in problemi più piccoli (ricorsione).&lt;br /&gt;
Durante la seconda guerra mondiale Turing fece parte del dipartimento di comunicazione inglese per decriptare i messaggi in codice tedeschi, i quali erano codificati dalla macchina Enigma: un insieme di servomotori che facevano variare continuamente il codice.&lt;br /&gt;
Turing inoltre inventò un test per verificare quando l&#39;intelligenza artificiale sarebbe stata pari a quella umana: una persona pone una domanda e riceve una risposta da una persona reale e una dalla macchina, quando non saprà distinguerle allora l&#39;intelligenza artificiale avrà raggiunto alti livelli.&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;a href=&quot;http://www.google.com/doodles/alan-turings-100th-birthday&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNqPKvtaKv4Me7i4XVWPyWwf23bZEdT7vzpp-1pLSzJVPKGA5tW4xOZLRnU54Eu8l8iHI1mUmvjOVguaukuJmrIREoS3lfEAdaDYppMfCH7ozxeyQirYdbK6ru9gmfwySevN86GVCSq02O/s1600/alan.png&quot; height=&quot;166&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.google.com/doodles/alan-turings-100th-birthday&quot; target=&quot;_blank&quot;&gt;Doodle dedicato dalla Google ad Alan Turing&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
È grazie a queste e a molte altre persone che oggi abbiamo tutte quelle tecnologie basate sui calcoli automatici (computer,cellulari, ma anche orologi,riscaldamento,domotica,...) e se vediamo i progressi fatti in due secoli e i progressi fatti negli ultimi dieci anni possiamo notare come ci sia una sempre più crescente evoluzione di queste tecnologie; e non solo non possiamo immaginare cosa ci sarà fra un secolo: non possiamo immaginare cosa ci sarà fra un anno!</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/5245845385751673260/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/05/storia-del-computer.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/5245845385751673260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/5245845385751673260'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/05/storia-del-computer.html' title='Storia del computer'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlvztFn9BQaNaohqQodvLQuGWLwIWtmzvCjDc7NCL1LJFLNKOBPNJ6-hzhUOWFHYT9n-5Di2Qo9olYKqnKUQ-tITklB9XsMbqqpzh77tCrz97vaX4og5lJn5_e7mbHVmvJxMLazHP8uw56/s72-c/abaco.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-6476971550468811338</id><published>2014-05-21T17:47:00.000+02:00</published><updated>2014-05-21T17:47:43.925+02:00</updated><title type='text'>Alla ricerca del prodotto giusto...</title><content type='html'>&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisa23qeu4EiLikllRctWQ2l52wh8xOR2Sr5Jkd7DMiflig7oLxJ4BO6jNWWrIqFuiNqJWiwgBzK4fA3Y9QFrM7iOt6-oPAx34U_PYZ21Q-JftkXKbZac43a55byeBkawlgHoHT7iIzv5G7/s1600/asus_eee_pc_1201pn_fronte.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisa23qeu4EiLikllRctWQ2l52wh8xOR2Sr5Jkd7DMiflig7oLxJ4BO6jNWWrIqFuiNqJWiwgBzK4fA3Y9QFrM7iOt6-oPAx34U_PYZ21Q-JftkXKbZac43a55byeBkawlgHoHT7iIzv5G7/s1600/asus_eee_pc_1201pn_fronte.jpg&quot; height=&quot;204&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Le caratteristiche di un pc.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Anni fa era bello andare nei reparti informatici dei negozi perché si potevano osservare tutte le novità &lt;br /&gt;
del momento, alcune volte anche provarle, ma sopratutto avere una visione d&#39; insieme di come si evolveva il mondo informatico.&lt;br /&gt;
Merito di tutto ciò erano le etichette curate che riportavano tutti i dettagli tecnici dei prodotti.&lt;br /&gt;
&lt;br /&gt;
Dopo molti anni sono tornato in vari negozi nei reparti informatici e ho notato che purtroppo la storia è cambiata: la maggior parte dei prodotti in esposizione sono scatole, a volte trovi un&#39; etichetta con scritta a volte la ram (la marca non il valore) o il processore e al posto dei dettagli tecnici trovi cartelli con scritto: &quot;leggero, veloce, ergonomico, bello,...&quot;&lt;br /&gt;Purtroppo ho constatato questo anche nei siti dei produttori: solo pochi siti mantengono ancora le caratteristiche, e sono solitamente in una scheda secondaria, dopo foto e &quot;leggero, veloce, ergonomico, bello,...&quot;&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUQ9KdNmpmZt_ouvcDFw-al2p-IV1tIi6WuSpISwHaGDh4cn0VzXVWpU2S2rLQOyGl6fhqPD93G62vpgAZPId5OJR4cQ9kfJG1nhla-Z-LjuURJJ93u_dObUTuiC6oVSgVZ8_RThCd6QKs/s1600/asus_eee_pc_1201pn_fronte.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUQ9KdNmpmZt_ouvcDFw-al2p-IV1tIi6WuSpISwHaGDh4cn0VzXVWpU2S2rLQOyGl6fhqPD93G62vpgAZPId5OJR4cQ9kfJG1nhla-Z-LjuURJJ93u_dObUTuiC6oVSgVZ8_RThCd6QKs/s1600/asus_eee_pc_1201pn_fronte.jpg&quot; height=&quot;193&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Ora sul sito del produttore non scrivono più le caratteristiche, ma&lt;br /&gt;solo le &quot;impressioni d&#39;uso&quot;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
I tempi sono cambiati e i computer non sono più una nicchia ma sono diventati il principale prodotto, quindi il commercio punta all&#39; illusione e al far parere bello: chi va a comprare un computer se gli dici che ha 4 core da 2 GHz e 16GiB di ram? nessuno ma se gli dici ultrabook con superprocessore e durata eccezionale della batteria lo comprano al volo!&lt;br /&gt;
Anche gli schermi: perché farli lucidi? Essendo lucidi riflettono tutta la luce e diminuiscono la visibilità, mentre se fossero opachi sarebbe molto meglio; ma chi va a comprare un monitor opaco? I monitor lucidi quando sono spenti hanno un&#39; estetica migliore e creano più guadagni.&lt;br /&gt;
&lt;br /&gt;
I produttori stanno appunto attuando una strategia di commercio per vendere tutto a tutti, mettendo così in difficoltà chi sa cosa cercare, perché ormai non ti vendono il computer ma le parole.</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/6476971550468811338/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/05/alla-ricerca-del-prodotto-giusto.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6476971550468811338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6476971550468811338'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/05/alla-ricerca-del-prodotto-giusto.html' title='Alla ricerca del prodotto giusto...'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisa23qeu4EiLikllRctWQ2l52wh8xOR2Sr5Jkd7DMiflig7oLxJ4BO6jNWWrIqFuiNqJWiwgBzK4fA3Y9QFrM7iOt6-oPAx34U_PYZ21Q-JftkXKbZac43a55byeBkawlgHoHT7iIzv5G7/s72-c/asus_eee_pc_1201pn_fronte.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-2162875293617905489</id><published>2014-05-14T18:21:00.001+02:00</published><updated>2014-07-02T15:00:56.610+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Doppia icona Chrome in Luncher o Docky?</title><content type='html'>&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha6p97qnKvlD3kXDeYqbyE-XaJE9rP7xwksorkko0ioJ2VIaBM7id2CmuyllouMCiWYV_DxYkzFu5NfivuhG6wx_C2K-LioDbEqxHTBiP6ugw_v3RoRjxLu0mivvuwzn7-udXRnzqUGdYI/s1600/2icone.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha6p97qnKvlD3kXDeYqbyE-XaJE9rP7xwksorkko0ioJ2VIaBM7id2CmuyllouMCiWYV_DxYkzFu5NfivuhG6wx_C2K-LioDbEqxHTBiP6ugw_v3RoRjxLu0mivvuwzn7-udXRnzqUGdYI/s1600/2icone.png&quot; height=&quot;640&quot; width=&quot;88&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;inizio&lt;br /&gt;
2 icone&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Chrome (ma questo vale anche per altri programmi come LibreOffice) a volte si apre in un&#39;icona diversa da quella bloccata nella dock, questo perchè il suo collegamento non punta la programma ma ad un altro collegamento.&lt;br /&gt;
Per risolvere questo problema non ci vuole molto:&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg35XmHbf-UMFzWCCVADlOqMvlI8_jzgHom26v4GJmDnwX_1TSWo0X9ESefT6i-e56MKBCgvUemMD_E5YpjL60LZNUmqYflQPgqBwKHsR__emjNtlfPvq49QBZGKr0l6wgjjRyiIi9E-CXi/s1600/1icona.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg35XmHbf-UMFzWCCVADlOqMvlI8_jzgHom26v4GJmDnwX_1TSWo0X9ESefT6i-e56MKBCgvUemMD_E5YpjL60LZNUmqYflQPgqBwKHsR__emjNtlfPvq49QBZGKr0l6wgjjRyiIi9E-CXi/s1600/1icona.png&quot; height=&quot;640&quot; width=&quot;88&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;risultato&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;ol&gt;
&lt;li&gt;Apri un terminale e digita&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;xprop | grep WM_CLASS | awk &#39;{print $4}&#39;&lt;/i&gt;&lt;br /&gt;e cliccando su una finestra di Chrome otterrai qualcosa tipo:&amp;nbsp;Google-chrome-stable&lt;/li&gt;
&lt;li&gt;Nel terminale digita&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo nautilus&amp;nbsp;/usr/share/applications/ &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;(se usi un filemanager diverso da nautilus va bene comunque)&lt;/span&gt;&lt;br /&gt;apri &lt;i&gt;google-chrome.desktop&lt;/i&gt; con un editor di testo come gedit e aggiungi la segunete riga:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;StartupWMClass=Google-chrome-stable&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Riavvia Docky o Unity&lt;/li&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/2162875293617905489/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/05/doppia-icona-chrome-in-luncher-o-docky.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2162875293617905489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2162875293617905489'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/05/doppia-icona-chrome-in-luncher-o-docky.html' title='Doppia icona Chrome in Luncher o Docky?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha6p97qnKvlD3kXDeYqbyE-XaJE9rP7xwksorkko0ioJ2VIaBM7id2CmuyllouMCiWYV_DxYkzFu5NfivuhG6wx_C2K-LioDbEqxHTBiP6ugw_v3RoRjxLu0mivvuwzn7-udXRnzqUGdYI/s72-c/2icone.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-5708183753843906619</id><published>2014-05-14T17:45:00.002+02:00</published><updated>2014-05-14T17:49:26.183+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Synapse, un&#39;alternativa alla Dash</title><content type='html'>&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1DOfahjOf4_qZNjR4nilzrqTYcKJ97bJI3ppHzV_FWC6aDk1B2CONhQhooqiGNgzHv5tQWazxvHCpF30a79xC4h20AiRRPbYR0ocVRGI5wsLo_gSYjYCe4Ov-06d2hKUcaJXiKvp0LcbR/s1600/Schermata+da+2014-05-14+17:34:58.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1DOfahjOf4_qZNjR4nilzrqTYcKJ97bJI3ppHzV_FWC6aDk1B2CONhQhooqiGNgzHv5tQWazxvHCpF30a79xC4h20AiRRPbYR0ocVRGI5wsLo_gSYjYCe4Ov-06d2hKUcaJXiKvp0LcbR/s1600/Schermata+da+2014-05-14+17:34:58.png&quot; height=&quot;71&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Interfaccia di Synapse&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Con le ultime versioni di Ubuntu il menù applicazioni è stato sostituito dall&#39; innovativa dash.&lt;br /&gt;
La dash permette di cercare app, file, musica, video,.. semplicemente scrivendo alcune lettere del nome.&lt;br /&gt;
Il problema più grande è che occupa molta memoria ed è poco efficiente.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh29NolV81H5gy77IMb8QCpLC5TvvDbAp3OzZBtmTY0Y7mQVXR4ED9Mi78qeFo-j82ZEK3aolng9lZpqEyzvRI5LFNk0U-blNQSwZLpeYs2VZfD4ikdNcLRZDxJ_iHjL741qeR6D7Kao5ro/s1600/Schermata+da+2014-05-14+17:38:27.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh29NolV81H5gy77IMb8QCpLC5TvvDbAp3OzZBtmTY0Y7mQVXR4ED9Mi78qeFo-j82ZEK3aolng9lZpqEyzvRI5LFNk0U-blNQSwZLpeYs2VZfD4ikdNcLRZDxJ_iHjL741qeR6D7Kao5ro/s1600/Schermata+da+2014-05-14+17:38:27.png&quot; height=&quot;134&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Più risulatiti&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;https://launchpad.net/synapse-project&quot; target=&quot;_blank&quot;&gt;Synapse&lt;/a&gt;&amp;nbsp;è un tool che occupa poca memoria e può sostituire la dash con la differenza di essere molto più veloce grazie all&#39; indicizzazione dei file; Synapse è adatto a tutti i computer: dai nuovi modelli a quelli più vecchi e con qualsiasi distribuzione Linux e con qualsiasi DE.&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnqgHTZAE3RrQg132gYI202i-SZwB5pQrO4U233UCHc3-aY-lAGNDzgYZkS5TLqAMPfqZhn2AsUlO7EXGrj6yaNBwK3zkl8Hk34nLC6Zs8EQhDMJ9EtsZs0_6vy9YoYMN5o_LSuzkSfgqR/s1600/Schermata+da+2014-05-14+17:42:31.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnqgHTZAE3RrQg132gYI202i-SZwB5pQrO4U233UCHc3-aY-lAGNDzgYZkS5TLqAMPfqZhn2AsUlO7EXGrj6yaNBwK3zkl8Hk34nLC6Zs8EQhDMJ9EtsZs0_6vy9YoYMN5o_LSuzkSfgqR/s1600/Schermata+da+2014-05-14+17:42:31.png&quot; height=&quot;134&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Apri con...&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Per avviarlo basta premere Ctrl+Space (ispirato al Cmd+Space di Spotligth), scorciatoia che potete cambiare, e digitare alcune lettere di ciò che cercate (anche saltandone alcune), poi premete invio per aprire.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitXLOcy-ziNop1azVQmoE58UhC7kJadN_l4IkrQw1mtMxKAXkUPkCj5H4QSvqh2IvO4cdzwFq3zNLIi5pt2kAWPeMdaysmGBrg16R9tr9ZVz0AJYiuQy93eEilUUhJVzyZGa2B6JMnL6AF/s1600/Schermata+da+2014-05-14+17:39:17.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitXLOcy-ziNop1azVQmoE58UhC7kJadN_l4IkrQw1mtMxKAXkUPkCj5H4QSvqh2IvO4cdzwFq3zNLIi5pt2kAWPeMdaysmGBrg16R9tr9ZVz0AJYiuQy93eEilUUhJVzyZGa2B6JMnL6AF/s1600/Schermata+da+2014-05-14+17:39:17.png&quot; height=&quot;71&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Ci sono estensioni come la calcolatrice&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Se volete più risultati premete la freccia giù e se cercate specificatamente un programma, un documento, un&#39;immagine,... scorrete le sezioni con le frecce sx/dx.&lt;br /&gt;
Con Tab scorrendo con la fraccia giù potete cambiare il programma con cui aprire i file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSTALLAZIONE&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo add-apt-repository ppa:synapse-core/ppa&lt;br /&gt;
sudo apt-get update -y&lt;br /&gt;
sudo apt-get install synapse -y&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/5708183753843906619/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/05/synapse-unalternativa-alla-dash.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/5708183753843906619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/5708183753843906619'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/05/synapse-unalternativa-alla-dash.html' title='Synapse, un&#39;alternativa alla Dash'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1DOfahjOf4_qZNjR4nilzrqTYcKJ97bJI3ppHzV_FWC6aDk1B2CONhQhooqiGNgzHv5tQWazxvHCpF30a79xC4h20AiRRPbYR0ocVRGI5wsLo_gSYjYCe4Ov-06d2hKUcaJXiKvp0LcbR/s72-c/Schermata+da+2014-05-14+17:34:58.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-2974390036210041572</id><published>2014-05-13T16:27:00.003+02:00</published><updated>2014-05-14T15:01:19.102+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="O.S."/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Ancora Windows?</title><content type='html'>Esistono svariati sistemi operativi, fra cui ricordiamo Windows, le miriadi di release di Linux e OSX; eppure quando ci guardiamo attorno siamo circondati da computer Windows, quindi pensiamo che Windows sia il migliore, ma invece...&lt;br /&gt;
&lt;br /&gt;
Un altro fatto importante è la fine di supporto di Windows XP: in realtà si potrà continuare a usare Windows XP senza problemi, con solo due differenze:&lt;br /&gt;
- Non riceverete più aggiornamenti dalla Microsoft (Alleleja!)&lt;br /&gt;
- La Microsoft non vi darà più supporto gratuito (Prima lo faceva?)&lt;br /&gt;
Invece quasi tutti hanno capito che dovevano cambiare compueter (proprio quello che la Microsoft voleva), ma a discapito di questa le vendite di Windows non sono salite di molto: alcuni hanno scelto Mac (con i relativi costi da supportare), mentre altri hanno optato per Linux.&lt;br /&gt;
&lt;br /&gt;
Linux? Chi è sto sconosciuto?&lt;br /&gt;
Ebbene si in pochi conoscono Linux ed è un peccato, scopriremo ora perchè conviene passare a Linux che comprare un nuovo Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijuZArxuWLrxqVT4LtFS1X3P8WPPA4krcmKmkTdeV7WDiwcVDrRitk0gf3fl0rYNflKKeadPt2firJ1EUxd5uz_WiMHx3zVRTvH6IHerYvs_gLj961EhhuTja4u9zByepAg-cpRU2jcw2h/s1600/a.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijuZArxuWLrxqVT4LtFS1X3P8WPPA4krcmKmkTdeV7WDiwcVDrRitk0gf3fl0rYNflKKeadPt2firJ1EUxd5uz_WiMHx3zVRTvH6IHerYvs_gLj961EhhuTja4u9zByepAg-cpRU2jcw2h/s1600/a.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;REQUISITI MINIMI&lt;br /&gt;Windows 8.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Linux Ubuntu&lt;br /&gt;20 GiB HDD &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10 GiB HDD&lt;br /&gt;2 GiB Ram &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 512 MiB Ram (= 0,5 GiB)&lt;br /&gt;1 P &amp;nbsp;Processore &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0,7 P &amp;nbsp;Processore &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://igiguide.blogspot.it/2014/04/indice-di-un-processore-in-pantal.html&quot; target=&quot;_blank&quot;&gt;[P = GHz * core]&lt;/a&gt;&lt;br /&gt;Scheda grafica DirectX 9 &amp;nbsp; &amp;nbsp; Scheda grafica generica&lt;br /&gt;&lt;br /&gt;Come si può notare Linux generalmente richiede meno risorse di Windows (esistono alcune versioni come Xubuntu o Lubuntu che addirittura richiedono meno prestazioni che Ubuntu !!!).&lt;br /&gt;Con questo si può riutilizzare un vecchio computer o comprarne uno poco potente abattendo notevolmente i costi.&lt;/li&gt;
&lt;li&gt;PREZZI&lt;br /&gt;Beh Windows ha calato i prezzi con l&#39; avvento di Windows 8, mentre Linux è rimasto sempre costante nei prezzi:&lt;br /&gt;(prezzi medi in data di uscita)&lt;br /&gt;Windows 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;300€ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ubuntu 9.10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;gratis&lt;br /&gt;Windows 8.1 &amp;nbsp; &amp;nbsp; 100€ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ubuntu 13,10 &amp;nbsp; &amp;nbsp; &amp;nbsp;gratis&lt;/li&gt;
&lt;li&gt;SICUREZZA&lt;br /&gt;Con Win chiunque sa prendere Virus: basta non avere l&#39; antivirus o un antivirus &lt;i&gt;impreparato&lt;/i&gt; ( e con la velocità con cui creano nuovi virus un antivirus risulta &lt;i&gt;impreparato&lt;/i&gt; 15 minuti prima che esca l&#39; aggiornamento).&lt;br /&gt;Con Linux solo uno stupido sa installare i virus: bisogna scaricare i file, dargli il permesso di esecuzione, fare doppio click e digitare la password di amministratore.&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF0J6wqsga9OLSMwr_rblObwqkolyhIaw5rF5eWDYBUFxK_kZlIPpm7CTSiz5Yx8gRYUFnWfN3qKJBFJ8SlM2SJQFGgsZrLNmnTNKPIIM0SSZr2_puTFUz0-bI2jW9CvPTTH-F_5knGuu8/s1600/a.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF0J6wqsga9OLSMwr_rblObwqkolyhIaw5rF5eWDYBUFxK_kZlIPpm7CTSiz5Yx8gRYUFnWfN3qKJBFJ8SlM2SJQFGgsZrLNmnTNKPIIM0SSZr2_puTFUz0-bI2jW9CvPTTH-F_5knGuu8/s1600/a.png&quot; height=&quot;121&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Richiesta di password Linux&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;Questo in quanto Linux è un sistema a guscio: ogni livello è protetto, mentre Windows non è a guscio: dopo il primo accesso (quando accendete il computer) lascia la porta aperta, questo è comodo per chi non vuole mettere la password per ogni cosa ma è molto insicuro.&lt;br /&gt;Appunto per questo si sono scoraggiati gli sviluppatori e i virus per Linux sono pochissimi.&lt;/li&gt;
&lt;li&gt;INSTALLAZIONE&lt;br /&gt;Se avete un computer vuoto i tempi di installazione sono molto diversi, riportiamo qui le medie:&lt;br /&gt;Windows &amp;nbsp; &amp;nbsp; &amp;nbsp;50 minuti &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Linux &amp;nbsp; &amp;nbsp;20 minuti&lt;br /&gt;&lt;a href=&quot;http://go2linux.garron.me/why-linux-is-easier-than-windows&quot; target=&quot;_blank&quot;&gt;Guida passo passo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;DRIVER&lt;br /&gt;Windows per funzionare a bisogno di tutti i driver, solo con Windows 8 vengono inclusi alcuni driver fondamentali; questo comporta una perdita di tempo, un ingombro di memoria fisica (RAM) e di storage (HDD).&lt;br /&gt;In Linux invece vi è incluso il 99% dei driver e appena lo installate lo potete subito usare.&lt;/li&gt;
&lt;li&gt;TEMPI DI AVVIO E SPEGNIMENTO&lt;br /&gt;Se siete utenti Windows di certo odierete gli avvii del sistema, ma con Linux i tempi si riducono&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
di quasi il 50%, inoltre quando compare lo sfondo Linux può essere usato, mentre su Win compare la clessidra e devi aspettare che carichi i componenti di sistema.&lt;br /&gt;Da Windows 8 i tempi di avvio somigliano diminuiti, in realtà Win 8 e 8.1 non si spengono: chiudono tutti i programmi e si ibernano (attenzione però recuperare i dati da un HDD ibernato può causare perdite di dati).&lt;/li&gt;
&lt;li&gt;DEFRAMMENTAZIONE&lt;br /&gt;Un buon utente Win deframmenta regolarmente &amp;nbsp;i suoi dischi, un buon utente Linux non sa cosa vuol dire deframmentare: scordatevi i pomeriggi lunghi ad attendere che il computer termini questo processo perchè Linux usa flesystem molto più avanzati di FAT e NTFS (unici di Win).&lt;/li&gt;
&lt;li&gt;AGGIORNAMENTI&lt;br /&gt;Su Windows bisogna aggiornare tutti i programmi manualmente e separatamente aggiornare il sistema operativo, quest&#39; ultima procedura si compone di tre parti: attendi l&#39; installazione degli&amp;nbsp;aggiornamenti, attendi uno spegnimento molto più lungo del solito, attendi un tempo &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS1DapdrBM7RdIjmbRO00CUjbyKaEpJW6BUINFKeenXnPDeCT6HORiK2h0yVac2pNthpslyMfP8pscDogaaDF3f6DlLRx7EmLCbBSWqfwuQ3-ZiefcZAQD3EsXZginsakYcb7xbFKZ3dMy/s1600/a.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS1DapdrBM7RdIjmbRO00CUjbyKaEpJW6BUINFKeenXnPDeCT6HORiK2h0yVac2pNthpslyMfP8pscDogaaDF3f6DlLRx7EmLCbBSWqfwuQ3-ZiefcZAQD3EsXZginsakYcb7xbFKZ3dMy/s1600/a.png&quot; height=&quot;281&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Aggiornamento in un click&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
di&amp;nbsp;avvio molto più lungo del solito.&lt;br /&gt;Su Linux compare una finestrella, con &lt;u&gt;un &lt;/u&gt;(1) &amp;nbsp;click su aggiorna e in 5 minuti (mentre fai altro) aggiorna sistema operativo e tutti i programmi e non occorre attendere altro tempo.&lt;/li&gt;
&lt;li&gt;SOFTWARE&lt;br /&gt;Su Windows il buon software è a pagamento e spesso a caro prezzo, mentre &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcfTNl0wj6um3-DtMh0W3bgGrBIsZDqKhhyC7eKl1PK3eqTvb6jKVA_9GiouTf0ykQHyoQTZ4z1gzd-ZnCVLyFNnQQag2KvfYX_7Sr8gzsHiEL_E98Wqyj09G0lEpLd0FIc5xQ0Cvj_9UF/s1600/Schermata+da+2014-05-14+14:56:25.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcfTNl0wj6um3-DtMh0W3bgGrBIsZDqKhhyC7eKl1PK3eqTvb6jKVA_9GiouTf0ykQHyoQTZ4z1gzd-ZnCVLyFNnQQag2KvfYX_7Sr8gzsHiEL_E98Wqyj09G0lEpLd0FIc5xQ0Cvj_9UF/s1600/Schermata+da+2014-05-14+14:56:25.png&quot; height=&quot;180&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Microsoft Office su Linux&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
su Linux torvate il 99% dei programmi gratuiti che si trovano anche su Win e una miriade di programmi (tutti gratuiti) che sono allo stesso livello (a volte anche superiori) ai rispettivi a pagamento per Win.&lt;br /&gt;Se siete affezionati ai software Win potete usare &lt;a href=&quot;http://appdb.winehq.org/&quot; target=&quot;_blank&quot;&gt;Wine&lt;/a&gt;: un programma che permette l&#39; avvio di una buona parte degli applicativi Win su Linux.&lt;br /&gt;Inoltre potete trovare tutto il software Linux su Ubuntu Software Center (simile a Windows Store di Win 8 ma uscito molti anni prima)&lt;/li&gt;
&lt;li&gt;PERSONALIZZAZIONE&lt;br /&gt;Su Windows ci sono alcune impostazioni personali e alcune personalizzazioni, su Linux puoi scegliere tutto al 100%: non solo nome e colori ma anche tantissime altre cose!!!&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/2yR-9kgHqtILuy4uvX8a6IEcxFnv17ldOmXR-cQGg8at43QVwAYmFIK3UIafTeuenlk&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/2yR-9kgHqtILuy4uvX8a6IEcxFnv17ldOmXR-cQGg8at43QVwAYmFIK3UIafTeuenlk&quot; height=&quot;120&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Alcuni DE di Linux&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;ASSISTENZA&lt;br /&gt;Hai problemi con Win? Sul sito Microsoft non trovi nulla e devi pagare un tecnico, con Linux hai miriadi di forum (il più popolare è &lt;a href=&quot;http://forum.ubuntu-it.org/&quot; target=&quot;_blank&quot;&gt;Ubuntu Forum&lt;/a&gt;) con utenti che gratuitamente danno supporto 24h su 24 e 365 giorni l&#39; anno (io ho postato un problema la mattina di Natale e in meno di 15 minuti ho ricevuto già 3 risoluzioni)&lt;/li&gt;
&lt;li&gt;RETI&lt;br /&gt;Windows in rete comunica solo con Windows ( o Linux che gli danno il permesso) e a volte fa fatica anche così. Con Linux potete comunicare con tutti i sistemi informatici (non solo computer, ma anche consolle,...).&lt;br /&gt;Le aziende possono usando Linux Server gestire tutti i computer della ditta indipendentemente che essi abbiano Linux, Win o Mac, mentre con Win Server puoi gestire solo i pc con Win.&lt;/li&gt;
&lt;li&gt;MOBILE&lt;br /&gt;Un argomento importante sono i sistemi operativi per Smartphone: Windows Phone vs Linux.&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkDsEAX58AZSXDODinDIVMzJvSvYijUANfh2ThBZtbzbXkkcsuraW78PdrdgX0xU_-rwrNXefUb0qm6-qh9wYZWh3oTCWi59DCp_77E-Sip6twm90CraJpbMdqugjj38C_6_WYPSFTzeoh/s1600/Immagine.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkDsEAX58AZSXDODinDIVMzJvSvYijUANfh2ThBZtbzbXkkcsuraW78PdrdgX0xU_-rwrNXefUb0qm6-qh9wYZWh3oTCWi59DCp_77E-Sip6twm90CraJpbMdqugjj38C_6_WYPSFTzeoh/s1600/Immagine.png&quot; height=&quot;149&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Linux su tutti i dispositivi&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Windows Phone è uno dei sistemi mobile meno conosciuti, con un numero limitato di app (solitamente copioni di app Android e iOS) che punta all&#39; estetica più che al software.&lt;br /&gt;Dal lato Linux abbiamo Android, che si contende il podio con iOS, il cui unico punto debole è la sicurezza (Google ha scelto di abbandonare molti punti del guscio Linux a favore di un&#39; interfaccia più semplice) e Ubuntu Phone: permette l&#39; esecuzione delle app desktop per Linux con un interfaccia riscritta per i Touch.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Beh che dire Linux è risparmio e sicurezza, provare per credere.&lt;/div&gt;
&lt;div&gt;
Se volete potete provare Linux senza installarlo: usate il &lt;a href=&quot;http://ubuntusemplice.blogspot.it/2011/04/avviare-ubuntu-da-cd.html&quot; target=&quot;_blank&quot;&gt;Live CD&lt;/a&gt;.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/2974390036210041572/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/05/ancora-windows.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2974390036210041572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2974390036210041572'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/05/ancora-windows.html' title='Ancora Windows?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF0J6wqsga9OLSMwr_rblObwqkolyhIaw5rF5eWDYBUFxK_kZlIPpm7CTSiz5Yx8gRYUFnWfN3qKJBFJ8SlM2SJQFGgsZrLNmnTNKPIIM0SSZr2_puTFUz0-bI2jW9CvPTTH-F_5knGuu8/s72-c/a.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-4924128496124935971</id><published>2014-04-10T16:49:00.004+02:00</published><updated>2014-04-10T16:49:40.994+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Compilare eseguibili Windows su Linux</title><content type='html'>Tempo fa avevamo visto &lt;a href=&quot;http://igiguide.blogspot.it/2013/11/compilare-in-c-da-linux.html&quot; target=&quot;_blank&quot;&gt;come compilare C++ per Linux su Linux&lt;/a&gt;, oggi vedremo come compilare per Windows su Linux (il risultante sarà in 32bit):&lt;br /&gt;
&lt;br /&gt;
inanzitutto installiamo MingW:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;i&gt;sudo apt-get install g++ -y&lt;br /&gt;sudo apt-get install mingw32 -y&lt;br /&gt;sudo apt-get install mingw32-binutils -y&lt;br /&gt;sudo apt-get install mingw32-runtime -y&lt;/i&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;Non preoccupatevi se da errore su uno dei quattro&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Poi andiamo a compilare:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 17.804800033569336px; white-space: pre-wrap;&quot;&gt;&lt;i&gt;i586-mingw32msvc-g++ sorgente.cpp -o compilato.exe &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/4924128496124935971/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/compilare-eseguibili-windows-su-linux.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/4924128496124935971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/4924128496124935971'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/compilare-eseguibili-windows-su-linux.html' title='Compilare eseguibili Windows su Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-5252087832274952992</id><published>2014-04-10T14:23:00.001+02:00</published><updated>2014-04-10T14:23:45.409+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Tutti i caratteri con Linux</title><content type='html'>Ecco un semplice schema esemplificativo di come fare tutti i caratteri con Linux (schema relativo alla tastiera italiana):&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://forum.ubuntu-it.org/download/file.php?id=83786&amp;amp;sid=462d14fe06f8a39226a407b4511127bc&amp;amp;mode=view&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://forum.ubuntu-it.org/download/file.php?id=83786&amp;amp;sid=462d14fe06f8a39226a407b4511127bc&amp;amp;mode=view&quot; height=&quot;412&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Ricordo che è inoltre possibile inserire direttamente il codice Unicode del carattere:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Ctrl+Shift+u seguito dal codice&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_Unicode_characters&quot; target=&quot;_blank&quot;&gt;Ecco la tabella Unicode&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/5252087832274952992/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/tutti-i-caratteri-con-linux.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/5252087832274952992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/5252087832274952992'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/tutti-i-caratteri-con-linux.html' title='Tutti i caratteri con Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-152543989650168888</id><published>2014-04-09T15:31:00.000+02:00</published><updated>2014-05-20T18:11:04.072+02:00</updated><title type='text'>Indice di un processore in Pantal</title><content type='html'>Le caratteristiche principali di un processore son la velocità (operazioni al secondo) e il numero di sottoprocessori (core).&lt;br /&gt;
Il pantal [P] è un&#39; unità di misura che li raggruppa in un unico dato.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt; &amp;nbsp; &amp;nbsp; Pantal = core &lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;x&lt;/span&gt; GHz&lt;/b&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Sapendo il pantal di un processore è facile stimarne le caratteristiche:&lt;br /&gt;
dividendo il numero di pantal per due (che sono i GHz medi di un processore attuale) si ottiene all&#39; incirca il numero di core; sapendo che il numero di core è una potenza di due si arrotonda tale numero e di conseguenza si calcolano i GHz, per esempio:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;un processore da 7 P&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7 P : 2 GHz = 3,5 core -&amp;gt; 4 core&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7 P : 4 core = 1,75 GHz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ecco alcuni valori di pantal:&lt;br /&gt;
&lt;br /&gt;
processore &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GHZ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;core &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pantal&lt;br /&gt;
Intel i3-4000M &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2,40 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4,8&lt;br /&gt;
Intel&amp;nbsp;i7-4810MQ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2,80 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11,2&lt;br /&gt;
AMD Athlon II &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2,30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4,6&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; </content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/152543989650168888/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/indice-di-un-processore-in-pantal.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/152543989650168888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/152543989650168888'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/indice-di-un-processore-in-pantal.html' title='Indice di un processore in Pantal'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-4334811929391542546</id><published>2014-04-01T18:16:00.000+02:00</published><updated>2014-04-01T18:16:12.101+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Eserciti Galattici</title><content type='html'>L&#39;esercito della Signoria è riuscito a costruire un&#39;arma segreta: il temibile Sarcofago Nero. Esso legge una parola segreta S costituita da lettere minuscole dell&#39;alfabeto: a, b, c, ..., z (ogni lettera può comparire zero, una o più volte).&lt;br /&gt;
Il Sarcofago Nero può assumere N configurazioni al suo interno, numerate da 1 a N. La parola segreta &amp;nbsp; viene accettata se raggiunge la configurazione finale (avente numero N) a partire dalla configurazione iniziale (avente numero 1) dopo aver letto tutte le lettere in S una alla volta. Per ogni configurazione I &amp;nbsp;del Sarcofago Nero, la tripletta (I,J,c) indica che la lettera c lo fa transitare dalla configurazione I alla configurazione J.&lt;br /&gt;
L&#39;esercito rivale ha carpito una parola segreta S, ma non sa se è quella del Sarcofago Nero. Il tuo compito è quello di trovare la configurazione interna Q che esso raggiunge, dopo aver letto S, a partire dalla configurazione iniziale.&lt;br /&gt;
&lt;br /&gt;
Dati di input&lt;br /&gt;
Il file &amp;nbsp;input.txt &amp;nbsp;è composto da M+2 righe. La prima riga contiene tre interi positivi separati da uno&lt;br /&gt;
spazio, che rappresentano il numero M delle triplette, il numero N di configurazioni e il numero K di&lt;br /&gt;
lettere nella sequenza S. La seconda riga contiene K lettere separate da uno spazio, le quali formano la&lt;br /&gt;
sequenza S. Ciascuna delle rimanenti M righe contiene due interi positivi I e J e una lettera c, separati da una spazio, che rappresentano la tripletta (I,J,c) per la transizione del Sarcofago Nero.&lt;br /&gt;
Dati di output&lt;br /&gt;
Il file &amp;nbsp;output.txt &amp;nbsp;è composto da una sola riga contenente il numero Q della configurazione raggiunta&lt;br /&gt;
dal Sarcofago Nero a partire dalla sua configurazione iniziale (avente numero 1), dopo aver letto tutta la&lt;br /&gt;
sequenza S.&lt;br /&gt;
Assunzioni&lt;br /&gt;
2 ≤ M ≤ 100.&lt;br /&gt;
2 ≤ N ≤ 100.&lt;br /&gt;
2 ≤ K ≤ 10.&lt;br /&gt;
1 ≤ Q ≤ N.&lt;br /&gt;
&lt;br /&gt;
Esempi di input/output&lt;br /&gt;
File &amp;nbsp;input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp;File &amp;nbsp;output.txt&lt;br /&gt;
5 3 6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;br /&gt;
a a a b a b&lt;br /&gt;
1 3 a&lt;br /&gt;
1 2 b&lt;br /&gt;
2 1 a&lt;br /&gt;
3 2 b&lt;br /&gt;
3 3 a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Niente di più facile che modificare una variabile &amp;lt;Q&amp;gt; in base alle istruzioni memorizzate in un vettore trami te coppi char-int:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;vector&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define K 10&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#define N 100&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; pair&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;char&lt;/span&gt;,&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; ci;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; m,n,k,q&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;,t1,t2;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;char&lt;/span&gt; s[K],t3;
vector&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;ci&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; ijc [N&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;];

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;m&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;k;
 
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;k;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;s[i];

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;m;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t2&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t3;
 ijc[t1].push_back(ci(t3,t2));}

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;k;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; j&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; j&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt; ijc[q].size();j&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (ijc[q][j].first &lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;s[i])
   q&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; ijc[q][j].second;


out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;q;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/4334811929391542546/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-eserciti-galattici.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/4334811929391542546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/4334811929391542546'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-eserciti-galattici.html' title='[C++] Eserciti Galattici'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-6995069132873935371</id><published>2014-04-01T18:13:00.000+02:00</published><updated>2014-04-01T18:13:13.519+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Nanga</title><content type='html'>Durante la lunga scalata delle cime attorno al Nanga Parbat, Reinhold Messner riesce a trasmettere al&lt;br /&gt;
campo base, a intervalli regolari, solo il dislivello percorso rispetto all&#39;ultima trasmissione. Se invia un&lt;br /&gt;
numero positivo P, allora è salito di P metri rispetto alla precedente trasmissione; se invia un numero&lt;br /&gt;
negativo ­P, allora è sceso di P metri rispetto alla precedente trasmissione; se infine invia P=0, non ha&lt;br /&gt;
cambiato altitudine. Messner parte dal campo base a 5000 metri.&lt;br /&gt;
I suoi collaboratori al campo base ricevono tali rilevamenti: aiutali a identificare l&#39;altitudine che risulta&lt;br /&gt;
più frequentemente rilevata in questo modo.&lt;br /&gt;
&lt;br /&gt;
Dati di input&lt;br /&gt;
Il file &amp;nbsp;input.txt &amp;nbsp;è composto da N+1 righe. La prima riga contiene l&#39;intero positivo N, il numero dei&lt;br /&gt;
rilevamenti trasmessi da Messner. Ciascuna delle successive N righe contiene un intero che rappresenta&lt;br /&gt;
il dislivello percorso rispetto alla precedente trasmissione.&lt;br /&gt;
Dati di output&lt;br /&gt;
Il file &amp;nbsp;output.txt &amp;nbsp;è composto da una sola riga contenente l&#39;altitudine che risulta più frequentemente&lt;br /&gt;
rilevata in questo modo dal campo base.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
2 ≤ N ≤ 1000.&lt;br /&gt;
­100 ≤ P ≤ 100.&lt;br /&gt;
&lt;br /&gt;
Esempi di input/output&lt;br /&gt;
File &amp;nbsp;input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File &amp;nbsp;output.txt&lt;br /&gt;
8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5002&lt;br /&gt;
3&lt;br /&gt;
-1&lt;br /&gt;
6&lt;br /&gt;
-7&lt;br /&gt;
1&lt;br /&gt;
4&lt;br /&gt;
0&lt;br /&gt;
-4&lt;br /&gt;
&lt;br /&gt;
Registriamo i risultati su un vettore, poi &amp;nbsp;cercheremo il massimo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define base 5000 &lt;/span&gt;&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//metri&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#define N 10000&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#define no -1&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n,t,h&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;base,a[N][&lt;span style=&quot;color: #ff6600;&quot;&gt;2&lt;/span&gt;],l&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,maxn&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,maxi;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;cerca&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;l;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (a[i][&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;k)
  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; i;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; no;}

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t;
 h&lt;span style=&quot;color: #555555;&quot;&gt;+=&lt;/span&gt;t;
 t&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;cerca(h);
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (t&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;no){
  a[l][&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;h;
  a[l&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;][&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;;
 }&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt;
  a[t][&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
}

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;l;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (a[i][&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt;maxn){
  maxn &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;a[i][&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;];
  maxi&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;a[i][&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;];}

out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;maxi;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/6995069132873935371/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-nanga.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6995069132873935371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6995069132873935371'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-nanga.html' title='[C++] Nanga'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-1389604886949717716</id><published>2014-04-01T18:11:00.001+02:00</published><updated>2014-04-01T18:11:47.537+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Domino</title><content type='html'>Sono date N tessere di domino, dove ogni tessera contiene due numeri compresi da 0 a 6 in&lt;br /&gt;
corrispondenza delle sue due estremità. Le tessere possono essere ruotate e la regola impone che due&lt;br /&gt;
tessere possono essere concatenate se le loro estremità in contatto hanno inciso lo stesso numero. Aiuta a&lt;br /&gt;
trovare il maggior numero di tessere che si possono concatenare a formare un&#39;unica catena: non è detto&lt;br /&gt;
che si riescano sempre a usare tutte le tessere; inoltre, possono esserci due o più tessere uguali a meno di&lt;br /&gt;
rotazioni.&lt;br /&gt;
&lt;br /&gt;
Dati di input&lt;br /&gt;
Il file &amp;nbsp;input.txt &amp;nbsp;è composto da N+1 righe. La prima riga contiene l&#39;intero positivo N, il numero delle&lt;br /&gt;
tessere a disposizione. Ciascuna delle successive N righe contiene due interi positivi (compresi da 0 a 6)&lt;br /&gt;
separati da una spazio, che rappresentano i numeri incisi sulle estremità delle tessere.&lt;br /&gt;
Dati di output&lt;br /&gt;
Il file &amp;nbsp;output.txt &amp;nbsp;è composto da una sola riga contenente il massimo numero di tessere che possono&lt;br /&gt;
essere concatenate con le regole del domino.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
2 ≤ N ≤ 10.&lt;br /&gt;
&lt;br /&gt;
Esempi di input/output&lt;br /&gt;
File &amp;nbsp;input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File &amp;nbsp;output.txt&lt;br /&gt;
6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;br /&gt;
3 0&lt;br /&gt;
4 0&lt;br /&gt;
2 6&lt;br /&gt;
4 4&lt;br /&gt;
0 1&lt;br /&gt;
1 0&lt;br /&gt;
&lt;br /&gt;
Il risultato è dato dalla somma delle metà di tutte le somme di presenze di un numero meno 1:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstring&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define N 10&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n, t1,t2,v[&lt;span style=&quot;color: #ff6600;&quot;&gt;7&lt;/span&gt;],tes&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
 
memset(v,&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff6600;&quot;&gt;7&lt;/span&gt;);

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t2;
v[t1]&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
v[t2]&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
}

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;7&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (v[i]&lt;span style=&quot;color: #555555;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;)
  v[i]&lt;span style=&quot;color: #555555;&quot;&gt;--&lt;/span&gt;;
 tes&lt;span style=&quot;color: #555555;&quot;&gt;+=&lt;/span&gt;v[i]&lt;span style=&quot;color: #555555;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;2&lt;/span&gt;;}

out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;tes;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/1389604886949717716/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-domino.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/1389604886949717716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/1389604886949717716'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-domino.html' title='[C++] Domino'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-888147872296466350</id><published>2014-04-01T18:09:00.001+02:00</published><updated>2014-04-01T18:09:23.379+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Trovaparola</title><content type='html'>Luciano, patito di giochi di&lt;br /&gt;
tutti &amp;nbsp;i &amp;nbsp;tipi, &amp;nbsp;ha &amp;nbsp;ideato &amp;nbsp;un &amp;nbsp;nuovo &amp;nbsp;gioco, &amp;nbsp;che &amp;nbsp;funziona &amp;nbsp;nel &amp;nbsp;modo &amp;nbsp;seguente: &amp;nbsp;avete &amp;nbsp;una&lt;br /&gt;
griglia di caratteri e una parola da trovare nella griglia, partendo dalla cella in alto a&lt;br /&gt;
sinistra. &amp;nbsp;Le &amp;nbsp;uniche &amp;nbsp;mosse &amp;nbsp;consentite &amp;nbsp;sono &amp;nbsp;gli &amp;nbsp;spostamenti &amp;nbsp;a &amp;nbsp;destra &amp;nbsp;o &amp;nbsp;in &amp;nbsp;basso. &amp;nbsp;Ad&lt;br /&gt;
esempio, considerate la seguente griglia e la parola “olimpiadi”:&lt;br /&gt;
&lt;br /&gt;
O L &amp;nbsp;I &amp;nbsp; V E N T&lt;br /&gt;
G Q M P W E R&lt;br /&gt;
G T &amp;nbsp;R &amp;nbsp;I &amp;nbsp;A Y E&lt;br /&gt;
&amp;nbsp;I &amp;nbsp;U &amp;nbsp;I &amp;nbsp;C D P E&lt;br /&gt;
A F &amp;nbsp;C O &amp;nbsp;I &amp;nbsp;G H&lt;br /&gt;
&amp;nbsp;J K X &amp;nbsp;C V R S&lt;br /&gt;
R O M &amp;nbsp;I &amp;nbsp;T A A&lt;br /&gt;
S &amp;nbsp;T &amp;nbsp;A N L E E&lt;br /&gt;
&lt;br /&gt;
In &amp;nbsp;questo &amp;nbsp;caso, &amp;nbsp;la &amp;nbsp;sequenza &amp;nbsp;di &amp;nbsp;spostamenti &amp;nbsp;è &amp;nbsp;“DDBDBDBB”, &amp;nbsp;rappresentando &amp;nbsp;gli&lt;br /&gt;
spostamenti a destra con il carattere D e quelli in basso con il carattere B. Non esiste&lt;br /&gt;
nessuna soluzione, invece, se la parola da cercare è “olimpionico”. Il vostro compito&lt;br /&gt;
consiste nello scrivere un programma che, ricevute in ingresso una parola (da cercare)&lt;br /&gt;
e &amp;nbsp;una &amp;nbsp;griglia, &amp;nbsp;restituisca &amp;nbsp;la &amp;nbsp;sequenza &amp;nbsp;di &amp;nbsp;spostamenti, &amp;nbsp;qualora &amp;nbsp;esista &amp;nbsp;una &amp;nbsp;soluzione,&lt;br /&gt;
oppure stampi “ASSENTE”. Se dovessero esistere molteplici sequenze di spostamenti&lt;br /&gt;
corrette, è sufficiente stamparne una qualunque.&lt;br /&gt;
Dati di input&lt;br /&gt;
Il file input.txt è composto da 2+R righe. La prima riga contiene due interi positivi R e&lt;br /&gt;
C: le dimensioni della griglia, ovvero il numero di righe R e il numero di colonne C.&lt;br /&gt;
La &amp;nbsp;riga &amp;nbsp;successiva &amp;nbsp;contiene &amp;nbsp;P, &amp;nbsp;una &amp;nbsp;parola &amp;nbsp;da &amp;nbsp;cercare, &amp;nbsp;rappresentata &amp;nbsp;da &amp;nbsp;una &amp;nbsp;stringa&lt;br /&gt;
lunga &amp;nbsp;almeno &amp;nbsp;2 &amp;nbsp;caratteri &amp;nbsp;(alfabetici &amp;nbsp;maiuscoli) &amp;nbsp;e &amp;nbsp;al &amp;nbsp;massimo &amp;nbsp;R+C­1 &amp;nbsp;caratteri. &amp;nbsp;Le&lt;br /&gt;
rimanenti R righe del file contengono le righe della griglia, rappresentate da stringhe&lt;br /&gt;
di C caratteri alfabetici maiuscoli.&lt;br /&gt;
Dati di output&lt;br /&gt;
Il &amp;nbsp;file &amp;nbsp;output.txt &amp;nbsp;è &amp;nbsp;composto &amp;nbsp;da &amp;nbsp;una &amp;nbsp;sola &amp;nbsp;riga &amp;nbsp;contenente &amp;nbsp;una &amp;nbsp;stringa &amp;nbsp;di &amp;nbsp;testo: &amp;nbsp;la&lt;br /&gt;
sequenza &amp;nbsp;di &amp;nbsp;spostamenti &amp;nbsp;necessari &amp;nbsp;per &amp;nbsp;trovare &amp;nbsp;la &amp;nbsp;parola &amp;nbsp;nella &amp;nbsp;griglia, &amp;nbsp;se &amp;nbsp;la &amp;nbsp;parola &amp;nbsp;è&lt;br /&gt;
presente, oppure la stringa “ASSENTE” (senza le virgolette).&lt;br /&gt;
Assunzioni&lt;br /&gt;
• 2 ≤ R, C ≤ 100&lt;br /&gt;
Esempi di input/output&lt;br /&gt;
File input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File output.txt&lt;br /&gt;
8 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DDBDBDBB&lt;br /&gt;
OLIMPIADI&lt;br /&gt;
OLIVENT&lt;br /&gt;
GQMPWER&lt;br /&gt;
GTRIAYE&lt;br /&gt;
IUICDPE&lt;br /&gt;
AFCOIGH&lt;br /&gt;
JKXCVRS&lt;br /&gt;
ROMITAA&lt;br /&gt;
STANLEE&lt;br /&gt;
&lt;br /&gt;
File input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File output.txt&lt;br /&gt;
8 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ASSENTE&lt;br /&gt;
OLIMPIONICO&lt;br /&gt;
OLIVENT&lt;br /&gt;
GQMPWER&lt;br /&gt;
GTRIAYE&lt;br /&gt;
IUICDPE&lt;br /&gt;
AFCOIGH&lt;br /&gt;
JKXCVRS&lt;br /&gt;
ROMITAA&lt;br /&gt;
STANLEE&lt;br /&gt;
&lt;br /&gt;
Basta provare ad andare a destra e a sinistra con una funzione ricorsiva, arrivati alla fine si stampano i passaggi:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;string&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define M 101&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#define no &quot;ASSENTE&quot;&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;bool&lt;/span&gt; t&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #336666;&quot;&gt;true&lt;/span&gt;;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; r,c;
string p;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;char&lt;/span&gt; g [M][M];

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;cerca&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; rr, &lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; cc,string storia,&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; ch){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//prova a cercare la parola. Se non trova si ferma. Se trova stampa&lt;/span&gt;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; ( &lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;ch &lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt; p.length()){
 out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;storia;
t&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #336666;&quot;&gt;false&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt;;}
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (r&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt;rr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #555555;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; g [rr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;][cc]&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;p[ch])
 cerca (rr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;,cc,storia&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;B&quot;&lt;/span&gt;,ch);
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (c&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt;cc&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #555555;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; g [rr][cc&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;p[ch])
 cerca (rr,cc&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;,storia&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;D&quot;&lt;/span&gt;,ch);
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt;;
}

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;r&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;c&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;p;
 
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;r;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; j&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;j&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;c;j&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
  in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; g[i][j];

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (p[&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;g[&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;][&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;])
cerca (&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (t)
out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;no;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/888147872296466350/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-trovaparola.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/888147872296466350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/888147872296466350'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-trovaparola.html' title='[C++] Trovaparola'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-9013324374138517751</id><published>2014-04-01T18:03:00.000+02:00</published><updated>2014-04-01T18:03:22.241+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Gardaland</title><content type='html'>Nel 2012 le Olimpiadi Internazionali di Informatica (IOI) si sono svolte,&lt;br /&gt;
per &amp;nbsp;la &amp;nbsp;prima &amp;nbsp;volta, &amp;nbsp;in &amp;nbsp;Italia, &amp;nbsp;a &amp;nbsp;Sirmione. &amp;nbsp;Come &amp;nbsp;da &amp;nbsp;tradizione, &amp;nbsp;nella&lt;br /&gt;
giornata tra le due gare i concorrenti sono andati a divertirsi in un parco&lt;br /&gt;
giochi, in questo caso, Gardaland. La mattina di quel giorno decine di&lt;br /&gt;
pullman hanno prelevato i quattro ragazzi che costituiscono la squadra&lt;br /&gt;
olimpica &amp;nbsp;di &amp;nbsp;ciascuna &amp;nbsp;nazione &amp;nbsp;dal &amp;nbsp;Garda &amp;nbsp;Village, &amp;nbsp;dove &amp;nbsp;erano &amp;nbsp;stati&lt;br /&gt;
alloggiati, &amp;nbsp;e &amp;nbsp;li &amp;nbsp;hanno &amp;nbsp;portati &amp;nbsp;a &amp;nbsp;Gardaland. &amp;nbsp;Come &amp;nbsp;sempre &amp;nbsp;negli&lt;br /&gt;
spostamenti, &amp;nbsp;le &amp;nbsp;varie &amp;nbsp;nazioni &amp;nbsp;erano &amp;nbsp;state &amp;nbsp;ripartite &amp;nbsp;a &amp;nbsp;blocco &amp;nbsp;unico &amp;nbsp;tra &amp;nbsp;i&lt;br /&gt;
pullman, ossia tutti gli atleti di una stessa nazione trovavano posto su&lt;br /&gt;
uno &amp;nbsp;stesso &amp;nbsp;pullman. &amp;nbsp;Per &amp;nbsp;esempio, &amp;nbsp;sul &amp;nbsp;pullman &amp;nbsp;dell’Italia &amp;nbsp;viaggiavano&lt;br /&gt;
anche &amp;nbsp;Giappone, &amp;nbsp;Israele &amp;nbsp;e &amp;nbsp;Irlanda. &amp;nbsp;Al &amp;nbsp;ritorno &amp;nbsp;però, &amp;nbsp;come &amp;nbsp;sempre&lt;br /&gt;
succede alle IOI, dopo una giornata in un parco giochi i ragazzi hanno&lt;br /&gt;
fatto amicizia tra di loro, e al momento di tornare sui pullman sono saliti&lt;br /&gt;
alla rinfusa. Grazie al lavoro delle guide, per ogni pullman è stata stilata&lt;br /&gt;
una lista contenente, per ogni nazione, il numero di ragazzi a bordo. Il&lt;br /&gt;
vostro &amp;nbsp;compito &amp;nbsp;è &amp;nbsp;quello &amp;nbsp;di &amp;nbsp;aiutare &amp;nbsp;Monica, &amp;nbsp;responsabile&lt;br /&gt;
dell’organizzazione, &amp;nbsp;a &amp;nbsp;capire &amp;nbsp;se &amp;nbsp;i &amp;nbsp;pullman &amp;nbsp;possono &amp;nbsp;partire, &amp;nbsp;ovvero &amp;nbsp;se&lt;br /&gt;
tutti &amp;nbsp;i &amp;nbsp;quattro &amp;nbsp;ragazzi &amp;nbsp;di &amp;nbsp;ogni &amp;nbsp;nazione &amp;nbsp;che &amp;nbsp;sono &amp;nbsp;arrivati &amp;nbsp;a &amp;nbsp;Gardaland&lt;br /&gt;
sono saliti sui pullman. In caso contrario, dovete segnalare a Monica in&lt;br /&gt;
quanti mancano all’appello, divisi per nazioni.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Dati di input&lt;/b&gt;&lt;br /&gt;
Il file input.txt è composto da 1+N+L righe. La prima riga contiene due&lt;br /&gt;
interi &amp;nbsp;positivi &amp;nbsp;separati &amp;nbsp;da &amp;nbsp;uno &amp;nbsp;spazio: &amp;nbsp;il &amp;nbsp;numero &amp;nbsp;N &amp;nbsp;delle &amp;nbsp;nazioni &amp;nbsp;e &amp;nbsp;il&lt;br /&gt;
numero &amp;nbsp;L &amp;nbsp;di &amp;nbsp;righe &amp;nbsp;contenenti &amp;nbsp;informazioni &amp;nbsp;su &amp;nbsp;chi &amp;nbsp;è &amp;nbsp;attualmente &amp;nbsp;già&lt;br /&gt;
salito &amp;nbsp;sui &amp;nbsp;pullman. &amp;nbsp;(Ciascuna &amp;nbsp;nazione &amp;nbsp;verrà &amp;nbsp;qui &amp;nbsp;rappresentata &amp;nbsp;con &amp;nbsp;un&lt;br /&gt;
intero &amp;nbsp;compreso &amp;nbsp;tra &amp;nbsp;0 &amp;nbsp;e &amp;nbsp;N­1). &amp;nbsp;Ognuna &amp;nbsp;delle &amp;nbsp;successive &amp;nbsp;N &amp;nbsp;righe&lt;br /&gt;
contiene un intero positivo: nella riga i+1 (con i &amp;gt;= 1) troviamo il numero&lt;br /&gt;
totale &amp;nbsp;di &amp;nbsp;ragazzi &amp;nbsp;della &amp;nbsp;nazione &amp;nbsp;i­1. &amp;nbsp;Ciascuna &amp;nbsp;delle &amp;nbsp;rimanenti &amp;nbsp;L &amp;nbsp;righe&lt;br /&gt;
contiene &amp;nbsp;due &amp;nbsp;interi &amp;nbsp;positivi: &amp;nbsp;un &amp;nbsp;intero &amp;nbsp;compreso &amp;nbsp;tra &amp;nbsp;0 &amp;nbsp;e &amp;nbsp;N­1 &amp;nbsp;che&lt;br /&gt;
rappresenta la nazione, e un intero positivo che specifica quanti ragazzi&lt;br /&gt;
di &amp;nbsp;quella &amp;nbsp;nazione &amp;nbsp;sono &amp;nbsp;su &amp;nbsp;un &amp;nbsp;certo &amp;nbsp;pullman. &amp;nbsp;Ovviamente &amp;nbsp;una &amp;nbsp;stessa&lt;br /&gt;
nazione può comparire diverse volte nelle L righe, e più precisamente&lt;br /&gt;
compare &amp;nbsp;su &amp;nbsp;tante &amp;nbsp;righe &amp;nbsp;quanti &amp;nbsp;sono &amp;nbsp;i &amp;nbsp;pullman &amp;nbsp;ospitanti &amp;nbsp;atleti &amp;nbsp;di &amp;nbsp;quella&lt;br /&gt;
nazione.&lt;br /&gt;
&lt;b&gt;Dati di output&lt;/b&gt;&lt;br /&gt;
Il file output.txt è composto da una sola riga contenente l’intero 0 (zero)&lt;br /&gt;
se &amp;nbsp;non &amp;nbsp;manca &amp;nbsp;alcun &amp;nbsp;ragazzo. &amp;nbsp;Altrimenti, &amp;nbsp;il &amp;nbsp;file &amp;nbsp;contiene &amp;nbsp;1+C &amp;nbsp;righe: &amp;nbsp;la&lt;br /&gt;
prima riga contiene un intero C, ovvero il numero di nazioni che hanno&lt;br /&gt;
ragazzi ancora a Gardaland. Le restanti C righe contengono due interi:&lt;br /&gt;
l’identificativo della nazione e il numero di ragazzi di quella nazione che&lt;br /&gt;
non &amp;nbsp;sono &amp;nbsp;ancora &amp;nbsp;saliti &amp;nbsp;su &amp;nbsp;alcun &amp;nbsp;pullman. &amp;nbsp;E’ &amp;nbsp;necessario &amp;nbsp;stampare &amp;nbsp;le&lt;br /&gt;
nazioni nell’ordine in cui sono state lette, ovvero in ordine crescente in&lt;br /&gt;
base all’identificativo.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Assunzioni&lt;/b&gt;&lt;br /&gt;
2 ≤ N ≤ 100&lt;br /&gt;
N ≤ L ≤ 1000&lt;br /&gt;
&lt;br /&gt;
Contrariamente alle olimpiadi di informatica reali, dove gareggiano (massimo) 4 ragazzi per ogni nazione, nei casi di input si assume che ogni nazione abbia al massimo 100 ragazzi, e almeno 1 ragazzo.&lt;br /&gt;
&amp;nbsp;Quindi, indicando con Ri il numero&lt;br /&gt;
di ragazzi della i­esima nazione, vale sempre 1 ≤ Ri ≤ 100.&lt;br /&gt;
&lt;br /&gt;
Esempi di input/output&lt;br /&gt;
File input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File output.txt&lt;br /&gt;
3 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;br /&gt;
4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 1&lt;br /&gt;
4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 1&lt;br /&gt;
3&lt;br /&gt;
0 2&lt;br /&gt;
1 3&lt;br /&gt;
0 1&lt;br /&gt;
2 2&lt;br /&gt;
1 1&lt;br /&gt;
File input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File output.txt&lt;br /&gt;
3 6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;br /&gt;
4&lt;br /&gt;
4&lt;br /&gt;
4&lt;br /&gt;
0 2&lt;br /&gt;
1 3&lt;br /&gt;
2 1&lt;br /&gt;
0 2&lt;br /&gt;
2 3&lt;br /&gt;
1 1&lt;br /&gt;
&lt;br /&gt;
Basta contare quanti ragazzi non sono sugli autobus:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n,l,t1,t2,persi&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;l;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; rag[n];

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;rag[i];

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;l;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t2;
rag[t1]&lt;span style=&quot;color: #555555;&quot;&gt;-=&lt;/span&gt;t2;
}
 
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(rag[i]&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;)
  persi&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;

out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;persi;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(rag[i]&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;)
  out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc3300; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;rag[i];

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/9013324374138517751/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-gardaland.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/9013324374138517751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/9013324374138517751'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-gardaland.html' title='[C++] Gardaland'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-6480389612113644906</id><published>2014-04-01T17:58:00.000+02:00</published><updated>2014-04-01T17:58:25.533+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Brisbane</title><content type='html'>Nel 2013, le IOI si svolgeranno a Brisbane (in Australia). La rappresentativa italiana&lt;br /&gt;
ha &amp;nbsp;già &amp;nbsp;iniziato &amp;nbsp;a &amp;nbsp;studiare &amp;nbsp;la &amp;nbsp;città, &amp;nbsp;per &amp;nbsp;capire &amp;nbsp;cosa &amp;nbsp;ci &amp;nbsp;sia &amp;nbsp;di &amp;nbsp;interessante &amp;nbsp;da &amp;nbsp;vedere, &amp;nbsp;e&lt;br /&gt;
come &amp;nbsp;ci &amp;nbsp;si &amp;nbsp;possa &amp;nbsp;spostare &amp;nbsp;nella &amp;nbsp;giornata &amp;nbsp;libera &amp;nbsp;successiva &amp;nbsp;alla &amp;nbsp;seconda &amp;nbsp;gara &amp;nbsp;delle&lt;br /&gt;
Olimpiadi. L’offerta di trasporto pubblico a Brisbane è abbastanza variegata: ci sono&lt;br /&gt;
due linee di bus, di cui una gratuita che gira intorno alla città, e due linee di traghetti&lt;br /&gt;
che fermano in diversi punti del fiume Brisbane, che taglia la città in due; per quello&lt;br /&gt;
che &amp;nbsp;riguarda &amp;nbsp;i &amp;nbsp;prezzi, &amp;nbsp;esiste &amp;nbsp;un &amp;nbsp;abbonamento &amp;nbsp;giornaliero &amp;nbsp;a &amp;nbsp;tutti &amp;nbsp;i &amp;nbsp;trasporti &amp;nbsp;pubblici,&lt;br /&gt;
bus e traghetti insieme, oppure è possibile prendere un più economico abbonamento&lt;br /&gt;
giornaliero ai soli traghetti, o un ancor più economico abbonamento ai soli bus.&lt;br /&gt;
La &amp;nbsp;squadra &amp;nbsp;italiana &amp;nbsp;vorrà &amp;nbsp;visitare &amp;nbsp;il &amp;nbsp;maggior &amp;nbsp;numero &amp;nbsp;di &amp;nbsp;attrazioni &amp;nbsp;possibile &amp;nbsp;e &amp;nbsp;per&lt;br /&gt;
questo &amp;nbsp;motivo &amp;nbsp;Monica, &amp;nbsp;la &amp;nbsp;responsabile &amp;nbsp;dell’organizzazione, &amp;nbsp;ha &amp;nbsp;deciso &amp;nbsp;di &amp;nbsp;cercare &amp;nbsp;un&lt;br /&gt;
buon &amp;nbsp;compromesso &amp;nbsp;tra &amp;nbsp;il &amp;nbsp;prezzo &amp;nbsp;dei &amp;nbsp;biglietti &amp;nbsp;e &amp;nbsp;le &amp;nbsp;attrazioni &amp;nbsp;che &amp;nbsp;sarà &amp;nbsp;possibile&lt;br /&gt;
raggiungere &amp;nbsp;partendo &amp;nbsp;dall’hotel. &amp;nbsp;Data &amp;nbsp;una &amp;nbsp;lista &amp;nbsp;di &amp;nbsp;attrazioni &amp;nbsp;e &amp;nbsp;la &amp;nbsp;mappa &amp;nbsp;dei&lt;br /&gt;
collegamenti delle diverse linee del trasporto pubblico, il vostro compito è quello di&lt;br /&gt;
aiutare Monica a capire quante attrazioni sono raggiungibili per ogni possibile scelta&lt;br /&gt;
dei biglietti per i trasporti pubblici.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2M2WDMtKZc0AhAdGdKFP1-cU5vNJpycsrYhraq2oAk32rRGrwN-YJ1SMLAF5MAP4ViVXBimladjIDpkkMvKVYLzpV53C93LDazCHql1Tqs5s4rBEAfXfDq1xNZrvy3qZx7Vbd_qhebt-c/s1600/bris.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2M2WDMtKZc0AhAdGdKFP1-cU5vNJpycsrYhraq2oAk32rRGrwN-YJ1SMLAF5MAP4ViVXBimladjIDpkkMvKVYLzpV53C93LDazCHql1Tqs5s4rBEAfXfDq1xNZrvy3qZx7Vbd_qhebt-c/s1600/bris.png&quot; height=&quot;311&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Per esempio, possiamo fare riferimento alla figura qui a destra, dove ad ogni fermata è&lt;br /&gt;
associato un cerchio (o un quadrato nel caso di luogo di attrazione) e i collegamenti&lt;br /&gt;
sono:&lt;br /&gt;
tratteggiati – collegamenti gratuiti (bus gratuiti e brevi percorsi a piedi);&lt;br /&gt;
rossi – bus a pagamento;&lt;br /&gt;
gialli – traghetto.&lt;br /&gt;
Il punto di partenza della rappresentativa italiana è la fermata numero 0; le attrazioni&lt;br /&gt;
da vedere sono quelle rappresentate con un quadrato, numerate rispettivamente 8, 12,&lt;br /&gt;
15, 22 e 28. Come si può vedere, spostandosi con i mezzi gratuiti si raggiungono solo&lt;br /&gt;
due &amp;nbsp;attrazioni &amp;nbsp;(la &amp;nbsp;numero &amp;nbsp;8 &amp;nbsp;e &amp;nbsp;la &amp;nbsp;numero &amp;nbsp;14); &amp;nbsp;comprando &amp;nbsp;il &amp;nbsp;biglietto &amp;nbsp;del &amp;nbsp;bus &amp;nbsp;si&lt;br /&gt;
raggiungono &amp;nbsp;tutte &amp;nbsp;le &amp;nbsp;attrazioni; &amp;nbsp;comprando &amp;nbsp;il &amp;nbsp;biglietto &amp;nbsp;del &amp;nbsp;traghetto &amp;nbsp;si &amp;nbsp;raggiungono,&lt;br /&gt;
oltre alla 8 e la 14, anche la 12 e la 15 per un totale di quattro attrazioni. Il biglietto&lt;br /&gt;
combinato, in questo caso, raggiunge tutte le attrazioni.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Dati di input&lt;/b&gt;&lt;br /&gt;
Il file input.txt è composto da 1+A+Mg+Mb+Mt righe. La prima riga contiene cinque&lt;br /&gt;
interi positivi separati da uno spazio, che rappresentano il numero N delle fermate, il&lt;br /&gt;
numero &amp;nbsp;A &amp;nbsp;di &amp;nbsp;attrazioni, &amp;nbsp;il &amp;nbsp;numero &amp;nbsp;Mg &amp;nbsp;dei &amp;nbsp;collegamenti &amp;nbsp;gratuiti, &amp;nbsp;il &amp;nbsp;numero &amp;nbsp;Mb &amp;nbsp;dei&lt;br /&gt;
collegamenti &amp;nbsp;via &amp;nbsp;bus &amp;nbsp;e &amp;nbsp;il &amp;nbsp;numero &amp;nbsp;Mt dei collegamenti via traghetto. Ogni fermata è&lt;br /&gt;
rappresentata da un intero compreso tra 0 e N­1. Le successive A righe &amp;nbsp;contengono&lt;br /&gt;
ognuna &amp;nbsp;una &amp;nbsp;fermata &amp;nbsp;(un &amp;nbsp;intero &amp;nbsp;compreso &amp;nbsp;tra &amp;nbsp;0 &amp;nbsp;e &amp;nbsp;N­1) &amp;nbsp;corrispondente &amp;nbsp;ad &amp;nbsp;una &amp;nbsp;delle&lt;br /&gt;
attrazioni &amp;nbsp;che &amp;nbsp;la &amp;nbsp;rappresentativa &amp;nbsp;italiana &amp;nbsp;può &amp;nbsp;visitare. &amp;nbsp;Ognuna &amp;nbsp;delle &amp;nbsp;successive&lt;br /&gt;
Mg+Mb+Mt righe contiene un collegamento del trasporto pubblico, rappresentato da&lt;br /&gt;
due interi positivi: le fermate collegate. Le prime Mg righe contengono i collegamenti&lt;br /&gt;
gratuiti &amp;nbsp;(bus &amp;nbsp;gratuiti &amp;nbsp;e &amp;nbsp;brevi &amp;nbsp;percorsi &amp;nbsp;a &amp;nbsp;piedi), &amp;nbsp;poi &amp;nbsp;le &amp;nbsp;successive &amp;nbsp;Mb &amp;nbsp;contengono &amp;nbsp;i&lt;br /&gt;
collegamenti &amp;nbsp;del &amp;nbsp;bus &amp;nbsp;a &amp;nbsp;pagamento &amp;nbsp;e &amp;nbsp;infine &amp;nbsp;le &amp;nbsp;ultime &amp;nbsp;Mt &amp;nbsp;righe &amp;nbsp;contengono &amp;nbsp;i&lt;br /&gt;
collegamenti &amp;nbsp;dei &amp;nbsp;traghetti. &amp;nbsp;Il &amp;nbsp;punto &amp;nbsp;di &amp;nbsp;partenza &amp;nbsp;della &amp;nbsp;rappresentativa &amp;nbsp;italiana &amp;nbsp;è &amp;nbsp;la&lt;br /&gt;
sempre la fermata numero 0.&lt;br /&gt;
&lt;b&gt;Dati di output&lt;/b&gt;&lt;br /&gt;
Il file output.txt è composto da 4 righe contenenti ognuna un intero non negativo,&lt;br /&gt;
rispettivamente, il numero di attrazioni raggiungibili:&lt;br /&gt;
1. &amp;nbsp;senza comprare biglietti (solo con mezzi gratis);&lt;br /&gt;
2. &amp;nbsp;comprando solo il biglietto giornaliero dei bus;&lt;br /&gt;
3. &amp;nbsp;comprando solo il biglietto giornaliero dei traghetti;&lt;br /&gt;
4. &amp;nbsp;comprando entrambe le tipologie di biglietti.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Assunzioni&lt;/b&gt;&lt;br /&gt;
• 2 ≤ N ≤ 1000&lt;br /&gt;
• N ≤ Mg+Mb+Mt ≤ 10000&lt;br /&gt;
&lt;br /&gt;
Esempi di input/output&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;File input.txt                 File output.txt
&lt;span style=&quot;color: #073763;&quot;&gt;6 2 2 4 2                         1
1                                 1
5                                 2
0 1                               2
2 5
0 3
1 3
2 4
4 5
1 2
3 4 1&lt;/span&gt;

File input.txt  (corrisponde alla figura)  File output.txt
&lt;span style=&quot;color: #073763;&quot;&gt;30 5 18 14 11                                          2
8                                                      5
12                                                     4
15                                                     5
22  
28
0 5
0 24
1 8
1 25
2 3
2 23
5 11
8 14
11 16
13 17
14 19
16 20
18 22
19 21
20 22
21 22
23 24
23 25
1 4
2 28
2 29
4 7
4 8
7 29
12 26
14 15
15 19
15 21
17 21
18 21
26 27
27 28
3 7
3 25
6 9
6 13
7 15
9 10
10 17
12 16
12 18
13 15
17 18&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Qui bisogna scrivere le città nei grafi {gratis, col bus, col treno, tutti} e contare per ogni grafo quante tappe si possono raggiungere.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;vector&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;algorithm&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstring&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define M 10000&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n,a,cg,cb,ct,t1,t2,tg&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,tb&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,tt&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,tc&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;

vector&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; vg[M];
vector&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; vb[M];
vector&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; vt[M];
vector&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; vc[M];

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; attr[M];
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;bool&lt;/span&gt; vis[M];


&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;gg&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//esplora il grafo gratuito e somma le fermate con punti di attrazione&lt;/span&gt;
vis[k]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #336666;&quot;&gt;false&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (binary_search(attr,attr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;a,k))
 tg&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;vg[k].size();i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(vis[vg[k][i]])
  gg(vg[k][i]);}
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;gb&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//esplora il grafo bus e somma le fermate con punti di attrazione&lt;/span&gt;
vis[k]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #336666;&quot;&gt;false&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (binary_search(attr,attr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;a,k))
 tb&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;vb[k].size();i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(vis[vb[k][i]])
  gb(vb[k][i]);}
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;gt&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//esplora il grafo treno e somma le fermate con punti di attrazione&lt;/span&gt;
vis[k]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #336666;&quot;&gt;false&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (binary_search(attr,attr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;a,k))
 tt&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;vt[k].size();i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(vis[vt[k][i]])
  gt(vt[k][i]);}
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;gc&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//esplora il grafo combinato e somma le fermate con punti di attrazione&lt;/span&gt;
vis[k]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #336666;&quot;&gt;false&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (binary_search(attr,attr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;a,k))
 tc&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;vc[k].size();i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(vis[vc[k][i]])
  gc(vc[k][i]);}


&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;a&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;cg&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;cb&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;ct;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;a;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;attr[i];
sort(attr,attr&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;a);
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;cg;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t2;
 vg[t1].push_back(t2);
 vb[t1].push_back(t2);
 vt[t1].push_back(t2);
 vc[t1].push_back(t2);
 vg[t2].push_back(t1);
 vb[t2].push_back(t1);
 vt[t2].push_back(t1);
 vc[t2].push_back(t1);
 }
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;cb;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t2;
 vb[t1].push_back(t2);
 vc[t1].push_back(t2);
 vb[t2].push_back(t1);
 vc[t2].push_back(t1);
 }
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;ct;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t2;
 vt[t1].push_back(t2);
 vc[t1].push_back(t2);
 vt[t2].push_back(t1);
 vc[t2].push_back(t1);
 }
 


memset(vis,&lt;span style=&quot;color: #336666;&quot;&gt;true&lt;/span&gt;,n);
gg(&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);
memset(vis,&lt;span style=&quot;color: #336666;&quot;&gt;true&lt;/span&gt;,n);
gb(&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);
memset(vis,&lt;span style=&quot;color: #336666;&quot;&gt;true&lt;/span&gt;,n);
gt(&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);
memset(vis,&lt;span style=&quot;color: #336666;&quot;&gt;true&lt;/span&gt;,n);
gc(&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);


out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;tg&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc3300; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;tb&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc3300; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;tt&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc3300; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;tc;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/6480389612113644906/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-brisbane.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6480389612113644906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/6480389612113644906'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-brisbane.html' title='[C++] Brisbane'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2M2WDMtKZc0AhAdGdKFP1-cU5vNJpycsrYhraq2oAk32rRGrwN-YJ1SMLAF5MAP4ViVXBimladjIDpkkMvKVYLzpV53C93LDazCHql1Tqs5s4rBEAfXfDq1xNZrvy3qZx7Vbd_qhebt-c/s72-c/bris.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-2306998902138444744</id><published>2014-04-01T17:48:00.000+02:00</published><updated>2014-04-01T17:48:39.472+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Zig Zag</title><content type='html'>Una sequenza viene detta una sequenza a zig-zag se i valori delle differenze tra numeri successivi si alterna tra valori positivi e valori negativi. La prima differenza può essere negativa 0 positiva, se è negativa quella dopo deve essere positiva, se è positiva quella dopo deve essere negativa e così via. Una sequenza con meno di due elementi è anche una sequenza a zigzag. Ti viene data una sequenza di numeri, tu puoi decidere di eliminare quanti numeri vuoi dalla sequenza in modo che i numeri rimanenti formino una sequenza a zigzag. Trovare la sequenza a zigzag più lunga che è possibile ottenere e stampare la sua lunghezza.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
Il programma deve leggere dal ﬁle : la prima riga contiene un intero N. La seconda riga contiene N valori positivi, i valori della sequenza di partenza.&lt;br /&gt;
Output&lt;br /&gt;
Il programma deve scrivere nel ﬁle la risposta al problema.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
1 ≤ N ≤ 800&lt;br /&gt;
&lt;br /&gt;
Esempio&lt;br /&gt;
input&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;output&lt;br /&gt;
10 &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;7&lt;br /&gt;
1 17 5 10 13 15 10 5 16 8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Basta sfogliare la sringa ed eliminare tutti gli &quot;errori&quot; che si incontrano:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n;

     
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;iz&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #555555;&quot;&gt;*&lt;/span&gt;c, &lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n){
     &lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;bool&lt;/span&gt; positive;
     &lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; nc&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;n;
     positive&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; (c[&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;]&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;c[&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);
     &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
     &lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; d&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;c[i]&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;c[i&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;];
      &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (d&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;||&lt;/span&gt;(d&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #555555;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #555555;&quot;&gt;!&lt;/span&gt;positive)&lt;span style=&quot;color: #555555;&quot;&gt;||&lt;/span&gt;(d&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #555555;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; positive))
         nc&lt;span style=&quot;color: #555555;&quot;&gt;--&lt;/span&gt;;
      &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt;
      positive&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; (d &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);
         }
      &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; nc;
     }
 
 


&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;()
{   in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
    out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);
    
in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; c [n]; 
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
    in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;c[i];
    
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;2&lt;/span&gt;)
   out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;;

        
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt; 
out &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; iz(c,n);

    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/2306998902138444744/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-zig-zag.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2306998902138444744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/2306998902138444744'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-zig-zag.html' title='[C++] Zig Zag'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-7113998646026962141</id><published>2014-04-01T17:42:00.000+02:00</published><updated>2014-04-01T17:42:19.833+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Ristorante</title><content type='html'>Edoardo possiede un ristorante per al massimo N persone. L’entrata del ristorante ha un guardaroba con N appendini. Ogni cliente può usare un appendino del guardaroba per metterci le proprie giacche. Utilizzare l’iesimo gancio ha un costo ai in euro. Ogni persona può utilizzare al massimo un gancio.&lt;br /&gt;
Stasera Edoardo si aspetta di ricevere M clienti al ristorante. Naturalmente ogni cliente vorrà utilizzare gli appendini con il costo minimo (se ce ne sono di più con lo stesso costo, ne prenderà uno a caso tra questi). Purtroppo, se nel momento in cui un cliente arriva non ci sono appendini disponibili, Edoardo deve pagare una multa di D euro al cliente.&lt;br /&gt;
Aiuta Edoardo a trovare il proﬁtto in euro (può anche essere negativo) che avrà questa sera per quanto riguarda il guardaroba. Puoi assumere che prima che i clienti arrivino tutti gli appendini siano disponibili e che nessun altro a parte gli m clienti visiterà il ristorante.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
Il programma deve leggere da un ﬁle di nome “input.cxt”. La prima riga contiene due interi N e D.&lt;br /&gt;
La riga successiva contiene N interi, cioè a1, a2, ..., aN. La terza riga contiene l’intero M.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
Il programma deve stampare sul ﬁle la risposta al problema.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
1 ≤ N ≤ 100.000&lt;br /&gt;
1 ≤ M ≤ 200.000&lt;br /&gt;
1 ≤ ai ≤ 1000&lt;br /&gt;
1 ≤ D ≤ 2000&lt;br /&gt;
&lt;br /&gt;
Esempio&lt;br /&gt;
input &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;output&lt;br /&gt;
2 1&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; -5&lt;br /&gt;
2 1&lt;br /&gt;
1 0&lt;br /&gt;
&lt;br /&gt;
Ordinati i prezzi in ordine crescente li prendiamo tutti in ordine, finiti sottraiamo al profitto la multa:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;algorithm&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n,d,m,profitto;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;()
{   in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
    out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);
    
in &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;d;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; prezzi[n];
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
    in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;prezzi[i];
in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;m;

profitto&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;
sort(prezzi,prezzi&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;n);

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;m;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n)
           profitto&lt;span style=&quot;color: #555555;&quot;&gt;+=&lt;/span&gt;prezzi[i];
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt;
        profitto&lt;span style=&quot;color: #555555;&quot;&gt;-=&lt;/span&gt;d;
        
out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;profitto;

    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/7113998646026962141/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-ristorante.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/7113998646026962141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/7113998646026962141'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-ristorante.html' title='[C++] Ristorante'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-8494622478422460735</id><published>2014-04-01T17:37:00.001+02:00</published><updated>2014-04-01T17:37:26.961+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Ponti</title><content type='html'>Pesanti piogge hanno colpito il territorio e molte strade sono state rese totalmente inagibili. Diverse città sono quindi state totalmente disconnesse rendendo falso questo motto: &quot;ogni città è raggiungibile da ogni altra città&quot;.&lt;br /&gt;
E&#39; necessario quindi trovare il numero mimino di strade necessario per poter riaffermare il motto del territorio.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
Il programma deve leggere da un ﬁle di nome “input.txt” nel quale, nella prima riga, sono presenti due interi: il numero di citta N e il numero di strade M.&lt;br /&gt;
Le successive M righe contengono una coppia di interi i e j. Ogni coppia rappresenta un percorso ancora agibile tra la citta i e la citta j (e viceversa).&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
Il programma deve scrivere in un ﬁle “output.txt” il numero minimo di strade da construire per ricollegare tutte le città disconnesse.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
1 ≤ N ≤ 10.000&lt;br /&gt;
1 ≤ M ≤ 20.000&lt;br /&gt;
0 ≤ i, j &amp;lt; N&lt;br /&gt;
&lt;br /&gt;
Esempio&lt;br /&gt;
input.txt &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;output.txt&lt;br /&gt;
52 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;2&lt;br /&gt;
21&lt;br /&gt;
34&lt;br /&gt;
&lt;br /&gt;
Con un grafo contiamo quanti settori (gruppi di città non collegati fra loro) e al loro numero sottraiamo 1.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;vector&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstring&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//memset&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define NODI 10000&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; m,n,x,y,b&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,s;

vector&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; c [NODI];
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;bool&lt;/span&gt; v [NODI];

ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;e&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//esplora il grafo e quando si ferma aggiunge un blocco&lt;/span&gt;
v[k]&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;;
s&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;c[k].size();
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(s &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt; s; i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
  &lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; f &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; c[k][i]; 
  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(v[f] &lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;) 
   e(v[f]);} 
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt; 
 b&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
}

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){

in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;m;


memset(v,&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,n);

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;m;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;x&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;y;
c[x].push_back(y);
c[y].push_back(x);}

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt;(v[i]&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;)
  e(i);

out &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; (b&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;);

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/8494622478422460735/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-ponti.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/8494622478422460735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/8494622478422460735'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-ponti.html' title='[C++] Ponti'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-732300502953569930</id><published>2014-04-01T17:31:00.000+02:00</published><updated>2014-04-01T17:31:18.090+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Triangolo</title><content type='html'>&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp;8&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp;7 &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp;4&lt;br /&gt;
4 &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp;6 &amp;nbsp; &amp;nbsp;5&lt;br /&gt;
Questo è un triangolo!&lt;br /&gt;
&amp;nbsp;Scrivete un programma che calcoli la più grande somma di numeri ottenibile seguendo un percorso che parta dalla cima del triangolo e termini da qualche parte sulla sua base. Ad ogni passo si può procedere diagonalmente in basso o a destra o a sinistra.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
Il programma deve leggere da un ﬁle di nome ‘input.txt’. La prima riga del ﬁle contiene un’unico intero N, il numero di righe del triangolo. Le successive N righe contengono un numero crescente di interi 2&#39;, la n-esima riga contiene n interi separati da uno spazio.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
Il programma deve scrivere in un ﬁle di nome ‘output.txt’ la somma massima ottenibile dal triangolo.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
1 &amp;lt; N ≤ 100&lt;br /&gt;
0 &amp;lt; i &amp;lt; 100&lt;br /&gt;
&lt;br /&gt;
input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp;output.txt&lt;br /&gt;
5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;br /&gt;
7&lt;br /&gt;
3 8&lt;br /&gt;
8 1 0&lt;br /&gt;
2 7 4 4&lt;br /&gt;
4 5 2 6 5&lt;br /&gt;
&lt;br /&gt;
Partendo dal basso salviamo il punteggio maggiore fra i figli nel padre, il nonno di tutti (il vertice) avrà la risposta:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cassert&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #009999;&quot;&gt;#define UNKNOWN  -1&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#define N  100&lt;/span&gt;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; t[N][N],n,memoRisp[N&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;][N&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;];


&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;() {
  ifstream fin(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;); assert( fin );
  fin &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;
  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;=&lt;/span&gt; i; j&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
       fin &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; t[i][j];
  fin.close();


  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; i &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt; n; i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;=&lt;/span&gt; i; j&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
       memoRisp[i][j] &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; UNKNOWN;


  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;=&lt;/span&gt; n; j&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
     memoRisp[n][j] &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;
  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; n&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;; i &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; i&lt;span style=&quot;color: #555555;&quot;&gt;--&lt;/span&gt;)
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; j &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;; j &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;=&lt;/span&gt; i; j&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
       memoRisp[i][j] &lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt; t[i][j] &lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt; max( memoRisp[i&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;][j], memoRisp[i&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;][j&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;] );

  ofstream fout(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;); assert( fout );
  fout &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; memoRisp[&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;][&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl;
  fout.close();

  &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/732300502953569930/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-triangolo.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/732300502953569930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/732300502953569930'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-triangolo.html' title='[C++] Triangolo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-275974195566904197</id><published>2014-04-01T16:46:00.001+02:00</published><updated>2014-04-01T16:47:05.863+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Piastrelle</title><content type='html'>Giovanni vuole piastrellare il suo bagno. Il suo bagno è grande lxN e lui vorrebbe piastrellarlo con piastrelle grandi 1x2 e 1X1. Giovanni vuole decidere come piastrellare il suo bagno. Stampa a Giovanni tutte le possibili piastrellature del bagno, in modo da aiutarlo a scegliere.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
Il ﬁle ‘input.txt’ è costituito da un unico numero N, la dimensione del bagno.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
In questo ﬁle devono comparire tante righe quante sono le possibili piastrellature del bagno. Ogni piastrellatura possibile deve essere stampata in questo modo. Se la piastrella è da 1X1, stampare [O] (senza virgolette). Se la piastrella è da 1X2, stampare [OOOO], senza virgolette. Le piastrellature devono essere stampate in ordine lessicograﬁco in base alla grandezza delle piastrelle.&lt;br /&gt;
&lt;br /&gt;
Assunzioni 1 ≤ N ≤ 25&lt;br /&gt;
&lt;br /&gt;
input.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output.txt&lt;br /&gt;
4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[O][O][O][O]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [O][O][OOO]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [O][OOO][O]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [OOO][O][O]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [OOO][OOO]

&lt;br /&gt;
&lt;br /&gt;
Noi andremo, con una funzione ricorsiva, a scrivere &amp;nbsp;riga per riga le piastrellature.&lt;br /&gt;
Se ci fate caso questo problema si basa sui numeri di Fibonacci; per risolvere il numero di Fibonacci ci sono due principali algoritmi: uno basato sulla ricorsione (molto &amp;nbsp;lento) e uno molto veloce iterativo.&lt;br /&gt;
Risolvere questo problema iterativamente però è molto difficile, e considerato che in questo caso il massimo è 25 (numero relativamente basso) la soluzione ricorsiva non da problemi.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;string&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include &amp;lt;cassert&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define p1 &quot;[O]&quot;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#define p2 &quot;[OOOO]&quot;&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n;
ifstream in;
ofstream out;

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;stampaPiastr&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n, string storia){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;// stampa, una per riga, tutte le possibili diverse piastrallature del bagno 1xn.&lt;/span&gt;
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;// ciascuma prefissata dalla stringa &amp;lt;storia&amp;gt;&lt;/span&gt;

assert (n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;);

    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (n&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;) { &lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;// caso base&lt;/span&gt;
       out &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; storia &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc3300; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;;}
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (n&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;) { &lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;// saso base&lt;/span&gt;
       out &lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; storia&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;p1&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc3300; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&lt;/span&gt;;}
    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;else&lt;/span&gt; {
       stampaPiastr(n&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;1&lt;/span&gt;, storia&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;p1);
       stampaPiastr(n&lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;2&lt;/span&gt;, storia&lt;span style=&quot;color: #555555;&quot;&gt;+&lt;/span&gt;p2);
    }
}

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;() {
in.open (&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open (&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; n;

stampaPiastr(n,&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;&quot;&lt;/span&gt;);

    &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/275974195566904197/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-piastrelle.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/275974195566904197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/275974195566904197'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/04/c-piastrelle.html' title='[C++] Piastrelle'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-719006376003785905.post-7313887994775593180</id><published>2014-03-31T18:22:00.003+02:00</published><updated>2014-03-31T18:22:57.344+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esercizi C++"/><title type='text'>[C++] Problemi</title><content type='html'>Per il server centrale di questo istituto transitano tutte le connessioni ad internet, che, a quanto pare, stanno intasando tutta la rete. Il docente responsabile, quindi, sta procedendo con un’indagine per capire quali sono le cause di questi rallentamenti.&lt;br /&gt;
La rete della scuola è strutturata ad albero, in cima si trova il server centrale che è collegato a dei server periferici, i quali a loro volta possono essere collegati ad altri server, ecc. Ognuno di questi server viene deﬁnito “nodo di articolazione” se è collegato direttamente ad almeno un altro nodo di articolazione. I server che non sono collegati a nessun altro (le foglie dell’al— bero) sono i computer di un laboratorio e sono proprio quelli che utilizzano la banda!&lt;br /&gt;
A tutti i nodi di articolazione è associato un peso che rappresenta il valore massimo che può sopportare prima di causare problemi, a tutti gli altri nodi invece è associato un peso che rappresenta l’utilizzo medio della banda in quel laboratorio.&lt;br /&gt;
La banda passante per un nodo di articolazione viene calcolata sommando la banda passante di tutti i nodi di articolazione collegati in quel nodo più la banda dei laboratori direttamente collegati. Un nodo di articolazione da problemi se la banda passante è maggiore o uguale alla banda massima supportata.&lt;br /&gt;
Scrivere quindi un programma che, dato in input la rete della scuola, calcoli il numero dei nodi di articolazione che causano problemi.&lt;br /&gt;
&lt;br /&gt;
Input&lt;br /&gt;
&amp;nbsp;Il programma deve leggere da un ﬁle di nome ‘input.txt’. Nella prima riga sono presenti due interi separati da uno spazio: N e S, rispettivamente il numero di server in rete (compreso il server centrale e i server del laboratorio) e il numero del server centrale. Nelle successive N righe sono presenti due interi i, j.&lt;br /&gt;
i è il numero del server a cui il server corrente è collegato, j è la banda massima se è un nodo di articolazione, la banda media se è un server di un laboratorio.&lt;br /&gt;
&lt;br /&gt;
Output&lt;br /&gt;
Il programma deve scrivere in un ﬁle di nome ‘output/cxt’. Deve venire stampato un unico intero, la soluzione del problema.&lt;br /&gt;
&lt;br /&gt;
Assunzioni&lt;br /&gt;
0 &amp;lt; N &amp;lt;= 100.000&lt;br /&gt;
0 &amp;lt;= S &amp;lt; N&lt;br /&gt;
0 &amp;lt;= i &amp;lt; N&lt;br /&gt;
1&amp;lt;= j &amp;lt;= 1.000.000&lt;br /&gt;
Il server S è collegato a S&lt;br /&gt;
&lt;br /&gt;
Nell&#39;esempio i nodi 3 e 4 causano problemi:&lt;br /&gt;
input.txt &amp;nbsp; &amp;nbsp; output.txt&lt;br /&gt;
5 &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;br /&gt;
4 &amp;nbsp;1&lt;br /&gt;
3 &amp;nbsp;2&lt;br /&gt;
3 &amp;nbsp;2&lt;br /&gt;
4 &amp;nbsp;1&lt;br /&gt;
4 &amp;nbsp;2&lt;br /&gt;
&lt;br /&gt;
Questo è un classico problema ad albero: partendo dalle foglie (i computer che consumano banda) scriviamo il consumo nei padri, che lo scriveranno ai loro padri tramite una funzione ricorsiva.&lt;br /&gt;
Alla fine contando i nodi in cui il consumo supera la banda avremo la soluzione.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstdlib&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;fstream&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;vector&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009999;&quot;&gt;#include&amp;lt;cstring&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #009999;&quot;&gt;#define N 100000&lt;/span&gt;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;namespace&lt;/span&gt; std;

ifstream in;
ofstream out;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;struct&lt;/span&gt; nodo{
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; banda;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; padre;
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; consumo;};

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; n,s,p&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,t,size;
nodo pc[N];
&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; figli[N];

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;pa&lt;/span&gt;(&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; k){&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (k&lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;s) &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt;;
pc[pc[k].padre].consumo&lt;span style=&quot;color: #555555;&quot;&gt;+=&lt;/span&gt;pc[k].banda;
pa(pc[k].padre);}

&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #cc00ff;&quot;&gt;main&lt;/span&gt;(){
in.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;input.txt&quot;&lt;/span&gt;);
out.open(&lt;span style=&quot;color: #cc3300;&quot;&gt;&quot;output.txt&quot;&lt;/span&gt;);

in&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;n&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;s;

memset(figli,&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;,n);

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
 in &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;t&lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;pc[i].banda;
 figli[t]&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;
 pc[i].padre&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;t;
 pc[i].consumo&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;){
&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;// scrivi nel padre il consumo&lt;/span&gt;
&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (figli[i] &lt;span style=&quot;color: #555555;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;){&lt;span style=&quot;color: #0099ff; font-style: italic;&quot;&gt;//foglia&lt;/span&gt;
pc[pc[i].padre].consumo&lt;span style=&quot;color: #555555;&quot;&gt;+=&lt;/span&gt;pc[i].banda;
pa(pc[i].padre);
}}

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #007788; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #555555;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&lt;/span&gt;n;i&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;)
 &lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;if&lt;/span&gt; (pc[i].consumo &lt;span style=&quot;color: #555555;&quot;&gt;&amp;gt;&lt;/span&gt; pc[i].banda)
  p&lt;span style=&quot;color: #555555;&quot;&gt;++&lt;/span&gt;;

out&lt;span style=&quot;color: #555555;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;p;

&lt;span style=&quot;color: #006699; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff6600;&quot;&gt;0&lt;/span&gt;;}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://igiguide.blogspot.com/feeds/7313887994775593180/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://igiguide.blogspot.com/2014/03/c-problemi.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/7313887994775593180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/719006376003785905/posts/default/7313887994775593180'/><link rel='alternate' type='text/html' href='http://igiguide.blogspot.com/2014/03/c-problemi.html' title='[C++] Problemi'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15844825002473447594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>