QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 1024 MB Toplam puan: 100

#23880. Siffersumma

İstatistikler

Problembeskrivning

JOI-kun hade från början ett visst heltal mellan $1$ och $N$, inklusive. Efter att JOI-kun utfört följande operation $0$ eller fler gånger blev heltalet han hade lika med $N$:

  • Addera siffersumman av det nuvarande heltalet (när det skrivs i bas $10$) till det nuvarande heltalet.

Givet $N$, skriv ett program som beräknar antalet heltal som JOI-kun kan ha haft från början.

Begränsningar

  • $1 \le N \le 1\,000\,000$.
  • $N$ är ett heltal.

Indata

Indata ges från standardinmatningen i följande format:

N

Utdata

Skriv på $1$ rad ut antalet heltal som JOI-kun kan ha haft från början.

Exempel 1

Indata

13

Utdata

4

Om JOI-kun till exempel hade heltalet $5$ från början och utförde operationen $3$ gånger ändras det enligt $5 \to 10 \to 11 \to 13$. Det finns bara $4$ heltal som JOI-kun kan ha haft från början: $5, 10, 11, 13$.

Exempel 2

Indata

20

Utdata

1

Exempel 3

Indata

2019

Utdata

449

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.