comp.lang.ada
 help / color / mirror / Atom feed
From: Will <willmann817@gmail.com>
Subject: Re: Ada95 Help 2D arrays
Date: Fri, 20 Apr 2012 09:55:21 -0700 (PDT)
Date: 2012-04-20T09:55:21-07:00	[thread overview]
Message-ID: <11440502.478.1334940921729.JavaMail.geo-discussion-forums@yndm3> (raw)
In-Reply-To: <31137140.191.1334922395977.JavaMail.geo-discussion-forums@ynjb15>

You are

On Friday, April 20, 2012 7:46:35 AM UTC-4, 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.  Please send me your ideas if you can help.  Thanks again,
> 
> willmann817
> 
> 
> 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.
> 
> For example, consider the following grid:
> 
>    10 20 30 40
> 
>    20 30 20 20
> 
>    30 20 10 10
> 
>    40 20 10 40
> 
> 
> Your best option is to choose the first row and the first column, giving you a combined score of 190.
> 
> 
> Write a function Best_Combined_Score(Grid) that takes an Int_Matrix and returns the maximum combined score, as described above. You can assume that the grid is square, and that it contains only positive integers.

You are correct about Int_Matrix being defined already in another body and spec file. And the intersection should only be counted once as you said.  I will see what I can do about the algorithm.  Thanks a bunch

-willmann817



  parent reply	other threads:[~2012-04-20 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 11:46 Ada95 Help 2D arrays Will
2012-04-20 16:27 ` Niklas Holsti
2012-04-20 16:55 ` Will [this message]
2012-04-20 17:33 ` Will
2012-04-20 18:12   ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox