Language: C++

#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int INT_INF = 500000000;
const long long LONG_LONG_INF = (long long)pow(10, 18);
const int MOD = pow(10, 9) + 7;
/* contest template */
long long N, ans;
vector<string> S(300);
vector<vector<vector<bool> > > v(300,
                                 vector < vector<bool>(300, vector<bool>(300)));

int check(vector<string> S, int N, int A, int B) {
  for (int i = 0; i <= N - 2; i++) {
    for (int j = i + 1; j <= N - 1; j++) {
      if (S[(i + A) % N][(j + B) % N] != S[(j + A) % N][(i + B) % N]) {
        return 0;
      }
    }
  }
  return 1;
}

int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < N; i++) {
    for (int A = 0; A < N; A++) {
      for (int j = 0; j < N; j++) {
        if (S[i + A][j] != S[j][i + A]) {
          j--;
          break;
        }
      }
      if (j == N - 1) {
        for (int j = 0; j < N; j++) {
          v[i][A + i][i] = true;
        }
      }
    }
  }
  for (int A = 0; A < N; A++) {
    for (int B = 0; B < N; B++) {
      for (int i = 0; i < N; i++) {
        if (S[i][A][B] == false) {
          i--;
          break;
        }
        if (i == N - 1) {
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc:18:78: error: no matching function for call to 'std::vector<bool>::vector(int, std::vector<bool>)'
   18 |                                  vector < vector<bool>(300, vector<bool>(300)));
      |                                                                              ^
In file included from /usr/include/c++/14/vector:67,
                 from /usr/include/c++/14/functional:64,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_bvector.h:870:9: note: candidate: 'template<class _InputIterator, class> std::vector<bool, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Alloc = std::allocator<bool>]'
  870 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:870:9: note:   template argument deduction/substitution failed:
a.cc:18:78: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<bool>')
   18 |                                  vector < vector<bool>(300, vector<bool>(300)));
      |                                                                              ^
/usr/include/c++/14/bits/stl_bvector.h:857:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::initializer_list<bool>, const allocator_type&) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>]'
  857 |       vector(initializer_list<bool> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:857:37: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<bool>'
  857 |       vector(initializer_list<bool> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:849:7: note: candidate: 'std::vector<bool, _Alloc>::vector(const std::vector<bool, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Alloc = std::allocator<bool>; std::__type_identity_t<_Alloc> = std::allocator<bool>]'
  849 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:849:28: note:   no known conversion for argument 1 from 'int' to 'const std::vector<bool>&'
  849 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:842:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Alloc = std::allocator<bool>; std::__type_identity_t<_Alloc> = std::allocator<bool>]'
  842 |       vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:842:23: note:   no known conversion for argument 1 from 'int' to 'std::vector<bool>&&'
  842 |       vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:827:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&, std::false_type) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>; std::false_type = std::false_type]'
  827 |       vector(vector&& __x, const allocator_type& __a, false_type)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:827:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:822:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&, const allocator_type&, std::true_type) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>; std::true_type = std::true_type]'
  822 |       vector(vector&& __x, const allocator_type& __a, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:822:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:818:7: note: candidate: 'std::vector<bool, _Alloc>::vector(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
  818 |       vector(vector&&) = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:818:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:809:7: note: candidate: 'std::vector<bool, _Alloc>::vector(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
  809 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:809:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:795:7: note: candidate: 'std::vector<bool, _Alloc>::vector(size_type, const bool&, const allocator_type&) [with _Alloc = std::allocator<bool>; size_type = long unsigned int; allocator_type = std::allocator<bool>]'
  795 |       vector(size_type __n, const bool& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:795:41: note:   no known conversion for argument 2 from 'std::vector<bool>' to 'const bool&'
  795 |       vector(size_type __n, const bool& __value,
      |                             ~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:790:7: note: candidate: 'std::vector<bool, _Alloc>::vector(size_type, const allocator_type&) [with _Alloc = std::allocator<bool>; size_type = long unsigned int; allocator_type = std::allocator<bool>]'
  790 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:790:51: note:   no known conversion for argument 2 from 'std::vector<bool>' to 'const std::vector<bool>::allocator_type&' {aka 'const std::allocator<bool>&'}
  790 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |                             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:784:7: note: candidate: 'std::vector<bool, _Alloc>::vector(const allocator_type&) [with _Alloc = std::allocator<bool>; allocator_type = std::allocator<bool>]'
  784 |       vector(const allocator_type& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:784:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_bvector.h:777:7: note: candidate: 'std::vector<bool, _Alloc>::vector() [with _Alloc = std::allocator<bool>]'
  777 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_bvector.h:777:7: note:   candidate expects 0 arguments, 2 provided
a.cc:18:78: error: template argument 1 is invalid
   18 |                                  vector < vector<bool>(300, vector<bool>(300)));
      |                                                                              ^
a.cc:18:78: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:44:11: error: 'j' was not declared in this scope
   44 |       if (j == N - 1) {
      |           ^
a.cc:54:20: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   54 |         if (S[i][A][B] == false) {
      |                    ^