QOJ.ac

QOJ

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

#22398. Oh, diese Trends

Statistics

Wie andere Jugendliche folgen junge Kühe gelegentlich Trends: Hula-Hoop-Reifen, Haustierstein, Counterstrike, Pokemon, Rick Astley oder Stammes-Tattoos am Euter.

Mathematisch hat ein Trend Anfangsattraktivität $L$ ($1 \le L \le 50,000$). Der Widerstand von Kuh $i$ ($0 \le R_{i} \le 1,000,000$) sagt, wie lange sie widersteht, bis keine Alternative bleibt. Erreicht oder überschreitet die Attraktivität ihn, will sie teilnehmen.

Jede Teilnehmerin erhöht durch Gruppendruck die Attraktivität um $K$ ($1 \le K \le 2,500$).

Bestimme bei $N$ ($1 \le N \le 100,000$) Kühen die Teilnehmerzahl.

Eingabe

  • Zeile $1$: ganze Zahlen $N$, $L$, $K$ mit Leerzeichen.

  • Zeilen $2..N+1$: Zeile $i+1$, Widerstand von Kuh $i$, ganze Zahl $R_{i}$.

Ausgabe

  • Zeile $1$: ganze Zahl, endgültige Teilnehmerzahl.

Beispiele

Eingabe 1

5 2 3
2
6
12
5
14

Ausgabe 1

3

Hinweis

Fünf Widerstände $2,6,12,5,14$, Anfangsattraktivität $2$; jede Teilnehmerin erhöht den Index um $3$.

$2$ zieht Kuh Nr.$1$ (Widerstand $2$) an und steigt auf $5$; Nr.$4$ ($5$) erhöht auf $8$; Nr.$2$ ($6$) auf $11$. Nr.$3$ ($12$) und Nr.$5$ ($14$) werden nicht hineingezogen; insgesamt $3$.

Aufgabenautor: 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.