問題一覧 > 通常問題

No.3562 Communicate Sorted Vector

レベル : / AI推定難易度 : 2050 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / コミュニケーション問題 (詳しくはこちら)
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 21
作問者 : jastaway / テスター : 👑 みうね fluorine TKTYI HoyHoyCharhang soryuusi0219 yaaya butsurizuki wasab1 tatesoto KumaTachiRen
お気に入りにしたユーザー ProblemId : 13310 / 自分の提出
問題文最終更新日: 2026-08-15 03:21:41
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
KCPC新歓杯2026 (順位表) の他の問題:

Problem Statement

Consider Alice communicating a sequence $A_{1}, \dots, A_{N}$ of length $N$ to Bob. Here, $1 \leq A_{1} < \dots < A_{N} \leq 10^{9}$ holds.

Alice chooses an integer $K$ between $1$ and $N$, inclusive, and can communicate to Bob only $K$ non-empty 01 strings $S_{1}, \dots, S_{K}$. However, using the given integer $Q (= 377)$, the total string length $\sum_{i=1}^{K} |S_i|$ must be at most $Q$.

Bob wants to restore the sequence $A$ given to Alice, using only $N, Q$ and the strings $S_{1}, \dots, S_{K}$ communicated by Alice.

Write programs for Alice and Bob.

Note that partial scores are awarded for the cases $Q=420, 410$.

Input and Output

Your program should first receive input in the following format.

$ \mathrm{Player} $
$ N\ Q $

Here, $\mathrm{Player}$ is the string Alice or the string Bob, $N$ is the length of the sequence $A$, and $Q$ is the upper limit on the total length of the strings Alice can output. ( $1 \leq N \leq 14$, $Q \in \{377, 410, 420\}$)

  • When $\mathrm{Player} = $ Alice, your program must act as Alice from then on.
  • When $\mathrm{Player} = $ Bob, your program must act as Bob from then on.

For Alice

Receive the sequence $A$ ( $1 \leq A_{1} < \dots < A_{N} \leq 10^{9}$ ) in the following format.

$A_{1}\ A_{2}\ \dots\ A_{N}$

Then, output the $K$ strings $S_{1}, \dots, S_{K}$ to communicate to Bob, one per line, in the following format. Here, $1 \leq K \leq N$, each string must consist only of 0 and 1, and the total string length $\sum_{i=1}^{K} |S_{i}|$ must be at most $Q$.

$K$
$S_1$
$S_2$
$\vdots$
$S_K$

For Bob

Receive Alice's output $S_{1}, \dots, S_{K}$ in the following format.

$K$
$S_1$
$S_2$
$\vdots$
$S_K$

Then, restore the sequence $A$ of length $N$ that was given to Alice as input, and output it separated by spaces in the following format.

$A_{1}\ A_{2}\ \dots\ A_{N}$

Notes

  • Each time you output, append a newline at the end and flush standard output.
  • The judge's result for invalid output is undefined. Note that you may receive TLE or RE rather than WA.

Partial Score

This problem has partial scoring based on subtasks.

SubtaskScoreConstraints
部分点110% (30 pts)$Q=420$
部分点225% (75 pts)$Q=410$
部分点365% (195 pts)$Q=377$

Sample

Sample 1

When $A=(2, 3, 5)$

Alice's input

Alice
3 380
2 3 5

Alice's output

3
00
111
00000

Bob's input

Bob
3 380
3
00
111
00000

Bob's output

2 3 5

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。