Problem Name: beecrowd | 1828

Problem Link:



Por Edson Alves, Faculdade UnB Gama BRBrazil

Timelimit: 1

In the 8th episode of Big Bang Theory's second season, The Lizard-Spock Expansion, Sheldon and Raj are arguing about what is the best: the movie Saturn 3 or the TV show Deep Space 9. Raj suggests rock-paper-scissors to settle down the dispute. However, Sheldon says "Ooh, I don't think so. No, anectodal evidence suggests that in the game of rock-paper-scissors, players familiar with each other will tie 75 to 80% of the time due to the limited number of outcomes. I suggest rock-paper-scissors-lizard-Spock".

The rules of the game are:

  1. scissors cuts paper;
  2. paper covers rock;
  3. rock crushes lizard;
  4. lizard poisons Spock;
  5. Spock smashes scissors;
  6. scissors decapitates lizard;
  7. lizard eats paper;
  8. paper disproves Spock;
  9. Spock vaporizes rock;
  10. rock crushes scissors.


Both choosed Spock and the game tied. However, it isn't hard to realize what would happened if the game had continued. In the case of Sheldon's victory, he would've said: "Bazinga!"; if Raj had won, Sheldon would declare: "Raj trapaceou!" ("Raj cheated" in portuguese); in ties, he would request a new game: "De novo!" ("Again!", in portuguese). Given the options chosen by both, make a program that prints Sheldon reaction to the outcome.




The first line contains an integer T (T ≤ 100) indicating the number of test cases. Each test case is described using one line. The line contains Sheldon and Raj options, separated by one blank space. The possible options are: pedra, papel, tesoura, lagarto e Spock (rock, paper, scissors, lizard and Spock).




For each test case your program must output a single line with the following message: "Caso #t: R", where t is the test case number and R is Sheldon's reaction to the outcome: "Bazinga!", "Raj trapaceou!", or "De novo!".




Input Samples Output Samples


papel pedra

lagarto tesoura

Spock Spock

Caso #1: Bazinga!

Caso #2: Raj trapaceou!

Caso #3: De novo!


Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming

#include <iostream>
using namespace std;

int main()
    int n;
    cin >> n;
    for(int i = 1; i  < =n ; i++){
        string a , b , c;
        cin >> a >>b;

        if((a == "tesoura" && b == "papel") || (a == "papel" && b == "pedra") || (a == "pedra" && b == "lagarto") || (a == "lagarto" && b == "Spock") || (a == "Spock" && b == "tesoura") || (a == "tesoura" && b == "lagarto") || (a == "lagarto" && b == "papel") || (a == "papel" && b == "Spock") || (a =="Spock" && b == "pedra") || (a == "pedra" && b == "tesoura")){
            c = "Bazinga!";
        else if(a ==b){
            c = "De novo!";
            c = "Raj trapaceou!";

        cout << "Caso #" << i << ": "  << c << endl;

    return 0;
Copy The Code & Try With Live Editor


3 papel pedra lagarto tesoura Spock Spock


Caso #1: Bazinga! Caso #2: Raj trapaceou! Caso #3: De novo!


#1827 Beecrowd Online Judge Solution 1827 Square Array IV Solution in C++, Java, Js and Python
#1832 Beecrowd Online Judge Solution 1832 EBCDIC Solution in C, C++, Java, Js and Python