You are viewing a single comment's thread. Return to all comments →
try this: it might not work completely: O(1) int main() { long int t; int x, ans; cin>>t; x = 3*pow(2,floor(log2((t+2)/3))); ans = 2*(x-1) - t; cout<
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
try this: it might not work completely: O(1) int main() { long int t; int x, ans; cin>>t; x = 3*pow(2,floor(log2((t+2)/3))); ans = 2*(x-1) - t; cout<