fork download
  1. /*
  2. * Author: Geeza
  3.  */
  4.  
  5. #include <bits/stdc++.h>
  6.  
  7. #define ld long double
  8. #define ll long long
  9. #define pb push_back
  10. #define fin(a, n) for(int i = a; i < n; i++)
  11. #define fjn(a, n) for(int j = a; j < n; j++)
  12. #define all(a) a.begin(),a.end()
  13. #define allr(a) a.rbegin(),a.rend()
  14. #define FAST ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
  15.  
  16. using namespace std;
  17.  
  18. const double PI = acos(-1);
  19. const int N = 1e4+20;
  20. const ll oo = 0x3f3f3f3f3f3f3f3f;
  21. const int MOD = 1e9+7;
  22.  
  23. string di[] = {"D","L", "U", "R", "UL", "UR", "DL", "DR"};
  24. int dx[] = {+1, +0, +0, -1, -1, -1, +1, +1};
  25. int dy[] = {+0, -1, +1, +0, -1, +1, -1, +1};
  26. char dc[] = {'D', 'L', 'R', 'U'};
  27.  
  28.  
  29. void solve() {
  30. int n; cin >> n;
  31. for (int b = 30; b >= 0; b--) {
  32. if ((1<<b)&n) {
  33. return void(cout << ++b << "\n");
  34. }
  35. }
  36. }
  37.  
  38. int main() {
  39. FAST;
  40. #ifndef ONLINE_JUDGE
  41. freopen("input.txt", "r", stdin);
  42. freopen("output.txt", "w", stdout);
  43. #endif
  44. int tt = 1; //cin >> tt;
  45. while (tt--) {
  46. solve();
  47. //cout << "Case #" << c++ << ": ";
  48. }
  49. return 0;
  50. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
15