criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;


int popcount(int n){
    int ans=0;
    while(n!=0){
        ans += n%2;
        n = n/2;
    }
    return ans;
}

int times(int n){
    int ans=0;
    while(n!=0){
        n = n%popcount(n);
        ans++;
    }
    return ans;
}

/*int calc(int n,string s, vector<int> &keta_mod){
    int up=0;
    for(int i=0; i<n; i++){
        if(s.at(i) == '1') up++;
    }
    if(up ==0) return 0;
    int keta=1;
    int m=0;
    for(int i=0; i<n; i++){
        m = (m + keta * (s.at(n-1-i)-'0'))%up;
        keta = (keta*2)%up;
    }
    return times(m%up)+1;
}
*/

int main(){
    int n;
    string s;
    cin >> n;
    cin >> s;
    int up=0;
    for(int i=0; i<n; i++){
        if(s.at(i) == '1') up++;
    }
    vector<int> keta_mod_up(n,1);
    vector<int> keta_mod_down(n,1);
    int keta=1;
    for(int i=0; i<n-1; i++){
        keta_mod_up.at(i+1) = (keta*2)%(up+1);
    }
    keta=1;
    for(int i=0; i<n-1; i++){
        keta_mod_up.at(i+1) = (keta*2)%(up-1);
    }
    int stay_up=0;
    int stay_down =0;
    for(int i=0; i<n; i++){
        stay_up = (stay_up+ keta_mod_up.at(i)*s.at(n-1-i))%(up+1);
    }
    for(int i=0; i<n; i++){
        stay_down = (stay_down+ keta_mod_up.at(i)*s.at(n-1-i))%(up-1);
    }

    for(int i=0; i<n; i++){
        bool z_to_o;
        if(s.at(i)=='0'){
            z_to_o = true;
            s.at(i) = '1';
        }
        else{
            z_to_o = false;
            s.at(i) = '0';
        }
        if(z_to_o){
            int k;
            k = (stay_up + (s.at(i) * keta_mod_up.at(n-1-i))) %(up+1);
            if(k%(up+1) == 0) cout << 0 << endl;
            else{
            cout << times(k) + 1 << endl;
            }
        }
        else{
            int k;
            k = (stay_down - (s.at(i) * keta_mod_down.at(n-1-i))) %(up-1);
            while(k <0){
                k += (up-1)
            }
            if(k%(up-1) == 0) cout << 0 << endl;
            else{
            cout << times(k) + 1 << endl;
            }
        }
        //cout << calc(n, s) << endl;
        if(z_to_o) s.at(i) = '0';
        else s.at(i) = '1';
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:90:28: error: expected ';' before '}' token
   90 |                 k += (up-1)
      |                            ^
      |                            ;
   91 |             }
      |             ~
Language: C++

#include <bits/stdc++.h>	
using namespace std;
int main(){
  int n;
  string x;
  cin >> n >> x;
  int count = 0;
  for(int i=0;i < n;i ++){
    if(x.at(i) == 1){
      count++;
    }
  }
  vector<int> a(n+1,0);
  int y = 0;
  int c = 0;
  while(c < n){
    for(int i=0;i <= y;i++){
      c++;
      a.at(c) = y;
    }
    y++;
  }
  for(int i =0;i < n;i ++){
    int z = count;
    int ans;
    string l = x;
    if(x.at(i) == 0){
      z ++;
      l.at(i) = 1;
    }
    else{
      z --;
      l.at(i) = 0;
    }
    int b;
    if(s.at(n-1) ==  0){b = 0;}
    else{b = 1;}
    for(int i = 2;i <= n;i ++){
      if(l.at(n-i) == 1){
        b += pow(2,(i-1));
      }
    }
    while(b != 0){
      b = b%z;
      z = a.at(b);
      ans++;
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:8: error: 's' was not declared in this scope
   36 |     if(s.at(n-1) ==  0){b = 0;}
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
	string s; cin >> s;
	int pcnt = 0;
	int f[200100] = {};
	for (int i = 1; i <= n; i++)
	{
		int c = i, cnt = 0;
		while (c > 0)
		{
			cnt++;
			c %= __builtin_popcount(c);
		}
		f[i] = cnt;
	}

	for(int i = 0; i < n; i++) {
		if(s[i] == '1') pcnt++;
	}

	int sump = 0, summ = 0, dp= 1, dm = 1;
	int subp[n] = {}, subm[n] = {};
	int res[n] = {};
	if(pcnt > 1) {
		for (int i = n - 1; i >= 0; i--)
		{
			if(s[i] == '1') {
				sump = (sump + dp) % (pcnt + 1);
				summ = (summ + dm) % (pcnt - 1);
				subp[i] = dp;
				subm[i] = dm;
			}
			else {
				subp[i] = - dp;
				subm[i] = - dp;
			}
			dp = dp * 2 % (pcnt + 1);
			dm = dm * 2 % (pcnt - 1);
		}
		for (int i = n - 1; i >= 0; i--)
		{
			if(s[i] == '0') {
				int sum = (sump - subp[i]) % (pcnt + 1);
				if(sum < 0) sum += (pcnt + 1);
				res[i] = f[sum] + 1;
			}
			else {
				int sum = (summ - subm[i]) % (pcnt - 1);
				if(sum < 0) sum += (pcnt - 1)
				res[i] = f[sum] + 1;
			}
		}
	}
	else {
		if(s[n - 1] == '0') {
			for (int i = 0; i < n-1; i++)
			{
				res[i] = 1;
			}
			res[n-1] = 2;
		}
		else {
			for (int i = 0; i < n-1; i++)
			{
				res[i] = 2;
			}
			res[n-1] = 1;
		}
	}




	for (int i = 0; i < n; i++)
	{
		cout << res[i] << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:62: error: expected ';' before 'res'
   51 |                                 if(sum < 0) sum += (pcnt - 1)
      |                                                              ^
      |                                                              ;
   52 |                                 res[i] = f[sum] + 1;
      |                                 ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<int,int>;



int main() {
	
	
	int n;
	string x; 
	cin >> n >> x;

	vector<int> pop(n+1);

	for(int i = 1; i <= n; i++){
		for(int j = 0; (1<<j) <= n; j++){
			int cnt = 0;
			if(i & (1<<j)) cnt++;
			pop[i] = cnt;
		}
	}
	int X = 0;
	cnt = 0;
	rep(i,n) if(x[i] == '1'){
		X += (1<<i);
		cnt++;
	}
	int ans = 0;

	for(int i = 1; i <= n; i++){
		int j;
		int k;
		if(x[i] == '1'){
			j = X - (1<<i);
			k = cnt-1;
		}
		if(x[i] == '0'){
			j = X + (1<<i);
			k = cnt+1;
		}
		j = j % k;
		ans++;

		while(j != 0){
			j = pop[j];
			ans++;
		}
		cout << ans << endl;
	}
	
	
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   27 |         cnt = 0;
      |         ^~~
      |         int
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

vecl pow2(100001,1);

void init() {
    REP(i,100000) pow2[i+1] = pow2[i]*2;
}

int pop;
int ans;

ll f(ll N) {
    if(N%pop == 0) ans;
    else {
        ll t = N%pop;
        ll cnt = 0;
        while(t > 0) {
            if(t%2 == 1) cnt++;
            t /= 2; 
        }
        pop = cnt;
        return f(N%pop)+1;
    }
}

int main() {
    int N; cin >> N;
    ll res = 0;
    ll ret = 1;
    REP(i,N) {
        if(S[i] == '1') res += ret;
        ret *= 2;
    }
    string S; cin >> S;
    init();
    int cnt = 0;
    REP(i,N) if(S[i] == '1') cnt++;
    REP(i,N) {
        ll tmp;
        if(S[N-1-i] == '1') {
            pop = cnt-1;
            tmp = res - pow2[N-i-1];
            ans = 0;
            cout << f(tmp) << endl;
        } else {
            pop = cnt-1;
            tmp = res + pow2[N-i-1];
            ans = 0;
            cout << f(tmp) << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:12: error: 'S' was not declared in this scope
   42 |         if(S[i] == '1') res += ret;
      |            ^
a.cc: In function 'll f(ll)':
a.cc:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

long long calc(string S,int count){
  long long Ans=0;
  long long two=1;
  reverse(S.begin(),S.end());
  for (int i = 1; i < S.length()+1; i++){
    if(S.at(i)=='1'){Ans+=two;}
      two*=2;
  }
}


 int main() {
  int N,count=0;
  cin>>N;
  string X,Y;
  cin>>X;
  int Ans1=0;
  int Ans2=0;
    
  rep(i,N){if(X.at(i)=='1'){count++;}}
  
   if(N>=21){Y=str.substr(X.length()-21);}else{Y=X;}
   Ans1=calc(Y,count+1);
   Ans2=calc(Y,count-1);
   
   if(N>=21){
   rep(i,N){
   if(i<=X.length()-21){if(X.at(i)=='0'){cout<<Ans1<<endl;}else{cout<<Ans2<<endl;}
                       }
     cout<<calc2(Y,i,count)<<endl;
   }
   }else{
   rep(i,N){cout<<calc2(X,i,count)<<endl;
   }
   }
 }

Compiler output:
a.cc: In function 'long long int calc(std::string, int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int main()':
a.cc:26:16: error: 'str' was not declared in this scope; did you mean 'std'?
   26 |    if(N>=21){Y=str.substr(X.length()-21);}else{Y=X;}
      |                ^~~
      |                std
a.cc:34:12: error: 'calc2' was not declared in this scope; did you mean 'calc'?
   34 |      cout<<calc2(Y,i,count)<<endl;
      |            ^~~~~
      |            calc
a.cc:37:19: error: 'calc2' was not declared in this scope; did you mean 'calc'?
   37 |    rep(i,N){cout<<calc2(X,i,count)<<endl;
      |                   ^~~~~
      |                   calc
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

#define ll long long
// #define PI acos(-1.0)
#define PI 3.14159265358979323846264338327950L
#define FOR(I, A, B) for (int I = (A); I < (B); ++I)

int main() {
  int n, cnt = 0, sum = 0, k, jcnt = 0, res = 0;
  string x;
  cin >> n >> x;
  vector<int> tmp_x(n);
  for (int i = 0; i < n; i++) {
    res = 0;
    for (int j = 0; j < n; j++) {
      if (i == j)
        tmp_x[j] = (x[j] == '0' ? 1 : 0);
      else
        tmp_x[j] = stoi(x[j]);
    }
    sum = 0;
    k = 1;
    for (int j = n - 1; j >= 0; j--) {
      if (tmp_x[j] == 1) sum += k;
      k *= 2;
    }
    while (sum > 0) {
      jcnt = 0;
      for (int j = 0; j < n; j++)
        if (tmp_x[j] == 1) jcnt++;
      sum %= jcnt;
      res++;
    }
    cout << res << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   21 |         tmp_x[j] = stoi(x[j]);
      |                    ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:2:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
inline ll binToUInt(const std::string& str)
{
    ll val = 0;
    for (int i = 0; i < (int)str.size(); ++i) {
        switch (str[i]) {
        case '0':
            val *= 2;
            break;
        case '1':
            val = val * 2 + 1;
            break;
        }
    }
    return val;
}
int main()
{
    ll n;
    ll x;
    ll nom_pop;
    std::string y;
    std::cin >> n >> y;
    std::array<bool, 1000000> flag = {};

    //std::cout << y << std::endl;


    x = binToUInt(y);
    //std::cout << x << std::endl;
    auto rev = [&](const ll& i) {
        if (x & (1 << i)) {
            flag[i] = true;
            return x - static_cast<ll>(std::pow<ll>(2, i));
        } else {
            flag[i] = false;
            return x + static_cast<ll>(std::pow<ll>(2, i));
        }
    };
    auto popcount = [&](const ll& rever, const ll& num) {
        if (flag[n - num]) {
            return nom_pop - 1;

        } else {
            return nom_pop + 1;
        }
    };
    auto popcount_one = [&](const ll& rever) {
        ll temp_1 = 0;
        for (ll i = 0; i < n; ++i) {
            if (rever & (1 << i)) {
                ++temp_1;
            }
        }
        return temp_1;
    };
    auto popcount_low = [&](const ll& rever) {
        ll temp_1 = 0;
        for (ll i = 0; i < 100; ++i) {
            if (rever & (1 << i)) {
                ++temp_1;
            }
        }
        return temp_1;
    };
    for (ll i = 1; i <= n; ++i) {
        ll temp_0 = rev(n - i);
        //std::cout << "f0"<< " " << temp_0 << std::endl;
        ll temp_2 = 0;
        if (temp_0 > 0) {
            temp_0 = popcount(temp_0, i);
            ++temp_2;

            while (temp_0 > 0) {
                temp_0 = temp_0 % popcount_low(temp_0, i);
                ++temp_2;
                // std::cout << "f" << temp_2 << " " << temp_0 << std::endl;
            }
        }
        std::cout << temp_2 << std::endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:47: error: no match for call to '(main()::<lambda(const long long int&)>) (long long int&, long long int&)'
   76 |                 temp_0 = temp_0 % popcount_low(temp_0, i);
      |                                   ~~~~~~~~~~~~^~~~~~~~~~~
a.cc:58:25: note: candidate: 'main()::<lambda(const long long int&)>'
   58 |     auto popcount_low = [&](const ll& rever) {
      |                         ^
a.cc:58:25: note:   candidate expects 1 argument, 2 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double  
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define LOL cout<<'\n';
#define MOD 1000000007
#define sz(x) ((ll)x.size())

const ll N=2e5+7;
vector<ll> dp(N,0);

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  dp[1]=1;
  dp[2]=1;
  for(ll i=3 ; i<=2e5 ; i++){
    ll x=__builtin_popcount(i);
    ll y=i%x;
    dp[i]=dp[y]+1;
  }
  ll n; cin>>n;
  string s; cin>>s;
  ll cnt=0;
  for(ll i=0,j=1<n ; i++){
    if(s[i]=='1')
  }
  for(ll i=0 ; i<n ; i++){
    if(s[i]=='1'){
      cout<<dp[cnt-1];LOL
    }
    else{
      cout<<dp[cnt+1];LOL
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: expected ';' before ')' token
   30 |   for(ll i=0,j=1<n ; i++){
      |                         ^
      |                         ;
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define FILL0(x) memset(x,0,sizeof(x))
#define FILL1(x) memset(x,-1,sizeof(x))

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 

int poppy(ll bits, int cnt)
{
    cnt++;
    int ones=0;
    rep(i, 1<<i<=bits)
    {
        if(1<<i&bits)
            ones++;
    }
    if(ones==0)
        return cnt;


    
    return poppy(bits%ones, cnt);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;

    string s;
    cin >> s;

    int ones=0;
    rep(i, N)
    {
        if(s[i]=='1')
            ones++;
    }

    for(i=1;i<=N; i++)
    {
        int tmp =ones;
        ll bits=0;  //格納
        if(s[i]=='1')
        {
            s[i]='0';
            tmp--;

            reverse(s.begin(), s.end());
            
            char sbit[int(log2(tmp))+2];
            s.copy(sbit, int(log2(tmp)+1));

            rep(j, int(log2(tmp))+2)
            {
                if(sbit[j]=='1')
                {
                    bits+=1<<j;
                }
            }

            cout << poppy(bits, 0) << endl;


            reverse(s.begin(), s.end());
            
            s[i]='1';
        }
        else
        {
            s[i]='1';
            tmp++;
            s[i]='0';
        }
        
    }


    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:52:9: error: 'i' was not declared in this scope
   52 |     for(i=1;i<=N; i++)
      |         ^
Language: C++

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <cmath>
using namespace std;

long long binary(long long bina)
{
    long long ans = 0;
    for (long long i = 0; bina > 0; i++)
    {
        ans = ans + (bina % 2) * pow(10, i);
        bina = bina / 2;
    }
    return ans;
}

int main(void)
{
    long long n, count, i=0, bitNum = 0, valSum = 0, val, popC, newVal, newPopC, j;
    string x, newbitL;
    cin >> n >> x;
    while (i < x.size()) {
        if (x[i] == '1') {
            bitNum++;
            valSum += std::pow(2, x.size() - 1 - i);
        }
        i++;
    }
    i = 0;
    while (i < x.size()) {
        count = 0;
        if (x[i] == '1') {
            val = valSum - (std::pow(2, x.size() - 1 - i));
            popC = bitNum-1;
        } else {
            val = valSum+(std::pow(2, x.size() - 1 - i));
            popC = bitNum+1;
        }
        while (true) {
            if (val == 0 || popC == 0) {
                break;
            }
            newVal = val % popC;
            newbitL = std::to_string(binary(newVal));
            newPopC = 0;
            j = 0;
            while (j < newbitL.size()) {
                if (newbitL[j] == '1') {
                    newPopC ++;
                }
                j++;
            }
            count++;
            if (newVal == 0 || newPopC === 0) {
                break;
            }
            val = newVal;
            popC = newPopC;
        }
        cout << count << endl;
        i++;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:42: error: expected primary-expression before '=' token
   55 |             if (newVal == 0 || newPopC === 0) {
      |                                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
unsigned int popcount(unsigned int n){
    if (n == 0) 
        return 0; 
    else
        return 1 + popcount(n & (n - 1)); 
}

unsigned int btd(string n) 
{ 
    string num = n; 
    int dec_value = 0; 
  
    // Initializing base value to 1, i.e 2^0 
    int base = 1; 
  
    int len = num.length(); 
    for (int i = len - 1; i >= 0; i--) { 
        if (num[i] == '1') 
            dec_value += base; 
        base = base * 2; 
    } 
  
    return dec_value; 
} 

int main() {
	unsigned int n;
  	cin>>n;
  	string s=to_string(n);
  	for(int i=1;i<=n;i++)
    {   if(s[i-1]==0)
            s[i-1]=1;
        else
            s[i-1]=0;
        int x=btd(s,0,2);
        int count=0;
        while(x!=0){
            x=x%popcount(x);
            count++;
        }
        cout<<count<<endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: too many arguments to function 'unsigned int btd(std::string)'
   37 |         int x=btd(s,0,2);
      |               ~~~^~~~~~~
a.cc:10:14: note: declared here
   10 | unsigned int btd(string n)
      |              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

ll f(bitset<300000> b, ll n) {
	if(!b.any()) return n;
	ll popcount = b.count();
	mp::cpp_int m = b.to_ullong();
	m %= popcount;
	bitset<300000> a(m);
	return f(a, n + 1);
}

int main() {
	int N; cin >> N;
    string X; cin >> X;
	for(int i = N - 1; i >= 0; i--) {
		bitset<300000> bit(X);
		bit.flip(i);
		cout << f(bit, 0) << endl;
	}
	return 0;
}

Compiler output:
a.cc:15:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
   15 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)    for(long long i = 0; i < (n) ; ++i)
#define orep(i,n)   for(long long i = 1; i <= (n); ++i)   // one rep
#define drep(i,n)   for(long long i = (n)-1; i >= 0; --i) // down rep
#define srep(i,s,t) for(long long i = (s); i < (t); ++i)  // set rep
#define rng(x)  (x).begin(),(x).end()

  // range
#define rrng(a) (a).rbegin(),(a).rend() // reverse range
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define ru(x,y) (((x)+(y)-1)/(y)) // round up
#define fi first
#define se second
#define eb emplace_back
#define fcout cout << fixed << setprecision(15)


using namespace std;
using ll  = long long;
using P   = pair<int,int>;
using vi  = vector<int>;
using vvi = vector<vi>;
using vp  = vector<P>;
using vl  = vector<ll>;

template<typename T> void Yes(T flag) {
  cout << (flag ? "Yes" : "No") << endl;
}

template<typename T> void pv(vector<T> vec) {
  cout << "[";
  for(auto& v : vec) { cout << v << ","; }
  cout << "]" << endl;
}

template<>
void pv(vector<P> vec) {
  cout << "[";
  for(auto& v : vec) {
    cout << "<" << v.fi << ","<< v.se << ">" << ",";
  }
  cout << "]" << endl;
}

template<typename T> void pv2(vector<vector<T>> vec) {
  for(auto& v : vec) pv(v);
}


int mx = 0;
int px=0;
void f(vi vx,int count,int j,vi modcp,vi modcm) {
  int ans = 0;
  bool pflag=true;
  int n = vx.size();
  int x = 0;
  if(vx.at(n - j)) {
    x = mx - modcm.at(n-j);
    x%=count-1;
    if(x<0) x+= count-1;
  }
  else {
    x = px + modcp.at(n-j);
    x %= count+1;
  }
  ans++;

    while(x!=0) {
      x = x % std:popcount(x);
      ans++;
    }
 cout << ans << endl;
}

int main() {
  int n;cin >> n;
  string s; cin >> s;
  int a = s.size();
  vi vx(a,0);
  int count = 0;
  rep(i,a) {
    if(s.at(i)=='1') {
      vx.at(i) = 1;
      count++;
    }
  }
  reverse(rng(vx));
  vi modcp(a,0);vi modcm(a,0);
  int t = 1;

  rep(i,a) {
    modcp.at(i) = t;
    t = t << 1;
    t %= count+1;
  }
  t = 1;
  if(count!=0){
    rep(i,a) {
      modcm.at(i) = t;
      t = t << 1;
      t %= count-1;
    }
    rep(i,n) {
      if(vx.at(i)) {
        mx+=modcm.at(i)%(count-1);
        mx%=(count-1);
      }
    }
  }

    rep(i,n) {
      if(vx.at(i)) {
        px+=modcp.at(i)%(count+1);
        px%=count+1;
      }
    }
  int aaa = vx.size();
  rep(i,aaa) f(vx,count,i+1,modcp,modcm);

  return 0;
}


Compiler output:
a.cc: In function 'void f(vi, int, int, vi, vi)':
a.cc:69:18: error: found ':' in nested-name-specifier, expected '::'
   69 |       x = x % std:popcount(x);
      |                  ^
      |                  ::
a.cc:69:19: error: 'popcount' is not a member of 'std'; did you mean 'count'?
   69 |       x = x % std:popcount(x);
      |                   ^~~~~~~~
      |                   count
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <bitset>
using namespace std;

int getOne(string a)
{
    int cnt = 0;
    for (const auto &i : a)
    {
        if (i == '1')
            cnt++;
    }

    return cnt++;
}

string toBinary(int a)
{
    std::stringstream ss;
    ss << std::bitset<sizeof(a) * CHAR_BIT>(a);
    string s = ss.str();
    int i;
    for (i = 0; i < s.size(); i++)
    {
        if (s[i] == '1')
        {
            break;
        }
    }
    //cout << s << " " << i << endl;
    return s.substr(i);
}

int toDec(string a)
{
    int sum;
    int ni = 1;
    for (int i = 0; i < a.size(); i++)
    {
        if (a[a.size() - 1 - i] == '1')
        {
            sum += ni;
        }
        ni *= 2;
    }
    return sum;
}

int main()
{
    int n;
    cin >> n;
    string x;
    cin >> x;

    for (int i = 0; i < n; i++)
    {
        string a = x;
        if (a[i] == '1')
            a[i] = '0';
        else
            a[i] = '1';

        int num = getOne(a);
        int cnt = 0;
        while (num != 0)
        {
            //string bin = toBinary(num);
            //cout << bin << endl;
            //a = a.substr(a.size() - (bin.size() - 1));

            a = toBinary(toDec(a) % num);

            num = getOne(a);
            //cout << num << endl;
            cnt++;
        }

        cout << cnt << endl;
    }
}

Compiler output:
a.cc: In function 'std::string toBinary(int)':
a.cc:22:35: error: 'CHAR_BIT' was not declared in this scope
   22 |     ss << std::bitset<sizeof(a) * CHAR_BIT>(a);
      |                                   ^~~~~~~~
a.cc:5:1: note: 'CHAR_BIT' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <bitset>
  +++ |+#include <climits>
    5 | using namespace std;
a.cc:22:43: error: template argument 1 is invalid
   22 |     ss << std::bitset<sizeof(a) * CHAR_BIT>(a);
      |                                           ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <bitset>
int main() {
	std::vector<int> sq;
	for (int i = 2; i < 143; ++i) {
		sq.emplace_back(i*i);//i+2の2乗が入ってる
	}

	int N;
	std::cin >> N;
	std::string str;
	std::cin >> N;
	std::cin >> str;
	for (int i = 0; i < N; ++i) {
		std::string _str = str;
		if (_str.at(i) == '0') {
				_str.at(i) = '1';
		}
		else
			_str.at(i) = '0';
		
		int num = std::stoi(_str, 0, 2);
		int count = 0;
		bool finish;
		do {
			int ones = std::popcount(num);
			num /= ones;
			finish = num %= ones;
			count++;
		} while (!finish);
		std::cout << count << std::endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:41: error: 'popcount' is not a member of 'std'
   28 |                         int ones = std::popcount(num);
      |                                         ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

ll f(bitset<300000> b, ll n) {
	if(!b.any()) return n;
	ll popcount = b.count();
	mp m = b.to_ullong();
	m %= popcount;
	bitset<300000> a(m);
	return f(a, n + 1);
}

int main() {
	int N; cin >> N;
    string X; cin >> X;
	for(int i = N - 1; i >= 0; i--) {
		bitset<300000> bit(X);
		bit.flip(i);
		cout << f(bit, 0) << endl;
	}
	return 0;
}

Compiler output:
a.cc:15:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
   15 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int power(int x, unsigned int y, int p)  
{  
    int res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
} 
int find(int n)
{
  if(n==0)
    return 0;
  return 1+find(n-(n&(-n)));
}
int op(int n)
{
  if(n==0)
    return 0;
  int pop=find(n);
  n%=pop;
  return 1+op(n);
} 
int main()
{
  int n;
  cin>>n;
  string x;
  cin>>x;
  int a[n];
  for(int i=0;i<n;i++)
    if(x[i]=='1')
      pop++;
  if(pop)
  {int p=0;
  for(int i=0;i<n;i++)
  {
    p=(2*p)%(pop-1);
    if(x[i]=='1')
      p=(p+1)%(pop-1);
  }}
  int q=0;
  for(int i=0;i<n;i++)
  {
    q=(2*q)%(pop+1);
    if(x[i]=='1')
      q=(q+1)%(pop+1);
  }
  for(int i=0;i<n;i++)
  {
    if(x[i]=='0')
    {
      a[i]=(q+pow(2,n-i-1,pop+1))%(pop+1);
    }
    else
    {
      a[i]=((p-pow(2,n-i-1,pop-1))%(pop-1)+(pop-1))%(pop-1);
    }
  }
  for(int i=0;i<n;i++)
  {
    cout<<op(a[i])+1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:7: error: 'pop' was not declared in this scope; did you mean 'pow'?
   47 |       pop++;
      |       ^~~
      |       pow
a.cc:48:6: error: 'pop' was not declared in this scope; did you mean 'pow'?
   48 |   if(pop)
      |      ^~~
      |      pow
a.cc:59:14: error: 'pop' was not declared in this scope; did you mean 'pow'?
   59 |     q=(2*q)%(pop+1);
      |              ^~~
      |              pow
a.cc:67:27: error: 'pop' was not declared in this scope; did you mean 'pow'?
   67 |       a[i]=(q+pow(2,n-i-1,pop+1))%(pop+1);
      |                           ^~~
      |                           pow
a.cc:71:14: error: 'p' was not declared in this scope
   71 |       a[i]=((p-pow(2,n-i-1,pop-1))%(pop-1)+(pop-1))%(pop-1);
      |              ^
a.cc:71:28: error: 'pop' was not declared in this scope; did you mean 'pow'?
   71 |       a[i]=((p-pow(2,n-i-1,pop-1))%(pop-1)+(pop-1))%(pop-1);
      |                            ^~~
      |                            pow
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)    for(long long i = 0; i < (n) ; ++i)
#define orep(i,n)   for(long long i = 1; i <= (n); ++i)   // one rep
#define drep(i,n)   for(long long i = (n)-1; i >= 0; --i) // down rep
#define srep(i,s,t) for(long long i = (s); i < (t); ++i)  // set rep
#define rng(x)  (x).begin(),(x).end()

  // range
#define rrng(a) (a).rbegin(),(a).rend() // reverse range
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define ru(x,y) (((x)+(y)-1)/(y)) // round up
#define fi first
#define se second
#define eb emplace_back
#define fcout cout << fixed << setprecision(15)


using namespace std;
using ll  = long long;
using P   = pair<int,int>;
using vi  = vector<int>;
using vvi = vector<vi>;
using vp  = vector<P>;
using vl  = vector<ll>;

template<typename T> void Yes(T flag) {
  cout << (flag ? "Yes" : "No") << endl;
}

template<typename T> void pv(vector<T> vec) {
  cout << "[";
  for(auto& v : vec) { cout << v << ","; }
  cout << "]" << endl;
}

template<>
void pv(vector<P> vec) {
  cout << "[";
  for(auto& v : vec) {
    cout << "<" << v.fi << ","<< v.se << ">" << ",";
  }
  cout << "]" << endl;
}

template<typename T> void pv2(vector<vector<T>> vec) {
  for(auto& v : vec) pv(v);
}


int mx = 0;
int px=0;
void f(vi vx,int count,int j,vi modcp,vi modcm) {
  int ans = 0;
  bool pflag=true;
  int n = vx.size();
  int x = 0;
  if(vx.at(n - j)) {
    x = mx - modcm.at(n-j);
    x%=count-1;
    if(x<0) x+= count-1;
  }
  else {
    x = px + modcp.at(n-j);
    x %= count+1;
  }
  ans++;

    while(x!=0) {
      x = x % popcount(x);
      ans++;
    }
 cout << ans << endl;
}

int main() {
  int n;cin >> n;
  string s; cin >> s;
  int a = s.size();
  vi vx(a,0);
  int count = 0;
  rep(i,a) {
    if(s.at(i)=='1') {
      vx.at(i) = 1;
      count++;
    }
  }
  reverse(rng(vx));
  vi modcp(a,0);vi modcm(a,0);
  int t = 1;

  rep(i,a) {
    modcp.at(i) = t;
    t = t << 1;
    t %= count+1;
  }
  t = 1;
  if(count!=0){
    rep(i,a) {
      modcm.at(i) = t;
      t = t << 1;
      t %= count-1;
    }
    rep(i,n) {
      if(vx.at(i)) {
        mx+=modcm.at(i)%(count-1);
        mx%=(count-1);
      }
    }
  }

    rep(i,n) {
      if(vx.at(i)) {
        px+=modcp.at(i)%(count+1);
        px%=count+1;
      }
    }
  int aaa = vx.size();
  rep(i,aaa) f(vx,count,i+1,modcp,modcm);

  return 0;
}


Compiler output:
a.cc: In function 'void f(vi, int, int, vi, vi)':
a.cc:69:15: error: 'popcount' was not declared in this scope; did you mean 'count'?
   69 |       x = x % popcount(x);
      |               ^~~~~~~~
      |               count
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 1; i < (n+1) ;i++)

using namespace std;
using p=pair<int,int>;
typedef long long ll;

int pop(int x){
  int b=0;
  int d=0;
  while(x!=0){
    rep(i,200005){
      if(x>>i==1){
        b++;
      }
    }
    d++;
    int binary = 0;
    int base =1;
    while(b>=0){
      binary = binary + ( b % 2 ) * base;
      b = b / 2;
      base = base * 10;
    }
    x=binary;
  }
  return d;
}


int main() {
  int n,x;
  cin >> n >> x;
  for (int k=n;k>0;n--){
    if(x>>k==1){
      x>>k==1;
      cout << pop(x) << endl;
    }
    else if(x>>k==0){
      x>>k=0;
      cout <<pop(x) << endl;
    }
  }
  
  return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:40:8: error: lvalue required as left operand of assignment
   40 |       x>>k=0;
      |       ~^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int f(string s, int div) {
    int n = s.size();
    ll x = 0;
    rep(i,n) {
        if (s[i] == '1') {
            x += modpow(2,n-1-i,div);
            x %= div;
        }
    }
    return x%div;
}

int f_(int x, int ct = 1) {
    if (x == 0) return ct;
    int tmp = x % __builtin_popcount(x);
    if (tmp == 0) return ct+1;
    return f_(tmp,ct+1);
}

int main() {
    int n; cin >> n;
    string s; cin >> s;
    int div = 0;
    rep(i,n) if (s[i] == '1') div++;
    int x_plus = f(s,div+1);
    if (div-1 != 0) int x_minus = f(s,div-1);
    rep(i,n) {
        int div_tmp = div;
        string s_tmp = s;
        if (s[i] == '0') {
            s_tmp[i] = '1';
            ll x = x_plus+modpow(2,n-1-i,div+1);
            x %= div+1;
            // debug(x);
            cout << f_(x) << endl;
        }
        if (s[i] == '1') {
            s_tmp[i] = '0';
            if (div-1 == 0) cout << 0 << endl; 
            else {
                ll x = x_minus-modpow(2,n-1-i,div-1);
                if (x < 0) x += div-1;
                x %= div-1;
                // debug(x);
                cout << f_(x) << endl;
            }
        }
        // debug(s_tmp);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:24: error: 'x_minus' was not declared in this scope
   73 |                 ll x = x_minus-modpow(2,n-1-i,div-1);
      |                        ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
const int maxn = 2e5 + 5;
int f[maxn], pop[maxn], x[maxn];
int n;
int cal(int pos, int p)
{
	int res = 0;
	for (int i = 0; i < n; i++)
	{
		if (i + pos == n)
		{
			if (x[i] == 0)
				res = (res | (1 << i)) % p;
			continue;
		}
		if (x[i])
			res = (res | (1 << i)) % p;
	}
	return res % p;
}
int main()
{
	pop[0] = 0, pop[1] = 1;
	int i;
	for (i = 2; i < maxn; i *= 2)
	{
		pop[i] = 1;
		for (int j = i + 1; j < i * 2; j++)
		{
			pop[j] = 1 + pop[j - i];
		}
	}
	i /= 2;
	for (int j = i + 1; j < maxn; j++)
	{
		pop[j] = 1 + pop[j - i];
	}
	for (int j = 1; j < maxn; j++)
	{
		f[j] = f[j % pop[j]] + 1;
	}
	int one = 0;
	scanf_s("%d", &n);
	getchar();
	for (int j = n - 1; j >= 0; j--)
	{
		char c;
		scanf_s("%c", &c);
		x[j] = c - '0';
		if (x[j])
			one++;
	}
	for (int j = 1; j <= n; j++)
	{
		int o = one;
		if (x[n - j])
			o--;
		else
			o++;
		int res = cal(j, o);
		printf("%d\n", f[res] + 1);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   44 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;



int main(){
	int n;
	cin >> n;
	string s;
	cin >> s;
	int x = stoi(s, 0, 2);
	int p = popcount(x);
	rep(i, n){
		int np = p;
		if(x & (1<<i)){
			np--;
		}else{
			np++;
		}
		int nx = x^(1<<i);
		nx %= np;
		int c = 1;
		while(nx != 0){
			np = popcount(nx);
			nx %= np;
			c++;
		}
		cout << c << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'popcount' was not declared in this scope
   19 |         int p = popcount(x);
      |                 ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll popcount(ll num) {
  ll ans=0;
  ll i=2;
  while(1) {
    if (num%i!=0) {
      ans++;
      num = num - num%i;
    }
    if (i>num) break;
    i*=2;
  }
  return ans;
}

int main() {
  ll n;
  cin >> n;
  pmr::string x;
  cin >> x;
  ll num;
  ll pop;
  ll ans;
  for (ll i=0;i<n;i++) {
    ans=0;
    if (x[i]=='0') x[i]='1';
    else x[i]='0';
    num = stoi(x, 0, 2);
    while (1) {
      pop = popcount(num);
      num = num%pop;
      ans++;
      if (num==0) break;
    }
    cout << ans << endl;
    
    if (x[i]=='0') x[i]='1';
    else x[i]='0';
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: no matching function for call to 'stoi(std::pmr::string&, int, int)'
   31 |     num = stoi(x, 0, 2);
      |           ~~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'std::pmr::string' {aka 'std::__cxx11::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char> >'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'std::pmr::string' {aka 'std::__cxx11::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char> >'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define int ll
using namespace std;
 
int toDecimal(string binary, int i=0) 
{ 
    // If we reached last character 
    int n = binary.length(); 
    if (i == n-1) 
      return binary[i] - '0'; 
      
    // Add current tern and recur for 
    // remaining terms 
    return ((binary[i] - '0') << (n-i-1))  + 
            toDecimal(binary, i+1); 
} 
 
int sum=0;
void func(int n)
{
	if(n!=0)
	{
		sum++;
		int x;
		x=n%(__builtin_popcount(n));
		func(x);
	}
	else
	{
		cout<<sum;
	}
}
 
signed main()
{
	fastio;
	int n;
	cin>>n;
	string s;
	cin>>s;
	for(int i=0;i<n;i++)
	{
		string ss;
		ss=s;
		if(s[i]=='1')
		{
			ss[i]='0';
		}
		
		if(s[i]=='0')
		{
			ss[i]='1';
		}
		
		int num=number = stoi(ss, 0, 2);;
		
		sum=0;
		func(num);
		cout<<endl;
	}
	
		
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:25: error: 'number' was not declared in this scope
   57 |                 int num=number = stoi(ss, 0, 2);;
      |                         ^~~~~~
Language: C++

#include <stdio.h>
#include <iostream>

unsigned long popcnt(unsigned long x)
{
  unsigned long cnt = 0;
  while (x)
  {
    cnt += x % 2;
    x /= 2;
  }
  
  return cnt;
}

void f(unsigned long x)
{
  unsigned long cnt=0;
  while (x)
  {
    x = x % popcnt(x);
    cnt++;
  }
  
  std::cout << cnt;
}

unsigned long main()
{
  unsigned long n, x=0, m;
  std::cin >> n;
  getchar();
  
  m = n;
  while (m)
    x += (getchar() == '1') * (1 << --m);
    // prunsigned longf("%d %d\n", getchar() == '1', 1 << --m);
  
  // prunsigned longf("%d\n\n", x);
  
  while (n)
  {
    x = x ^ (1 << --n);
    f(x);
    x = x ^ (1 << n);
  }
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

ll f(bitset<300000> b, ll n) {
	if(!b.any()) return n;
	ll popcount = b.count();
	bitset<300000> p(popcount);
	b %= p;
	return f(b, n + 1);
}

int main() {
	int N; cin >> N;
    string X; cin >> X;
	for(int i = N - 1; i >= 0; i--) {
		bitset<300000> bit(X);
		bit.flip(i);
		cout << f(bit, 0) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'll f(std::bitset<300000>, ll)':
a.cc:19:11: error: no match for 'operator%=' (operand types are 'std::bitset<300000>' and 'std::bitset<300000>')
   19 |         b %= p;
      |         ~~^~~~
Language: C++

#include<bits/stdc++.h>
// #define int long long
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define repa(i, s, n) for(int i = s; i < (int)n; i++)
#define MOD 1000000007
using namespace std;
using ll = long long;
typedef vector<int> vi;

/*ll stonum(string s){
    ll num = 0;
    for(ll i = s.length()-1; i >= 0; i--){
        if(s[i] == '1') num += (ll)pow(2,(s.length()-i)-1);
    }
    // cout << num << endl;
    return num;
}*/

void f(string s){
    ll cnt = 0;
    ll n = stoi(s, 0, 2);
    while(n != 0){
        n = n % popcount(n);
        cnt++;
    }
    cout << cnt << endl;
}

signed main() {
    ll n;
    cin >> n;
    string s;
    cin >> s;
    rep(i, n){
        if(s[i] == '1') s[i] = '0';
        else s[i] = '1';
        f(s);
        if(s[i] == '1') s[i] = '0';
        else s[i] = '1';
    }
    return 0;
}

Compiler output:
a.cc: In function 'void f(std::string)':
a.cc:23:17: error: 'popcount' was not declared in this scope
   23 |         n = n % popcount(n);
      |                 ^~~~~~~~
Language: C++

#include <stdio.h>

unsigned long popcnt(unsigned long x)
{
  unsigned long cnt = 0;
  while (x)
  {
    cnt += x % 2;
    x /= 2;
  }
  
  return cnt;
}

void f(unsigned long x)
{
  unsigned long cnt=0;
  while (x)
  {
    x = x % popcnt(x);
    cnt++;
  }
  
  prunsigned longf("%d\n", cnt);
}

unsigned long main()
{
  unsigned long n, x=0, m;
  scanf("%d", &n);
  getchar();
  
  m = n;
  while (m)
    x += (getchar() == '1') * (1 << --m);
    // prunsigned longf("%d %d\n", getchar() == '1', 1 << --m);
  
  // prunsigned longf("%d\n\n", x);
  
  while (n)
  {
    x = x ^ (1 << --n);
    f(x);
    x = x ^ (1 << n);
  }
}


Compiler output:
a.cc: In function 'void f(long unsigned int)':
a.cc:24:3: error: 'prunsigned' was not declared in this scope; did you mean 'unsigned'?
   24 |   prunsigned longf("%d\n", cnt);
      |   ^~~~~~~~~~
      |   unsigned
At global scope:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
#include <map> 
#include <iostream>
#include <string>
#include <typeinfo>
using namespace std;


long long one(long long bina){
    long long ans = 0;
    long long count = 0;
    for (long long i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        if (bina%2 == 1) count++;
        bina = bina/2;
    }
    return count;
}
long long binary(string binary) {
  /* 変数の宣言 */reverse(binary.begin(), binary.end());
  long long decimal = 0;
  long long base = 1;
 
  /* 2進数を10進数に変換 */
  int i = 0;
  while(i < sizeof(binary) - 1){
    if (binary[i] == '1') {
        decimal += pow(2,i);
    }
    i++;
  }
 
  return decimal;
}


int main(void) {
    long long N; string X; cin >> N >> X;
    long long i = 0;
    while (i < N) {
        string tmpX = X;
        long long ans = 0;
        if (tmpX[i] == '1') {
            tmpX[i] = '0';
        }  else {
            tmpX[i] = '1';
        }
        long long tmp = binary(tmpX);
        while (tmp != 0) {
            tmp = tmp % one(tmp);
            ans++;
        }
        cout << ans << endl;
        i++;
    }
}

Compiler output:
a.cc: In function 'long long int binary(std::string)':
a.cc:24:19: error: 'reverse' was not declared in this scope
   24 |   /* 変数の宣言 */reverse(binary.begin(), binary.end());
      |                   ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


//ミョ(-ω- ?)
int main() {
    //vector<ll> data(2*1e5);
    //rep(i,2*1e5)data[i] = __builtin_popcountll(i);
    ll n;
    string x;
    cin >> n >> x;
    map<ll,ll> past;
    rep(i,n){
        string s = x;
        if(s[i] == '0')s[i] = '1';
        else s[i] = '0';
        ll tar = 0;
        ll res = 0;
        rep(i,s.length()){
            tar += (s[i] - '0')*pow(2,(ll)s.length() - i -1);
        }
        while(tar != 0){
            //if(past[tar] != 0) tar = past[tar];
            //else {
            //    past[tar] = tar%data[tar];
            //    tar %= data[tar];
            //}
            tar %= __builtin_popcountll();
            res++;
            s = to_string(tar);
            tar = 0;
            rep(i,s.length())tar += (s[i] - '0')*pow(2,(ll)s.length() - i -1);
        };
        cout << res << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:40: error: too few arguments to function 'int __builtin_popcountll(long long unsigned int)'
   37 |             tar %= __builtin_popcountll();
      |                    ~~~~~~~~~~~~~~~~~~~~^~