## CCCHK '15 J1 - Rock-paper-scissors

View as PDF

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

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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 that represents the number of games.
• The second line is Alice's shape sequence. The shape sequence contains shapes and they are separated by a space. The th shape in the sequence represents the shape thrown by Alice in the th 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

3
rock rock scissors
paper rock rock

#### Output for Sample Input 1

0 2

#### Sample Input 2

4
paper rock rock scissors
rock scissors rock rock

#### Output for Sample Input 2

2 1

• commented on June 11, 2020, 3:21 p.m.

how to do it

• commented on June 11, 2020, 4:53 p.m.

If you need help on a question please join the Slack

• commented on Jan. 9, 2020, 9:10 p.m.

Python

• commented on Feb. 26, 2018, 12:10 p.m. edited

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

• commented on Dec. 25, 2017, 1:26 p.m.

I'm like,"Let's submit my code for Java 9!" Gets test case 9 TLE. Spends 4 months writing a different code. Submits the same code in Java 8. Gets test case 9 right. ;-;

• commented on Nov. 26, 2016, 11:30 a.m.

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

• commented on Nov. 26, 2016, 5:20 p.m.

No one wins.

• commented on Nov. 27, 2016, 11:57 a.m.

Or everyone wins !!! ;)

• commented on Feb. 19, 2018, 8:47 p.m. edited

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