QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 32 MB Puntuación total: 100

#11496. 密码

Estadísticas

注意:本题描述已针对原竞赛版本进行了微调,以便提交程序而非输出文件。

给定一个正整数序列 $a_i$(其中 $i = 1, 2, \ldots, n$)。该序列用于加密 $n$ 位消息。如果我们有一条由连续位 $(t_1, \ldots, t_n)$ 组成的消息($t_i$ 为 $0$ 或 $1$),则其加密结果为数字:

$$S = t_1a_1 + t_2a_2 + \ldots + t_na_n$$

给定加密后的消息以及用于加密这些消息的数字序列 ($a_i$)。你的任务是解密这些加密消息并将其保存到特定文件中。你不需要提交任何程序,只需输出解密后的消息即可。

输入格式

标准输入的第一行包含一个整数 $n$,$5 \le n \le 40$。接下来的 $n$ 行包含序列中的数字 ($a_i$):第 $i+1$ 行包含一个正整数 $a_i$。所有 $a_i$ 的总和不超过 $2\,000\,000\,000$。第 $n+2$ 行包含一个整数 $S$,即加密后的消息,$0 \le S \le a_1 + a_2 + \ldots + a_n$。

输出格式

在标准输出的第一行,你应该输出连续的数字 $t_i$,中间不要有任何空格。测试数据保证加密消息的解密结果是唯一确定的。

样例

输入 1

24
19226985
123697
67356296
19721773
1113273
69335448
23680077
9029881
85168664
93676782
5253843
77616588
78572630
13375812
17199980
101508862
59248276
3505733
35790095
62028546
85726819
56462819
103373994
91757169
667509506

输出 1

110001000101101100010101

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.