407182: GYM102697 153 Parity Checker

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

153. Parity Checkertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Though digital communications are highly accurate, errors can occur from time to time. To deal with such communications errors, methods to detect and fix errors have been invented. One very common and simple method for this is known as a parity bit. When a message is being sent digitally in the form of bytes of 8 bits, a ninth parity bit can be added that is either 1 if the message has an even number of 1s(in binary), or 0 if the message has an odd number of 1s. While this method clearly will only work if there are an odd number of errors, it is a useful heuristic for detecting many errors without the need for more computation intensive methods. Your task for this problem is to write a program to determine if a nine bit sequence of binary is valid according to a parity check. The first bit on the left represents the parity bit, and the following 8 bits correspond to the one byte message that is to evaluated for parity.

Input

Exactly 9 consecutive binary bits will be provided as input in the form of a one-line string with no spaces. The first bit on the left represents the even-parity bit, and the next eight bits represent the message being communicated.

Output

Output either "NO ERROR" if the parity check is valid or "TRANSMISSION ERROR" if the parity check fails.

ExampleInput
100110101
Output
NO ERROR

加入题单

上一题 下一题 算法标签: