Skip to content

Commit

Permalink
11986 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveljev committed Mar 11, 2012
1 parent 40e2760 commit 1db8d7e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions 11986.cpp
@@ -0,0 +1,37 @@
#include <iostream>
#include <cmath>
using namespace std;

int main(void) {
int t, case_num = 0;
unsigned long long n, precalc[60];

precalc[0] = 1;
for (int i = 1; i < 60; i++)
precalc[i] = precalc[i-1] * 2;

cin >> t;

while (t--) {
case_num++;
cout << "Case " << case_num << ": ";

cin >> n;

if (n == 0) {
cout << "0" << endl;
continue;
}

n++;

for (int i = 0; i < 60; i++) {
if (n <= precalc[i]) {
cout << i << endl;
break;
}
}
}

return 0;
}

0 comments on commit 1db8d7e

Please sign in to comment.