포럼
문제 ICPC00179

J. Jumbled Communication

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

Your best friend Adam has recently bought a Raspberry Pi and some equipment, including a wireless temperature sensor and a 433MHz receiver to receive the signals the sensors sends. Adam plans to use the Raspberry Pi as an in-door display for his weather sensor. As he is very good with electronics, he quickly managed to get the receiver to receive the signals of the sensor. However, when he looked at the bytes sent by the sensor he could not make heads or tails of them. After some hours looking through a lot of websites, he found a document explaining that his weather sensor scrambles the data it sends, to prevent it from being used together with products from other manufacturers.

Luckily, the document also describes how the sensor scrambles its communication. The document states that the sensor applies the expression |x ^ (x << 1)| to every byte sent. The |^| operator is bit-wise XORIn bit-wise XOR, the \(i\)th bit of the result is \(1\) if and only if exactly one of the two arguments has the \(i\)th bit set., e.g., $\verb|10110000 ^ 01100100| =
\verb|11010100|\(. The |<<| operator\ is\ a (non-circular) left\ shift\ of\ a\ byte\ valueIn\ x << \)j\(, the\ bits\ of\ x\ are\ moved \)j\( steps\ to\ the\ left. The \)j\( most\ significant\ bits\ of \)x\( are\ discarded, and \)j\( zeroes\ are\ added\ as\ the\ least\ significant\ bits\ of\ the\ result., e.g., \)\verb|10111001 << 1| = \verb|01110010|$.

In order for Adam's Raspberry Pi to correctly interpret the bytes sent by the weather sensor, the transmission needs to be unscrambled. However, Adam is not good at programming (actually he is a pretty bad programmer). So he asked you to help him and as a good friend, you are always happy to oblige. Can you help Adam by implementing the unscrambling algorithm?

제약
입력 형식

The input consists of:
- one line with an integer \(n\) (\(1 \le n \le 10^5\)), the number of bytes in the message sent by the weather sensor;
- one line with \(n\) integers \(b_1, \ldots, b_n\) (\(0 \leq b_i \leq 255\) for all \(i\)), the byte values of the message.

출력 형식

Output \(n\) byte values (in decimal encoding), the unscrambled message.

예제 1
입력
5
58 89 205 20 198
출력
22 55 187 12 66
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2015

평가 및 의견

J. Jumbled Communication

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

J. Jumbled Communication

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8