QOJ.ac

QOJ

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

#22398. Och, te mody

Statistics

Jak inni nastolatkowie, młode krowy czasem ulegają modom: hula-hop, kamień-pupil, Counterstrike, Pokemon, Rick Astley lub plemienne tatuaże na wymionach.

Matematycznie początkowa atrakcyjność to $L$ ($1 \le L \le 50,000$). Opór krowy $i$ ($0 \le R_{i} \le 1,000,000$) mówi, jak długo unika mody, zanim nie ma alternatywy. Gdy atrakcyjność osiągnie lub przekroczy opór, chce uczestniczyć.

Każda uczestniczka zwiększa atrakcyjność przez presję rówieśniczą o $K$ ($1 \le K \le 2,500$).

Dla $N$ ($1 \le N \le 100,000$) krów wyznacz liczbę uczestniczek.

Wejście

  • Wiersz $1$: całkowite $N$, $L$, $K$ ze spacjami.

  • Wiersze $2..N+1$: wiersz $i+1$, opór krowy $i$, całkowite $R_{i}$.

Wyjście

  • Wiersz $1$: całkowite, końcowa liczba uczestniczek.

Przykład

Wejście 1

5 2 3
2
6
12
5
14

Wyjście 1

3

Uwagi

Pięć oporów $2,6,12,5,14$, początkowa atrakcyjność $2$; każda uczestniczka dodaje $3$ do wskaźnika.

$2$ przyciąga krowę nr $1$ (opór $2$) i rośnie do $5$; nr $4$ ($5$) podnosi do $8$; nr $2$ ($6$) do $11$. Nr $3$ ($12$) i nr $5$ ($14$) nie ulegają; łącznie $3$.

Autor zadania: 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.