QOJ.ac

QOJ

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

#22673. Romeo פוגש את Juliet

Statistics

העדרים Moontagues ו-Cowpulets של Farmer John מסוכסכים. הפר Romeo, Moontague, מאוהב ב-Juliet, Cowpulet, ורוצה לפגוש אותה בלי שיתר Cowpulets יגלו.

רוצים להיפגש ולרעות בשטח הגדול ביותר ליד הגדר, בלי יותר מדי Cowpulets בגלל סיכון הגילוי. Romeo יודע את מיקומי $N$ Cowpulets ($1 \le N \le 1000$). בגדר הארוכה הישרה $P$ עמודים שווי מרחק ($1 \le P \le 1000$), מספרים $1\ldots P$; כל פרה בין סמוכים. מצאו את השטח הרציף הארוך ביותר עם לכל היותר $C$ ($0 \le C \le 1000$) Cowpulets.

קלט

  • שורה $1$: שלושה שלמים מופרדים $N$, $P$, $C$.

  • שורות $2\ldots N+1$: שלם $X$ ($1\ldots P-1$), פרה בין $X$, $X+1$. יכולות להיות כמה בין אותו זוג.

פלט

  • שורה $1$: שלם, מספר הרווחים בשטח הרציף הגדול ביותר עם לכל היותר $C$ Cowpulets.

דוגמאות

קלט 1

2 6 1
2
3

פלט 1

3

הסבר

שישה עמודים $1,2,3,4,5,6$; שתי Cowpulets בין $2$, $3$ ובין $3$, $4$.

בין $3$, $6$, אורך $3$, יש רק Cowpulet אחת.

בעיה 8: Romeo פוגש את Juliet [???, 26/0]

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.