Public Judge

pjudge

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#21857. 【NOIP Round #7】填写数字

Statistics

给定两个长度为 $n$ 的正整数序列 $A,B$,定义 $f(x)$ 表示十进制下 $x$ 的位数。

小 K 需要从 $A$ 中选出一个数 $A_i$,在 $B$ 中选出一个数 $B_j$,你需要求出所有 $n^2$ 种选择方案中,$f(A_i+B_j)$ 的和。

形式化的说,你需要求出 $\sum_{i=1}^{n} \sum_{j=1}^{n} f(A_i+B_j)$。

输入格式

第一行一个正整数 $N$。

第二行 $N$ 个正整数表示序列 $A$。

第三行 $N$ 个正整数表示序列 $B$。

输出格式

输出一行一个整数表示答案。

输入输出样例

样例输入 1

3
97 79 7
20 2 21

样例输出 1

20

样例输入输出 2

见下发文件。

数据范围

对于所有数据,有:

  • $1 \le n \le 1.5 \times 10^5$
  • $1 \le A_i,B_j \lt 10^9$
子任务编号 特殊性质 分值
$1$ $n=1$ $10$
$2$ $n \le 2000$ $20$
$3$ $A_i,B_j \le 2000$ $10$
$4$ $10^8 \le A_i,B_j \le 5 \times 10^8$ $10$
$5$ $A_i,B_j \ge 10^8$ $10$
$6$ $A_i \le 1.5 \times 10^5,\space B_j=j$ $10$
$7$ $B_j = j$ $10$
$8$ 无特殊限制 $20$
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.