Computer Science, asked by rajpratik214, 6 months ago

blem Description
Elections are going on, and there are two candidates A and B, contesting with each other. There is a queue of voters and in this queue some of them are supporters of A and some of them are supporters of B. Many of them are neutral. The fate of the election will be decided on which side the neutral voters vote. Supporters of A and supporters of B make attempt to win the votes of neutral voters.
The way this can be done is explained below:
1. The voter queue is denoted by three characters, viz {-, A, B}. The - denotes neutral candidate, A denotes supporter of candidate A and B denotes supporter of candidate B.
2. Supporters of A can only move towards the left side of the queue.
3. Supporters of B can only move towards the right side of the queue.
4. Since time is critical, supporters of both A and B will move simultaneously.
5. They both will try and influence the neutral voters by moving in their direction in the queue. If supporter of A reaches the neutral voter before supporter of B reaches him, then that neutral voter will become a supporter of candidate A.
6. Similarly, if supporter of B reaches the neutral voter before supporter of A reaches him, then that neutral voter will become a supporter of candidate B.
7. Finally, if both reach at the same time, the voter will remain neutral. A neutral vote cannot decide the outcome of the election.
8. If finally, the queue has more votes for candidate A, then A wins the election. If B has more votes, then B wins that election. If both have equal votes, then it will be a coalition government.
Refer Examples section for understanding the dynamics of how the supporters influence the neutral voters.
Your task is to find the outcome of the election.
Note: There are no test cases where all votes are neutral.

Constraints
1 <= length of queue <= 10 ^ 5

Input
First line contains an integer which is length of queue of voters.
Second line contains characters {-, A, B}, in which denotes
· A = voter who is supporter of candidate A
· B = voter who is supporter of candidate B
· - = neutral voter

Output
Print candidate with maximum number of votes. If they have equal number of votes, print “Coalition government“.​

Answers

Answered by av1266108
1

Answer:

