Skip to content

Commit 4caf2e4

Browse files
committed
Solve 1828 - Bazinga! in python
1 parent 2adbbf4 commit 4caf2e4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

solutions/beecrowd/1828/1828.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
output = sys.stdout.write
5+
6+
7+
def rock_paper_scissors_lizard_spock_judge(sheldons_hand, rajeshs_hand):
8+
if sheldons_hand == rajeshs_hand:
9+
return 0
10+
11+
if sheldons_hand == 'tesoura' and rajeshs_hand in ('papel', 'lagarto'):
12+
return 1
13+
if sheldons_hand == 'papel' and rajeshs_hand in ('pedra', 'Spock'):
14+
return 1
15+
if sheldons_hand == 'pedra' and rajeshs_hand in ('lagarto', 'tesoura'):
16+
return 1
17+
if sheldons_hand == 'lagarto' and rajeshs_hand in ('Spock', 'papel'):
18+
return 1
19+
if sheldons_hand == 'Spock' and rajeshs_hand in ('tesoura', 'pedra'):
20+
return 1
21+
22+
return -1
23+
24+
25+
t = int(input())
26+
for case_index in range(1, t + 1):
27+
sheldons_hand, rajs_hand = input().split()
28+
29+
result = rock_paper_scissors_lizard_spock_judge(sheldons_hand, rajs_hand)
30+
31+
output(f'Caso #{case_index}: ')
32+
if result == 1:
33+
output('Bazinga!\n')
34+
elif result == 0:
35+
output('De novo!\n')
36+
else:
37+
output('Raj trapaceou!\n')

0 commit comments

Comments
 (0)