Language: C++

    #include <iostream>
    #include <cstdio>
    #include <vector>
    #include <cmath>
    #include <algorithm>
    #include <numeric>
    #include <cassert>
    #include <utility>
    #include <cmath>
     
    using namespace std;
     
    using lli = long long int;
    // #define DEBUG
    #ifdef DEBUG
    #define debug(var) cout << (#var) << ": " << (var) << endl;
    template<class T> void dump_array_impl(const T& a) {
      bool first = true;
      for (auto&& x : a) {
        if (!first) { cout << ", "; first = false; }
        cout << x;
      }
    }
    #define debug_array(a) cout<<(#a)<<": ";dump_array_impl(a);cout<<endl
    #else
    #define debug(var) {}
    #define debug_array(a) {}
    #endif
     
    lli n;
    vector<lli> v;
    int main() {
      cin >> n;
      for (int i=0; i<n; ++i) {
        lli x; cin >> x;
        v.push_back(x);
      }
      sort(begin(v), end(v));
      lli ans = 0;
      for (lli x=1ll<<31; x>=2; x>>=1) {
        vector<lli> vv;
        debug(x);
        for (int i=0; i<v.size(); ++i) {
          lli tgt = x - v[i];
          auto it = lower_bound(begin(v)+i+1, end(v), tgt);
          if (it != end(v) && *it == tgt) {
    	v.erase(it);
    	++ans;
          } else {
    	vv.push_back(v[i]);
          }
        }
        v = move(vv);
      }
      cout << ans << endl;
      return 0;
    }

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <cmath>

using namespace std;

using lli = long long int;
// #define DEBUG
#ifdef DEBUG
#define debug(var) cout << (#var) << ": " << (var) << endl;
template<class T> void dump_array_impl(const T& a) {
  bool first = true;
  for (auto&& x : a) {
    if (!first) { cout << ", "; first = false; }
    cout << x;
  }
}
#define debug_array(a) cout<<(#a)<<": ";dump_array_impl(a);cout<<endl
#else
#define debug(var) {}
#define debug_array(a) {}
#endif

lli n;
vector<lli> v;
int main() {
  cin >> n;
  for (int i=0; i<n; ++i) {
    lli x; cin >> x;
    v.push_back(x);
  }
  sort(begin(v), end(v));
  lli ans = 0;
  for (lli x=1ll<<31; x>=2; x>>=1) {
    vector<lli> vv;
    debug(x);
    for (int i=0; i<v.size(); ++i) {
      lli tgt = x - v[i];
      auto it = lower_bound(begin(v)+i+1, end(v), tgt);
      if (it != end(v) && *it == tgt) {
	v.erase(it);
	++ans;
      } else {
	vv.push_back(v[i]);
      }
    }
    v = move(vv);
  }
  cout << ans << endl;
  return 0;
}

提出情報
提出日時

Compiler output:
a.cc:88:5: error: redefinition of 'lli n'
   88 | lli n;
      |     ^
a.cc:30:9: note: 'lli n' previously declared here
   30 |     lli n;
      |         ^
a.cc:89:13: error: redefinition of 'std::vector<long long int> v'
   89 | vector<lli> v;
      |             ^
a.cc:31:17: note: 'std::vector<long long int> v' previously declared here
   31 |     vector<lli> v;
      |                 ^
a.cc:90:5: error: redefinition of 'int main()'
   90 | int main() {
      |     ^~~~
a.cc:32:9: note: 'int main()' previously defined here
   32 |     int main() {
      |         ^~~~
a.cc:117:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
  117 | 提出情報
      | ^~~~~~~~