-->
当前位置:首页 > 题库

PROGRAMMING:Determiner geometry

Luz5年前 (2021-05-10)题库390
The real monkey king and the fake Monkey King each take a group of young monkeys to compete with each other. The rule of the competition is that everyone randomly forms a circle, and the first monkey starts to perform the body fixing technique. Each free monkey can perform the body fixing technique once to any opponent (the monkey being held only has the share of watching), round by round (or circle by circle), In the end, the side that was all settled lost the game. You can think that smart monkeys know the best way to compete. Please write a program to calculate and output the given station order, how many monkeys of the winning Monkey King team are free.
###Input format:
A string, only by the characters 1 and 0, the former represents the real Monkey King team, the latter represents the fake Monkey King team, you can think that the string length is not more than 100000.
###Output format:
Output the character of the representative team in one line, followed by the Western colon, followed by the number of monkeys still active in the winning team.
###Input sample 1:
```in
0110
```
###Output sample 1:
```out
0:1
```
(group 0 will hold one in group 1 first. Group 1 can only hold one in group 0, and the other will hold it. Group 0 wins.)
###Input sample 2:
```in
eleven thousand
```
###Output sample 2:
```out
1:1
```
(two 1 groups can hold two 0 groups in turn, and the last 0 group can only hold one of the 1 groups (at the end of a round or a circle), but the next one will hold it, and the 1 group wins) < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br > < br


answer:If there is no answer, please comment