| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 2 | 2 | 2 | 100.000% |
The year is 1984. Your boss, Professor Werner Zorn, has been pushing for establishing connections to international networks. His newest project is for Karlsruhe University\footnote{Former university in Karlsruhe that later merged to become Karlsruhe Institute of Technology.} to receive the first email from the US Computer Science Network (CSNet).
The email will be sent by Laura Breeden (Massachusetts Institute of Technology) to the Karlsruhe University computers. For simplicity, the email only consists of $n$ lowercase letters. It should be encoded so it can be sent across 5ドル$ transatlantic binary channels.
You want the communication to be done efficiently, so you require that across each channel, no more than $n+10$ bits are sent. The channels are working flawlessly and losslessly, so for each of the 5ドル$ channels, the bits will arrive intact in Karlsruhe.
Everything was almost ready, when you noticed that the wires coming into the computer in Karlsruhe are a mess, and so you do not know which of the 5ドル$ channels is which. Thus, as the receiver, you will receive the binary strings of the 5ドル$ channels in arbitrary order. Instead of untangling the mess, you think it is a better idea to just fix it in software. Design a communication protocol that can transfer the email correctly and efficiently.
The input consists of:
send" or "receive", which denotes whether you are at the sending or receiving end.send":
a-z).receive":
Note that when receiving, you have to infer $n$ from the received binary strings, as this is not known to you up front.
This is a multi-pass problem. Your program will be invoked multiple times, possibly more than twice. It is guaranteed that the first pass is a "send" action, and that each subsequent pass is a "receive" action.
For testing purposes, the number and input of subsequent passes will depend on the output of your submission.
A testing tool is provided to help you develop your solution.
If the action is "send", output 5ドル$ bit strings $b_1, \dots, b_5$ (1ドル \leq |b_i| \leq n+10$ for each $i$), only consisting of digits 0ドル$ and 1ドル,ドル the bit strings to send.
If the action is "receive", output the original email $s,ドル a string only consisting of English lowercase letters (a-z).
send 17 willkommenimcsnet
0 01 111111 1001 1
receive 1 01 1001 0 111111
willkommenimcsnet
send 3 kit
000000000 111111111 000000000 111111111 000000000
receive 111111111 000000000 000000000 000000000 111111111
kit