CCCHK '15 J1 - Rock-paper-scissors

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type

Alice and Bob are playing rock-paper-scissors game. The game rules are simple: rock crushes scissors; paper covers rock; and scissors cut paper. If both players throw the same shape, the game is tied. Your task is to determine the number of games won by Alice and Bob, respectively.

Input Specification

  • The first line contains one integer N (1 \le N \le 100) that represents the number of games.
  • The second line is Alice's shape sequence. The shape sequence contains N shapes and they are separated by a space. The ith shape in the sequence represents the shape thrown by Alice in the ith game. There are only three shape values: rock, paper, and scissors.
  • The third line is Bob's shape sequence.

Output Specification

Two integers separated by a space, representing the number of games won by Alice and the number of games won by Bob.

Sample Input 1

rock rock scissors
paper rock rock

Output for Sample Input 1

0 2

Sample Input 2

paper rock rock scissors
rock scissors rock rock

Output for Sample Input 2

2 1


  • 13
    doge  commented on Nov. 26, 2016, 4:30 p.m.

    What if it's a tie?? I guess that that doesn't count for anybody, right?

    • 12
      Kirito  commented on Nov. 26, 2016, 10:20 p.m.

      No one wins.

      • 14
        xXxP0t4t0MStRxXx  commented on Nov. 27, 2016, 4:57 p.m.

        Or everyone wins !!! ;)

        • 0
          Dordor1218  commented on Feb. 20, 2018, 1:47 a.m. edited

          orrrrr..... THEY WIN AND THEN THEY LOSE

          • 2
            juniorroit  commented on Jan. 3, 2022, 2:27 a.m.

            why this guy getting so many downvotes it's funny for me :D