From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3cb31983495c2fde X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.169 with SMTP id nx9mr6111109pbb.2.1334939253935; Fri, 20 Apr 2012 09:27:33 -0700 (PDT) Path: r9ni78592pbh.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada95 Help 2D arrays Date: Fri, 20 Apr 2012 19:27:32 +0300 Organization: Tidorum Ltd Message-ID: <9vdh3kFu8rU1@mid.individual.net> References: <31137140.191.1334922395977.JavaMail.geo-discussion-forums@ynjb15> Mime-Version: 1.0 X-Trace: individual.net 9mhsGTPl9PrW1edWdgQ4/Qz8YvvIjPZXZiAycMQ5T6dPsmlsGV Cancel-Lock: sha1:/6O406f+d9mkHHm0n5NuG21qlsw= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 In-Reply-To: <31137140.191.1334922395977.JavaMail.geo-discussion-forums@ynjb15> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-04-20T19:27:32+03:00 List-Id: On 12-04-20 14:46 , Will wrote: > I really need help with the problem below... any ideas? I was > thinking about passing each row and column into their own arrays or > something but I am not even sure how to go about doing that. Before trying to write the solution in Ada, perhaps you should write down the algorithm in English, and show it here on the newsgroup. We can then suggest how to express it in Ada. > Many people across America participate in Superbowl pools. Your pool > is run a little differently from most. Instead of buying individual > squares from a grid, you purchase a row and a column. After > painstaking research, you have assigned an integer score to each > square representing the probability of that event occurring. You want > to buy the row and column with the maximum combined score, calculated > by adding all the individual scores in that row and column. It is not clearly said here, but it seems that the element at the intersection of the row and column should be counted only *once* in the combined score of this (row,column) combination. Otherwise, you could pick the best row and the best column independently of each other. > Write a function Best_Combined_Score(Grid) that takes an Int_Matrix Is the type Int_Matrix already defined somewhere? That would be a starting point. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .