Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import stdin
- def main():
- lines = stdin.read().splitlines()
- idx = 0
- teams = {'A': 1, 'B': 2, 'C': 1, 'D': 2}
- lazy = (0, 2, 1)
- try:
- while True:
- w = b = 9
- r = 0
- start = teams[lines[idx][0]]
- while True:
- line = lines[idx]
- idx += 1
- if line is '#':
- break
- w -= int(line[2])
- b -= int(line[4])
- if int(line[-1]):
- r = teams[line[0]]
- points = 0
- if r:
- if w and b:
- print 'Incomplete game.'
- else:
- if w:
- winner = lazy[start]
- points += w
- else:
- winner = start
- points += b
- if winner is r:
- points += 5
- print 'Team-{0} win and the point is {1}.'.format(winner, points)
- else:
- print 'Incomplete game.'
- except IndexError:
- pass
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement