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$ بأكبر مجموع لتسع قيم، واذكر أعلى يسارها صفًا ثم عمودًا. يمينًا أكبر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.