QOJ.ac

QOJ

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

#23880. Quersumme

Statistics

Aufgabenstellung

JOI-kun hatte anfangs eine bestimmte ganze Zahl zwischen $1$ und einschließlich $N$. Nachdem JOI-kun die folgende Operation $0$-mal oder öfter ausgeführt hatte, wurde die Zahl, die er hatte, zu $N$:

  • Addiere zur aktuellen ganzen Zahl die Summe ihrer Ziffern in der Darstellung zur Basis $10$.

Schreibe ein Programm, das für ein gegebenes $N$ die Anzahl der ganzen Zahlen bestimmt, die JOI-kun anfangs gehabt haben könnte.

Bedingungen

  • $1 \le N \le 1\,000\,000$.
  • $N$ ist eine ganze Zahl.

Eingabe

Die Eingabe erfolgt über die Standardeingabe im folgenden Format:

N

Ausgabe

Gib in $1$ Zeile die Anzahl der ganzen Zahlen aus, die JOI-kun anfangs gehabt haben könnte.

Beispiel 1

Eingabe

13

Ausgabe

4

Wenn JOI-kun beispielsweise anfangs die ganze Zahl $5$ hatte und die Operation $3$-mal ausgeführt hat, ändert sie sich gemäß $5 \to 10 \to 11 \to 13$. Es gibt nur $4$ ganze Zahlen, die JOI-kun anfangs gehabt haben könnte: $5, 10, 11, 13$.

Beispiel 2

Eingabe

20

Ausgabe

1

Beispiel 3

Eingabe

2019

Ausgabe

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.