B - CTZ Editorial by TKTY1


 \(\mathrm{ctz}(n)\)\(n\)\(2\) で割り切れる最大の回数と等しいです.

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int ans=0;
  while(n%2==0){
    ans++;
    n/=2;
  }
  cout<<ans<<endl;
}

posted:
last update: