Hello please i was wondering why my code for This problem B from the last atcoder beginner contest is getting WA for some few tests? This is the code below. I'd really appreciate any help :)
include
include
include
include
include
using namespace std;
vector tob(int n){ vector a; for(int i=0; i<n; i++){ int ans = n%2; if(ans==0){ a.push_back(ans); } else{ break; } n/=2; } return a; } void solve(){ //cout << "stuff works" << endl; int count = 0; int n; cin >> n; vector a = tob(n); for(auto c : a ) count +=1; cout << count << endl; } int main (){ ios::sync_with_stdio(false); cin.tie(nullptr); //ll T = 1; //ll T; cin >> T; //for(;T--;){ solve(); //} return 0; }