Universal Cup Judging System

Universal Cup

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100
Statistics

Бізде нөлге тең емес $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$) берілген.

Екінші жолда 1–9 цифрларынан тұратын ұзындығы $n$ жол берілген.

Шығыс деректер

Барлық өрнектердің қосындысын $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.