Anche stavolta per ora vi presento i test effettuati. Personalmente mi e' sembrato di capire che alcuni programmi funzionassero bene per le istanze con poche iterazioni, ma davano errori come "Bus Error" o "Segmentation Fault" per le istanze con molte iterazioni. E credo che questi programmi allocassero troppa memoria (non era necessario allocare piu' memoria di quella occupata dai numeri in ingresso, implementando opportunamente la sottrazione). Eccovi i test e i relativi output attesi: ---+++ Test 0 <pre style='background:lightgrey'> 2 6 0 4 0 6 2 2 9 2 2 1 0 9 3 0 6 8 9 5 6 0 1 9 4 0 6 7 -1 2 0 3 9 0 2 1 1 0 4 9 1 6 8 6 8 2 3 7 2 6 3 6 3 5 1 2 7 -1 </pre> Output: <pre style='background:lightgrey'> 5002206470851693 </pre> ---+++ Test 1 <pre style='background:lightgrey'> 1 1 0 0 4 1 3 6 3 8 8 7 8 4 0 0 0 0 39 1 3 1 0 6 4 6 3 5 5 2 0 0 0 0 0 0 10 </pre> Output: <pre style='background:lightgrey'> 2520473760000 </pre> ---+++ Test 2 <pre style='background:lightgrey'> 3 2 7 7 0 2 7 8 2 4 1 5 2 3 2 0 1 6 9 1 8 4 7 6 2 2 9 7 2 0 5 6 9 1 3 4 3 2 3 5 3 0 8 7 6 6 9 7 6 9 6 1 2 8 9 -1 3 3 2 2 4 4 4 5 0 1 5 0 3 7 4 0 2 7 5 0 4 9 7 3 9 2 2 0 4 1 1 6 8 1 4 0 7 8 9 5 1 6 3 4 0 4 8 8 2 3 3 4 3 2 7 -1 </pre> Output: <pre style='background:lightgrey'> 1 </pre> ---+++ Test 3 <pre style='background:lightgrey'> 2 4 -1 1 8 -1 </pre> Output: <pre style='background:lightgrey'> 6 </pre> * Set ALLOWTOPICCHANGE = Users.DocentiProg1Group -- Users.IvanoSalvo - 29 Nov 2004 * Set ALLOWTOPICCHANGE = Users.DocentiProg1Group -- Users.IvanoSalvo - 09 Dec 2004
This topic: Programmazione1/AA0506/PZ
>
WebHome
>
HomeWork404
>
SoluzioneHomework404
Topic revision: r2 - 2005-01-26 - IvanoSalvo
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback