QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 256 MB مجموع النقاط: 100

#22398. Ah, quelle mode

الإحصائيات

Come gli altri adolescenti, le giovani mucche talvolta seguono mode: hula hoop, pietra da compagnia, Counterstrike, Pokemon, Rick Astley o tatuaggi tribali sulle mammelle.

Matematicamente, l’attrattiva iniziale è $L$ ($1 \le L \le 50,000$). La resistenza della mucca $i$ ($0 \le R_{i} \le 1,000,000$) indica quanto evita la moda prima di non avere alternative. Se l’attrattiva raggiunge o supera la resistenza vuole partecipare.

Ogni partecipante aumenta l’attrattiva di $K$ ($1 \le K \le 2,500$) tramite pressione dei pari.

Date $N$ ($1 \le N \le 100,000$) mucche, determina quante partecipano.

Input

  • Riga $1$: interi $N$, $L$, $K$ separati da spazi.

  • Righe $2..N+1$: riga $i+1$, resistenza della mucca $i$, intero $R_{i}$.

Output

  • Riga $1$: intero, partecipanti finali.

Esempi

Input 1

5 2 3
2
6
12
5
14

Output 1

3

Nota

Cinque resistenze $2,6,12,5,14$, attrattiva iniziale $2$; ogni partecipante aggiunge $3$ all’indice.

$2$ attira mucca nº$1$ (resistenza $2$) e sale a $5$; nº$4$ ($5$) sale a $8$; nº$2$ ($6$) a $11$. Né nº$3$ ($12$) né nº$5$ ($14$) aderisce; totale $3$.

Autore del problema: 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.