&lt;!DOCTYPE html&gt;</p><p>&lt;html lang="en"&gt;</p><p>&lt;head&gt;</p><p>&lt;title&gt;Shinchan&lt;/title&gt;</p><p>&lt;/head&gt;</p><p>&lt;body&gt;</p><p>&lt;div class="face"&gt;</p><p>&lt;div class="forhead"&gt;&lt;/div&gt;</p><p>&lt;div class="cheeks"&gt;&lt;/div&gt;</p><p>&lt;div class="ear"&gt;&lt;/div&gt;</p><p>&lt;div class="eyebrow left"&gt;&lt;/div&gt;</p><p>&lt;div class="eyebrow right"&gt;&lt;/div&gt;</p><p>&lt;div class="eye left"&gt;&lt;/div&gt;</p><p>&lt;div class="eye right"&gt;&lt;/div&gt;</p><p>&lt;div class="mouth"&gt;&lt;/div&gt;</p><p>&lt;div class="shy"&gt;&lt;/div&gt;</p><p>&lt;div class="shy right"&gt;&lt;/div&gt;</p><p>&lt;/div&gt;</p><p>&lt;style&gt;</p><p>body {</p><p>background:#3e505e</p><p>}</p><p>.face {</p><p>height: 600px;</p><p>width: 350px;</p><p>position: relative;</p><p>margin: auto;</p><p>}</p><p>.face:before {</p><p>content:'';</p><p>background:black;</p><p>height:122px;</p><p>width:95px;</p><p>position:absolute;</p><p>z-index:6;</p><p>left:210px;</p><p>top:29px;</p><p>border-radius:100% 190% 100% 0%;</p><p>transform: rotate(-20deg);</p><p>}</p><p>.face:after {</p><p>content:'';</p><p>width:230px;</p><p>height:180px;</p><p>background:black;</p><p>content:'';</p><p>transform: rotate(-8deg);</p><p>position:absolute;</p><p>border-radius:100% 160% 100% 0%;</p><p>left:70px;</p><p>bottom:-14px;</p><p>top:10px;</p><p>z-index:5;</p><p>}</p><p>.forhead, .forhead:after {</p><p>content: '';</p><p>width: 220px;</p><p>height: 181px;</p><p>background: #fbc6a3;</p><p>content: '';</p><p>transform: rotate(-3deg);</p><p>position: absolute;</p><p>border-radius: 60% 120% 50% 0%;</p><p>left: 67px;</p><p>bottom: -14px;</p><p>top: 21px;</p><p>z-index: 6;</p><p>}</p><p>.forhead:after {</p><p>width: 160px;</p><p>height: 150px;</p><p>border-radius: 150% 174% 159% 100%;</p><p>transform: rotate(-20deg);</p><p>top: 13px;</p><p>left: 59px;</p><p>border-top: 15px solid #fbc6a3;</p><p>}</p><p>.forhead:before{</p><p>background:#fbc6a3;</p><p>width:60px;</p><p>height:10px;</p><p>content:'';</p><p>position:absolute;</p><p>z-index:7;</p><p>left:105px;</p><p>top:9px;</p><p>transform: rotate(13deg);</p><p>border-radius:100%</p><p>}</p><p>.ear {</p><p>width:60px;</p><p>height:50px;</p><p>background:#fbc6a3;</p><p>z-index:7;</p><p>position:absolute;</p><p>border-radius:300% 190% 200% 100%;</p><p>transform: rotate(-20deg);</p><p>top:110px;</p><p>left:285px</p><p>}</p><p>.cheeks {</p><p>background: #fbc6a3;</p><p>width: 280px;</p><p>height: 100px;</p><p>border-radius: 50px 0px 50px 40px;</p><p>transform: rotate(-3deg);</p><p>position: relative;</p><p>content: 'a';</p><p>top: 108px;</p><p>left:10px</p><p>}</p><p>.cheeks:after {</p><p>width: 297px;</p><p>height: 100px;</p><p>background: #fbc6a3;</p><p>content: '';</p><p>transform: rotate(-3deg);</p><p>position: absolute;</p><p>border-radius: 100% 100% 100% 100%;</p><p>left: 1px;</p><p>bottom: -14px;</p><p>}</p><p>.eye {</p><p>width:40px;</p><p>height:40px;</p><p>position:relative;</p><p>background:black;</p><p>border-radius:100%;</p><p>animation: close-eye 4s none .2s infinite;</p><p>}</p><p>.eye:after {</p><p>content:'';</p><p>position:absolute;</p><p>background:white;</p><p>width:15px;</p><p>height:15px;</p><p>border-radius:100%;</p><p>left:17px;</p><p>top:12px;</p><p>}</p><p>.eye:before {</p><p>content:'';</p><p>position:absolute;</p><p>width:70px;</p><p>height:60px;</p><p>border-radius:100%;</p><p>border-top:2px solid black;</p><p>left:-20px;</p><p>margin-top:-20px;</p><p>}</p><p>.eye.left,.eye.right {</p><p>position:absolute;</p><p>top:80px;</p><p>left:100px;</p><p>z-index:10;</p><p>}</p><p>.eye.right {</p><p>left:190px;</p><p>top:90px;</p><p>}</p><p>.eyebrow {</p><p>animation: eyebroani 2s linear .2s infinite;</p><p>}</p><p>.eyebrow,.eyebrow:after {</p><p>position:absolute;</p><p>width:20px;</p><p>height:60px;</p><p>background:black;</p><p>z-index:8;</p><p>border-radius:15px;</p><p>transform: rotate(40deg);</p><p>top:10px;</p><p>left:90px;</p><p>}</p><p>.eyebrow:after {</p><p>content:'';</p><p>transform: rotate(-100deg);</p><p>left:19px;</p><p>margin-top:-23px;</p><p>top:auto;</p><p>}</p><p>.eyebrow.right {</p><p>left:180px;</p><p>top:8px;</p><p>transform: rotate(50deg);</p><p>}</p><p>.mouth {</p><p>position:absolute;</p><p>width:40px;</p><p>height:40px;</p><p>background:#76322f;</p><p>border-radius:100%;</p><p>top:180px;</p><p>left:50px;</p><p>z-index:8;</p><p>}</p><p>.shy {</p><p>position:absolute;</p><p>width:0px;</p><p>height:0px;</p><p>border-radius:100%;</p><p>opacity:0;</p><p>box-shadow: 0px 0px 40px 20px red;</p><p>z-index:8;</p><p>left:35px;</p><p>top:160px;</p><p>animation: shy 10s linear .2s infinite;</p><p>}</p><p>.shy.right {</p><p>left:170px;</p><p>top:180px;</p><p>}</p><p>@keyframes eyebroani {</p><p>0% {margin-top:auto}</p><p>10% {margin-top:-10px}</p><p>20% {margin-top:auto}</p><p>30% {margin-top:-10px}</p><p>40% {margin-top:auto}</p><p>100% {margin-top:auto}</p><p>}</p><p>@keyframes shy {</p><p>0% {opacity:0}</p><p>10% {opacity:0.2}</p><p>90% {opacity:0.2}</p><p>100% {opacity:0}</p><p>}</p><p>@keyframes close-eye {</p><p>0% {</p><p>height: 40px;</p><p>margin-top: auto;</p><p>overflow: auto;</p><p>}</p><p>5% {</p><p>height: 2px;</p><p>margin-top: 20px;</p><p>overflow: hidden;</p><p>}</p><p>5.1% {</p><p>height: 40px;</p><p>margin-top:0;</p><p>overflow:visible;</p><p>}</p><p>}</p><p>&lt;/style&gt;</p><p>&lt;/body&gt;</p><p>&lt;/html&gt;

Similar questions