Skip to content

Instantly share code, notes, and snippets.

@cocodrips
Created July 22, 2014 06:44
Show Gist options
  • Save cocodrips/031ba9936540d3d72409 to your computer and use it in GitHub Desktop.
Save cocodrips/031ba9936540d3d72409 to your computer and use it in GitHub Desktop.
SRM619 Div1 Easy ずいぶん簡単な気がする。
class SplitStoneGame:
def winOrLose(self, number):
number = sorted(list(number))
i = 0
while len(number) > 2:
if number[-1] == 1:
break
selected = number.pop(-1)
A = selected / 2
B = selected - A
number[0] += B
number[1] += A
number.sort()
i += 1
if i % 2 == 0:
return "LOSE"
return "WIN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment