46 lines
818 B
Python
46 lines
818 B
Python
import os
|
|
|
|
f = open(os.path.dirname(__file__)+"/input.txt", "r")
|
|
|
|
tot = 0
|
|
for l in f:
|
|
l.strip()
|
|
choices = l.split(" ")
|
|
result = 'draw'
|
|
v = choices[0]
|
|
o = choices[1].strip()
|
|
|
|
round = 0
|
|
if v == 'A':
|
|
if o == 'Y':
|
|
result = 'win'
|
|
if o == 'Z':
|
|
result = 'loss'
|
|
if v == 'B':
|
|
if o == 'X':
|
|
result = 'loss'
|
|
if o == 'Z':
|
|
result = 'win'
|
|
if v == 'C':
|
|
if o == 'X':
|
|
result = 'win'
|
|
if o == 'Y':
|
|
result = 'loss'
|
|
|
|
if o == 'X':
|
|
round = round + 1
|
|
if o == 'Y':
|
|
round = round + 2
|
|
if o == 'Z':
|
|
round = round + 3
|
|
|
|
res = 3
|
|
if result == 'loss':
|
|
res = 0
|
|
if result == 'win':
|
|
res = 6
|
|
|
|
tot = tot + round + res
|
|
|
|
print(tot)
|