Language: C++

using namespace std;
#define lint long long
//#define P pair<int, int>

int main(){
    lint N;
    cin >> N;
    vector<bool> ans;
    
    if(N == 0){
        cout << 0 << endl;
        return 0;
    }
    
    while(N != 0){
        int s = N % 4;
        N/= 4;
        if(s == 0){
            ans.push_back(0);
            ans.push_back(0);
        }
        if(s == 1 | s == -3){
            if(s == -3){
                N--;
            }
            ans.push_back(1);
            ans.push_back(0);
        }
        if(s == 2 | s == -2){
            if(s == 2){
                N++;
            }
            ans.push_back(0);
            ans.push_back(1);
        }
        if(s == 3 | s == -1){
            if(s == 3){
                N++;
            }
            ans.push_back(1);
            ans.push_back(1);
        }
    }

    int b = ans.size();
    if(ans[b - 1] == 0){
        b--;
    }
    
    for(int i = b - 1; i >= 0; --i){
        cout << ans[i];
    }
    cout << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> N;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<bool> ans;
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'bool'
    8 |     vector<bool> ans;
      |            ^~~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << 0 << endl;
      |         ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |         cout << 0 << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:19:13: error: 'ans' was not declared in this scope
   19 |             ans.push_back(0);
      |             ^~~
a.cc:26:13: error: 'ans' was not declared in this scope
   26 |             ans.push_back(1);
      |             ^~~
a.cc:33:13: error: 'ans' was not declared in this scope
   33 |             ans.push_back(0);
      |             ^~~
a.cc:40:13: error: 'ans' was not declared in this scope
   40 |             ans.push_back(1);
      |             ^~~
a.cc:45:13: error: 'ans' was not declared in this scope
   45 |     int b = ans.size();
      |             ^~~
a.cc:51:9: error: 'cout' was not declared in this scope
   51 |         cout << ans[i];
      |         ^~~~
a.cc:51:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:5: error: 'cout' was not declared in this scope
   53 |     cout << endl;
      |     ^~~~
a.cc:53:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:53:13: error: 'endl' was not declared in this scope
   53 |     cout << endl;
      |             ^~~~
a.cc:53:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'