Universal Cup Judging System

Universal Cup

Time Limit: 2.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

Gegeben ist eine ganze Zahl $N$ in Dezimaldarstellung.

Betrachte alle ganzen Zahlen, die durch Umordnen der Ziffern von $N$ gebildet werden können, sodass die entstehende Zahl keine führenden Nullen hat.

Bestimme die Anzahl solcher ganzer Zahlen, die durch $11$ teilbar sind, modulo $2147483647$ ($= 2^{31} - 1$), was eine Primzahl ist.

Beachte, dass zu den durch Umordnen der Ziffern von $N$ gebildeten ganzen Zahlen auch $N$ selbst gehört.

Eingabe

Die Eingabe erfolgt im folgenden Format:

$$N$$

  • Alle Eingabewerte sind ganze Zahlen.
  • $1 \le N < 10^{2 \times 10^6}$
  • $N$ wird in Dezimaldarstellung ohne führende Nullen angegeben.

Ausgabe

Gib die Antwort in einer einzigen Zeile aus.

Beispiele

Eingabe 1

1001

Ausgabe 1

2

Eingabe 2

31415926535

Ausgabe 2

144000

Hinweis

Im ersten Beispiel erfüllen $1100$ und $1001$ die Bedingung.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1408EditorialOpen题解jianglyView

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.