CCC '14 J2 - Vote Count

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Canadian Computing Competition: 2014 Stage 1, Junior #2

A vote is held after singer A and singer B compete in the final round of a singing competition. Your job is to count the votes and determine the outcome.

Input Specification

The input will be two lines. The first line will contain V (1 \le V \le 15), the total number of votes. The second line of input will be a sequence of V characters, each of which will be A or B, representing the votes for a particular singer.

Output Specification

The output will be one of three possibilities:

  • A, if there are more A votes than B votes;
  • B, if there are more B votes than A votes;
  • Tie, if there are an equal number of A votes and B votes.

Sample Input 1


Output for Sample Input 1


Sample Input 2


Output for Sample Input 2



  • 1
    Samuel_  commented on Jan. 14, 2022, 4:11 p.m. edit 5


    • 1
      Spitfire720  commented on Jan. 14, 2022, 4:48 p.m.

      No, your input is just flawed.

      Also, fix your indenting. Please.

      • 1
        henrybaolol9  commented on Jan. 14, 2022, 8:55 p.m.

        its more readable than you would think tbh

  • -60
    jay_hag  commented on Oct. 22, 2019, 6:09 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.

    • 7
      planeloverten  commented on May 26, 2021, 7:08 p.m.

      But not everyone is as skilled as you

    • 7
      cyopotatoe  commented on June 10, 2020, 10:02 a.m.

      Thanks, no thanks :)