Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created October 14, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/3f136ccf7eaa95738fb6 to your computer and use it in GitHub Desktop.
Save whatalnk/3f136ccf7eaa95738fb6 to your computer and use it in GitHub Desktop.
TopCoder SRM 648 Div2
# SRM 648 Div2 Easy
#http://community.topcoder.com/stat?c=problem_statement&pm=13650
class KitayutaMart2():
def numBought(self, k, t):
n = 1
ksum = k
while True:
if ksum == t:
return n
n += 1
ksum += 2**(n-1)*k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment