Universal Cup Judging System

Universal Cup

実行時間制限: 1.0 s メモリ制限: 1024 MB 満点: 100
統計

נתונה מחרוזת המורכבת מ-$n$ ספרות שונות מאפס. אנו יכולים ליצור ביטוי על ידי הכנסת תו אחד לכל היותר מבין התווים $+$ (חיבור) או $\cdot$ (כפל) בין כל שתי ספרות עוקבות. לדוגמה, מהמחרוזת 231 אנו יכולים ליצור תשעה ביטויים:

$231$, $23 + 1$, $23 \cdot 1$, $2 + 31$, $2 \cdot 31$, $2 + 3 + 1$, $2 + 3 \cdot 1$, $2 \cdot 3 + 1$, $2 \cdot 3 \cdot 1$.

אנו מחשבים את ערכי הביטויים הללו לפי סדר הפעולות הסטנדרטי, ומחשבים את סכום כל הערכים. עבור הדוגמה שלנו נקבל

$$231 + 24 + 23 + 33 + 62 + 6 + 5 + 7 + 6 = 397$$

חשבו את הסכום הנ"ל מודולו $10^9 + 7$.

קלט

השורה הראשונה של הקלט מכילה מספר שלם אחד $n$ ($1 \le n \le 10^6$), המציין את אורך המחרוזת.

השורה השנייה מכילה מחרוזת באורך $n$ המורכבת מהספרות 1–9.

פלט

פלטו מספר שלם אחד, סכום כל הביטויים מודולו $10^9 + 7$.

דוגמה

קלט

3
231

פלט

397

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1053EditorialOpen题解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.