QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22399. Dobra trawa

Statistics

Bessie wierzy, że specjalna trawa ulubionego pastwiska jest najlepsza świata i zwiększa mleko.

Krowy wróciły do przypisanych punktów pełnej prostoliniowej siatki. Lewo $NR$ wierszy ($3 \le NR \le 100$),6, $NC$ kolumn ($3 \le NC \le 100$),5; krowy 'C'.

Zna produkcję $P_{rc}$ ($1 \le P_{rc} \le 100$), oznaczoną po prawej.

               KOLUMNA                      KOLUMNA
           1  2  3  4  5               1  2  3  4  5
         +--------------             +--------------
        1| C  C  C  C  C            1| 5  6  7  4  6
 WIERSZ  2| C  C  C  C  C     WIERSZ  2| 7  7  8  6  5
        3| C  C  C  C  C            3| 9  9  8  3  5
        4| C  C  C  C  C            4| 8  8  7  6  4
        5| C  C  C  C  C            5| 4  5  2  4  5
        6| C  C  C  C  C            6| 3  4  2  3  4

Szuka trawy poprzez $3 \times 3$ z maksymalną sumą mleka.

Znajdź $3 \times 3$ z największą sumą9 wartości i górny lewy róg, wiersz potem kolumna. Prawo maksimum71, wiersz2 kolumna1.

Równa suma $3 \times 3$: najmniejszy wiersz; remis w nim: najmniejsza kolumna.

Wejście

  • Wiersz1: dwie całkowite ze spacją $NR$, $NC$.
  • Wiersze $2..NR+1$: wiersz $r+1$ ma $NC$ całkowite ze spacjami rzędu $r$.

Wyjście

  • Wiersz1: całkowita, największa suma $3 \times 3$.
  • Wiersz2: dwie całkowite ze spacją, wiersz i kolumna najlepszego $3 \times 3$.

Przykład

Wejście 1

6 5
5 6 7 4 6
7 7 8 6 5
9 9 8 3 5
8 8 7 6 4
4 5 2 4 5
3 4 2 3 4

Wyjście 1

71
2 1

Autor zadania: Rob Kolstad, 2009

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.