Created
November 20, 2013 16:51
-
-
Save cocodrips/7566628 to your computer and use it in GitHub Desktop.
SRM597 Div2 easy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LittleElephantAndDouble: | |
def getAnswer(self, A): | |
m = max(A) | |
for a in A: | |
if not self.doubleUntilM(a, m): | |
return 'NO' | |
return 'YES' | |
def doubleUntilM(self, a, m): | |
print(a, m) | |
while(a <= m): | |
if a == m: | |
return True | |
a = a * 2 | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment