Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main() {
	int N, D,Q,P;
	cin >> N >> D;
	vector<string> a(10);

	for (int i = 0; i << N; i++) {
		cin >>a.at(i);
	}
	int ans = 0;

	for (int i = 0; i < D; i++) {
		Q += (a.at(2) - a.at(1)) ^ 2;
	}
	P = Q^(1 / 2);

	int ans = 0;
	if (P = int P) {
		ans = P.count(i);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'})
   16 |                 Q += (a.at(2) - a.at(1)) ^ 2;
      |                       ~~~~~~~ ^ ~~~~~~~
      |                           |         |
      |                           |         basic_string<[...]>
      |                           basic_string<[...]>
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:16:39: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   16 |                 Q += (a.at(2) - a.at(1)) ^ 2;
      |                                       ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:16:39: note:   '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   16 |                 Q += (a.at(2) - a.at(1)) ^ 2;
      |                                       ^
a.cc:20:13: error: redeclaration of 'int ans'
   20 |         int ans = 0;
      |             ^~~
a.cc:13:13: note: 'int ans' previously declared here
   13 |         int ans = 0;
      |             ^~~
a.cc:21:17: error: expected primary-expression before 'int'
   21 |         if (P = int P) {
      |                 ^~~
a.cc:21:16: error: expected ')' before 'int'
   21 |         if (P = int P) {
      |            ~   ^~~~
      |                )
a.cc:22:25: error: request for member 'count' in 'P', which is of non-class type 'int'
   22 |                 ans = P.count(i);
      |                         ^~~~~
a.cc:22:31: error: 'i' was not declared in this scope
   22 |                 ans = P.count(i);
      |                               ^