Language: C++

#in#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p = Mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
signed main() {
	string s;
	cin >> s;
	int ans = 0;
	stack<char>st;
	for (int i = 0; i < s.size(); i++) {
		if (st.size() == 0) {
			st.push(s[i]);
			continue;
		}
		if (st.top() != s[i]) {
			st.pop();
			ans += 2;
		}
		else {
			st.push(s[i]);
		}
	}
	cout << ans << endl;
}clude<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p = Mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
signed main() {
	string s;
	cin >> s;
	int ans = 0;
	int zero = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '0') {
			zero++;
		}
		else {
			ans += 2;
			zero--;
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #in; did you mean #if?
    1 | #in#include<iostream>
      |  ^~
      |  if
a.cc: In function 'int main()':
a.cc:71:9: error: 'cin' was not declared in this scope
   71 |         cin >> s;
      |         ^~~
a.cc:19:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   18 | #include<fstream>
  +++ |+#include <iostream>
   19 | using namespace std;
a.cc:87:9: error: 'cout' was not declared in this scope
   87 |         cout << ans << endl;
      |         ^~~~
a.cc:87:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc: At global scope:
a.cc:88:2: error: 'clude' does not name a type
   88 | }clude<iostream>
      |  ^~~~~
a.cc:111:10: error: redefinition of 'const ll Mod'
  111 | const ll Mod = 1000000007;
      |          ^~~
a.cc:24:10: note: 'const ll Mod' previously defined here
   24 | const ll Mod = 1000000007;
      |          ^~~
a.cc:112:8: error: redefinition of 'struct P'
  112 | struct P {
      |        ^
a.cc:25:8: note: previous definition of 'struct P'
   25 | struct P {
      |        ^
a.cc:117:8: error: redefinition of 'struct B'
  117 | struct B {
      |        ^
a.cc:30:8: note: previous definition of 'struct B'
   30 | struct B {
      |        ^
a.cc:120:8: error: redefinition of 'struct E'
  120 | struct E {
      |        ^
a.cc:33:8: note: previous definition of 'struct E'
   33 | struct E {
      |        ^
a.cc:125:8: error: redefinition of 'struct H'
  125 | struct H {
      |        ^
a.cc:38:8: note: previous definition of 'struct H'
   38 | struct H {
      |        ^
a.cc:138:4: error: redefinition of 'll gcd(ll, ll)'
  138 | ll gcd(ll i, ll j) {
      |    ^~~
a.cc:51:4: note: 'll gcd(ll, ll)' previously defined here
   51 | ll gcd(ll i, ll j) {
      |    ^~~
a.cc:143:4: error: redefinition of 'll mod_pow(ll, ll, ll)'
  143 | ll mod_pow(ll x, ll n, ll p = Mod) {
      |    ^~~~~~~
a.cc:56:4: note: 'll mod_pow(ll, ll, ll)' previously defined here
   56 | ll mod_pow(ll x, ll n, ll p = Mod) {
      |    ^~~~~~~
a.cc:152:10: error: redefinition of 'const ll Inf'
  152 | const ll Inf = 3023372036854775807;
      |          ^~~
a.cc:65:10: note: 'const ll Inf' previously defined here
   65 | const ll Inf = 3023372036854775807;
      |          ^~~
a.cc:153:11: error: conflicting declaration 'const long long int inf'
  153 | const int inf = 1500000000;
      |           ^~~
a.cc:66:11: note: previous declaration as 'const int inf'
   66 | const int inf = 1500000000;
      |           ^~~
a.cc:156:8: error: redefinition of 'int main()'
  156 | signed main() {
      |        ^~~~
a.cc:69:8: note: 'int main()' previously defined here
   69 | signed main() {
      |        ^~~~
a.cc: In function 'int main()':
a.cc:158:9: error: 'cin' was not declared in this scope
  158 |         cin >> s;
      |         ^~~
a.cc:158:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:170:9: error: 'cout' was not declared in this scope
  170 |         cout << ans << endl;
      |         ^~~~
a.cc:170:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'