Logo
(追記) (追記ここまで)

35069번 - Atlantic Email 다국어투 스텝

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB222100.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:

  • One line with the action that your program needs to perform: either the string "send" or "receive", which denotes whether you are at the sending or receiving end.
  • If the action is "send":
    • One line with one integer $n$ (1ドル\leq n \leq 10,000$), the length of the email.
    • One line with a string $s$ of length $n,ドル the email to send. The email only consists of English lowercase letters (a-z).
  • If the action is "receive":
    • Five lines, each with a string $b$ (1ドル \leq |b| \leq n+10$), only consisting of digits 0ドル$ and 1ドル,ドル the five binary strings you used to encode the email, in an arbitrary order.

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).

제한

예제 입력 1

send
17
willkommenimcsnet

예제 출력 1

0
01
111111
1001
1

예제 입력 2

receive
1
01
1001
0
111111

예제 출력 2

willkommenimcsnet

예제 입력 3

send
3
kit

예제 출력 3

000000000
111111111
000000000
111111111
000000000

예제 입력 4

receive
111111111
000000000
000000000
000000000
111111111

예제 출력 4

kit

노트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2025 연습 세션 A번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /