QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 256 MB 총점: 100

#22398. אה, האופנות האלה

통계

כמו בני נוער אחרים, פרות צעירות נסחפות לפעמים באופנות: הולה הופ, אבן מחמד, Counterstrike, Pokemon, Rick Astley או קעקועים שבטיים על עטיניהן.

מתמטית, משיכה התחלתית היא $L$ ($1 \le L \le 50,000$). התנגדות פרה $i$ ($0 \le R_{i} \le 1,000,000$) אומרת כמה זמן היא נמנעת עד שאין ברירה אלא להשתתף. כשהמשיכה מגיעה להתנגדות או עולה עליה היא רוצה להצטרף.

כל משתתפת מגדילה בלחץ חברתי את המשיכה ב־$K$ ($1 \le K \le 2,500$).

עבור $N$ ($1 \le N \le 100,000$) פרות מצאו כמה ישתתפו.

קלט

  • שורה $1$: שלמים $N$, $L$, $K$ ברווחים.

  • שורות $2..N+1$: שורה $i+1$ מכילה התנגדות פרה $i$, שלם $R_{i}$.

פלט

  • שורה $1$: שלם, מספר משתתפות סופי.

דוגמאות

קלט 1

5 2 3
2
6
12
5
14

פלט 1

3

הערה

חמש התנגדויות $2,6,12,5,14$, משיכה התחלתית $2$; כל משתתפת מוסיפה $3$ למדד.

$2$ מושכת פרה מספר $1$ (התנגדות $2$) ומעלה ל־$5$; מספר $4$ ($5$) מעלה ל־$8$; מספר $2$ ($6$) ל־$11$. מספר $3$ ($12$) ומספר $5$ ($14$) אינן נסחפות; סך $3$.

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