|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||4||2||2||50.000%|
You are a dealer at The One, the first all-binary casino in Las Vegas. What makes The One special is that its blackjack tables don’t use cards; they use bytes (an 8-bit sequence representing a number from 0 to 255) and nibbles (a 4-bit sequence representing a number from 0 to 15).
All day long, you play the house’s hand against individual opponents. Of course, the casino owners know their statistics, and they have devised a strategy for you that gives gamblers just less than even odds.
Here are the rules of binary blackjack:
The rules for the dealer are (in order of precedence, where lower numbered rules override higher numbered ones):
Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets.
A single data set has 6 components:
Following the final data set will be a single line, “ENDOFINPUT”.
Here are some other useful facts:
Calculate the actions taken by the dealer and how the dealer fares with the resulting hand.
For each data set, there will be exactly one output set, consisting of the following components:
START 1 11111111 11111111 00000001 10101010 01010101 11110000 00001111 1010 0101 1100 0011 END START 1 10111110 10111111 11111110 00010010 10101010 01010101 11110000 0001 1010 1100 0011 END START 8 11111111 00001000 00000000 00000001 00000010 00000011 00000100 00000101 00000110 00000111 00010010 10101010 01010101 11110000 0001 1010 1100 0011 END ENDOFINPUT
HAND 1 Win! HAND 1 Byte me! Nibble me! Nibble me! Nibble me! Lose! HAND 8 Win!