Difference between r1.1 and the current
@@ -1,4 +1,4 @@
{{{
#include<iostream>int cnt = 1;
int main(void)
@@ -21,4 +21,4 @@
}
}}}
#include<iostream> int cnt = 1; int main(void) { int n; int ans1 = 0, ans2 = 0, sum = 0; scanf("%d", &n); while(1){ if(n <= cnt)break; cnt = cnt * 2; } ans1 = cnt; ans2 = -1; while(cnt > 0 && sum != n){ if(sum + cnt <= n)sum += cnt; cnt = cnt /2; ans2++; } printf("%d %d", ans1, ans2); }