QOJ.ac

QOJ

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

#22399. עשב טוב

Statistics

Bessie מאמינה שעשב מיוחד במרעה האהוב הוא הטוב בעולם ומגדיל חלב.

כל פרה חזרה לנקודה מוקצית ברשת ישרה מלאה. בשמאל $NR$ שורות ($3 \le NR \le 100$),6, $NC$ עמודות ($3 \le NC \le 100$),5; הפרות 'C'.

יודעת ייצור $P_{rc}$ ($1 \le P_{rc} \le 100$), מסומן בימין.

               עמודה                      עמודה
           1  2  3  4  5               1  2  3  4  5
         +--------------             +--------------
        1| C  C  C  C  C            1| 5  6  7  4  6
 שורה  2| C  C  C  C  C     שורה  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

מחפשת עשב באמצעות $3 \times 3$ עם סך חלב מרבי.

מצאו $3 \times 3$ עם סכום9 מרבי והפינה השמאלית העליונה, שורה ואז עמודה. בימין מרב71, שורה2 עמודה1.

סכום שווה ב־$3 \times 3$: שורה מינימלית, תיקו בה עמודה מינימלית.

קלט

  • שורה1: שני שלמים ברווח $NR$, $NC$.
  • שורות $2..NR+1$: שורה $r+1$ עם $NC$ שלמים ברווחים לשורה $r$.

פלט

  • שורה1: שלם, סך מרבי $3 \times 3$.
  • שורה2: שני שלמים ברווח, שורה ועמודה בפינה העליונה של הטוב $3 \times 3$.

דוגמאות

קלט 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

פלט 1

71
2 1

מחבר הבעיה: 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.