Submit an Entry

To enter the challenge, you need to signup or login.

This Challenge's Best Entries [View All]

(View the Overall | Perl | PHP | Python | Ruby leaderboard.)

Rank User Size Language Score [?]
1st tybalt89 43 Perl 10,000 (v6)
2nd eyepopslikeamosquito 43 Perl 10,000 (v11)
3rd kounoike 44 Perl 9,772 (v13)
4th o0lit3 44 Perl 9,772 (v46)
5th Jasper 44 Perl 9,772 (v33)
6th Aidy 45 Perl 9,555 (v23)
7th pung96 46 Perl 9,347 (v14)
8th terjek 46 Perl 9,347 (v8)
9th shinh 47 Perl 9,148 (v17)
10th difro 47 Perl 9,148 (v22)

See who is active in this challenge →

Grid Computing

(Challenge added 230 days ago.)

We're Back!

Discuss This Challenge →

The Problem

This simple challenge requires you to calculate the maximum value found by summing all the rows and columns of a grid of numbers.

More Information

Standard input will be a 10x10 grid of 0-padded numbers ranging from 00 to 99, as in the following example:

01 34 46 31 55 21 16 88 87 87
32 40 82 40 43 96 08 82 41 86
30 16 24 18 04 54 65 96 38 48
32 00 99 90 24 75 89 41 04 01
11 80 31 83 08 93 37 96 27 64
09 81 28 41 48 23 68 55 86 72
64 61 14 55 33 39 40 18 57 59
49 34 50 81 85 12 22 54 80 76
18 45 50 26 81 95 25 14 46 75
22 52 37 50 37 40 16 71 52 17

Each number is separated by a single space, and each line (including the last) ends with a newline.

Your entry should calculate the sum of each row and column in the grid and print out only the maximum attained value, which for the above example would be:

615

Obtained by the sum of the 8th column:

01 34 46 31 55 21 16 88 87 87
32 40 82 40 43 96 08 82 41 86
30 16 24 18 04 54 65 96 38 48
32 00 99 90 24 75 89 41 04 01
11 80 31 83 08 93 37 96 27 64
09 81 28 41 48 23 68 55 86 72
64 61 14 55 33 39 40 18 57 59
49 34 50 81 85 12 22 54 80 76
18 45 50 26 81 95 25 14 46 75
22 52 37 50 37 40 16 71 52 17

Your code will be run twenty times for each submission. The first test each time will be the grid shown above. The other nineteen tests will be a different grid of numbers each time. Your submission will need to pass all twenty tests to be deemed successful.

Examples

Click here to see an example grid. Reload the page to see more examples.

Thanks

Thanks to Ciaran Walsh for submitting the challenge and giving you all something new to play with.