QOJ.ac

QOJ

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

#22398. Ôi, những trào lưu

Statistics

Như thiếu niên khác, bò trẻ đôi lúc bị trào lưu cuốn hút: vòng hula, đá thú cưng, Counterstrike, Pokemon, Rick Astley hay hình xăm bộ lạc trên bầu vú.

Về toán học, sức hút đầu là $L$ ($1 \le L \le 50,000$). Sức kháng của bò $i$ ($0 \le R_{i} \le 1,000,000$) cho biết nó tránh bao lâu trước khi buộc tham gia. Khi sức hút đạt hoặc vượt sức kháng, bò muốn tham gia.

Mỗi bò tham gia tăng sức hút $K$ ($1 \le K \le 2,500$) nhờ áp lực bạn bè.

Với $N$ ($1 \le N \le 100,000$) bò, tìm số tham gia.

Dữ liệu vào

  • Dòng $1$: số nguyên $N$, $L$, $K$ cách bằng dấu cách.

  • Dòng $2..N+1$: dòng $i+1$ chứa sức kháng bò $i$, số nguyên $R_{i}$.

Dữ liệu ra

  • Dòng $1$: số nguyên, số bò cuối cùng tham gia.

Ví dụ

Dữ liệu vào 1

5 2 3
2
6
12
5
14

Dữ liệu ra 1

3

Ghi chú

Năm sức kháng $2,6,12,5,14$, sức hút đầu $2$; mỗi bò tham gia thêm $3$ vào chỉ số.

$2$ hút bò số $1$ (kháng $2$) tăng lên $5$; số $4$ ($5$) tăng lên $8$; số $2$ ($6$) tăng lên $11$. Số $3$ ($12$), số $5$ ($14$) không bị cuốn vào; tổng $3$.

Tác giả bài toán: 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.