Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- NCARDS = 7
- def minimax(mano, pie):
- if not mano: return 0
- ans = -10
- for x in mano:
- best = -10
- for y in pie:
- if x < y: best = max(best, -minimax(mano - {x}, pie - {y}) - 1)
- else: best = max(best, 1 + minimax(pie - {y}, mano - {x}))
- ans = max(ans, -best)
- return ans
- mano = set(map(int,input().split()))
- pie = set(range(1,NCARDS+1)) - mano
- pie.remove(max(pie))
- print('S' if minimax(mano,pie) > 0 else 'N')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement