Skip to content

Instantly share code, notes, and snippets.

@ik11235
Created February 2, 2015 13:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ik11235/2b2ff7ade447d0b66a05 to your computer and use it in GitHub Desktop.
class KitayutaMart2 {
public:
int numBought(int K, int T) {
int cnt=0;
for (int i=1; T>0; i*=2) {
T-=i*K;
cnt++;
}
return cnt;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment