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.