Submission #853431

# Submission time Handle Problem Language Result Execution time Memory
853431 2023-09-24T10:47:54 Z lto5 Paint (COI20_paint) C++17
Compilation error
0 ms 0 KB
SUBMISSION #381589
#	Submission timeUTC+7	Handle	Problem	Language	Result	Execution time	Memory
381589	2021-03-25 17:33:38	kartel	Paint (COI20_paint)	C++14	
48 / 100
1054 ms	74220 KB
paint
#include <bits/stdc++.h>
#define in(x) freopen(x, "r", stdin)
#define out(x) freopen(x, "w", stdout)
//#include <time.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
#define F first
#define S second
#define pb push_back
#define M ll(1e9 + 7)
//#define M ll(998244353)
#define sz(x) (int)x.size()
#define re return
#define oo ll(1e18)
#define el '\n'
#define pii pair <int, int>
#define all(x) (x).begin(), (x).end()
#define arr_all(x, n) (x + 1), (x + 1 + n)
#define vi vector<int>
#define eps (ld)1e-9
using namespace std;
typedef long long ll;
//using namespace __gnu_pbds;
//typedef tree <ll, null_type, less_equal <ll> , rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef double ld;
typedef unsigned long long ull;
typedef short int si;
 
const int N = 2e5 + 500;
 
int steps[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
int n, m, qq;
vector < vector <int> > a, mk;
int l[N], pr[N], r[N], siz[N], color[N], ans[N];
set <int> ng[N];
 
int id(int x, int y) {return (x * m + y);}
 
int f(int x) {return (x == pr[x] ? x : pr[x] = f(pr[x]));}
void link(int x, int y, int c) {
    x = f(x);
    y = f(y);
 
    if (x == y) {
        return;
    }
 
    if (n == 1) {
        if (siz[x] > siz[y]) {
            swap(x, y);
        }
 
        l[y] = min(l[y], l[x]);
        r[y] = max(r[y], r[x]);
        color[y] = c;
        pr[x] = y;
        siz[y] += siz[x];
    }
    else {
        if (sz(ng[x]) > sz(ng[y])) {
            swap(x, y);
        }
 
        pr[x] = y;
        siz[y] += siz[x];
        color[y] = c;
 
        for (auto p : ng[x]) {
            ng[y].insert(p);
        }
    }
}
 
void solve() {
    queue <pii> q;
    while (qq--) {
        int i, j, c;
        cin >> i >> j >> c; i--; j--;
 
        q.push({i, j});
        int old = a[i][j];
 
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                mk[i][j] = 0;
            }
        }
 
        while (sz(q)) {
            int x = q.front().F;
            int y = q.front().S; q.pop();
 
            a[x][y] = c;
 
            for (int i = 0; i < 4; i++) {
                int cx = x + steps[i][0];
                int cy = y + steps[i][1];
 
                if (cx < 0 || cy < 0 || cx >= n || cy >= m || a[cx][cy] != old || mk[cx][cy]) {
                    continue;
                }
 
                mk[cx][cy] = 1;
                q.push({cx, cy});
            }
        }
    }
 
    for (int i = 0; i < n; i++, cout << el) {
        for (int j = 0; j < m; j++) {
            cout << a[i][j] << " ";
        }
    }
    exit(0);
}
 
void upd(int x, int nc) {
    x = f(x);
    color[x] = nc;
 
    if (l[x] && color[f(l[x] - 1)] == color[x]) {
        link(l[x] - 1, x, nc);
    }
 
    if (r[x] < m - 1 && color[f(r[x] + 1)] == color[x]) {
        link(r[x] + 1, x, nc);
    }
}
 
void solve1() {
    for (int j = 0; j < m; j++) {
        if (j && a[0][j - 1] == a[0][j]) {
            link(j - 1, j, 0);
        }
 
        if (j < m - 1 && a[0][j] == a[0][j + 1]) {
            link(j, j + 1, 0);
        }
    }
 
    for (int j = 0; j < m; j++) {
        color[f(j)] = a[0][j];
    }
 
    while (qq--) {
        int x, y, c;
        cin >> x >> y >> c; x--; y--;
 
        if (n == 1) {
            upd(y, c);
        }
    }
 
    for (int j = 0; j < m; j++) {
        if (mk[0][j]) {
            cout << ans[j] << " ";
            continue;
        }
 
        int x = f(j);
 
        int c = color[x];
 
        for (int i = l[x]; i <= r[x]; i++) {
            ans[i] = c;
            mk[0][i] = 1;
        }
 
        cout << ans[j] << " ";
    }
    cout << el;
}
 
void solve2() {
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            int d = id(i, j);
 
            pr[d] = d;
            siz[d] = 1;
        }
    }
 
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            for (int k = 0; k < 4; k++) {
                int x = i + steps[k][0];
                int y = j + steps[k][1];
 
                if (x < 0 || y < 0 || x >= n || y >= m || a[x][y] != a[i][j]) {
                    continue;
                }
 
                link(id(i, j), id(x, y), 0);
            }
        }
    }
 
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
//            cerr << f(id(i, j)) << " ";
            for (int k = 0; k < 4; k++) {
                int x = i + steps[k][0];
                int y = j + steps[k][1];
 
                if (x < 0 || y < 0 || x >= n || y >= m || a[x][y] == a[i][j]) {
                    continue;
                }
 
                int par = f(id(i, j));
 
                ng[par].insert(f(id(x, y)));
            }
        }
    }
 
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            color[f(id(i, j))] = a[i][j];
        }
    }
 
    while (qq--) {
        int i, j, c;
        cin >> i >> j >> c;
        i--; j--;
 
        assert(c <= 1);
 
        int ID = id(i, j);
        int par = f(ID);
 
        if (color[par] == c) {
            continue;
        }
 
        color[par] = c;
 
        set <int> negs = ng[par];
        ng[par].clear();
 
        for (auto x : negs) {
            link(ID, x, c);
        }
    }
 
    for (int i = 0; i < n; i++, cout << el) {
        for (int j = 0; j < m; j++) {
            cout << color[f(id(i, j))] << " ";
        }
    }
    cout << el;
}
 
int main()
{
//    mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());;
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//	in("toys.in");
//	out("toys.out");
//    in("input.txt");
//    out("output.txt");
//    cerr.precision(9); cerr << fixed;
 
//    clock_t tStart = clock();
 
    cin >> n >> m;
 
    a.resize(n);
    mk.resize(n);
 
    for (int i = 0; i < n; i++) {
        a[i].resize(m);
        mk[i].resize(m);
 
        for (int j = 0; j < m; j++) {
            cin >> a[i][j];
 
            pr[j] = j;
            siz[j] = 1;
            l[j] = j;
            r[j] = j;
        }
    }
 
    cin >> qq;solve2();
 
   /* if (n * m * 1ll * qq <= (ll)100000000) {
        solve();
    }
    else if (n == 1) {
        solve1();
    }
    else {
        solve2();
    }*/
}
 
 
/*
 
7
4 6 7 2 3 1 5
*/

Compilation message

paint.cpp:2:12: error: stray '#' in program
    2 | SUBMISSION #381589
      |            ^
paint.cpp:3:3: error: invalid preprocessing directive #Submission
    3 | # Submission timeUTC+7 Handle Problem Language Result Execution time Memory
      |   ^~~~~~~~~~
paint.cpp:2:1: error: 'SUBMISSION' does not name a type
    2 | SUBMISSION #381589
      | ^~~~~~~~~~
In file included from /usr/include/c++/10/cmath:43,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/ext/type_traits.h:162:35: error: 'bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
  162 |   __is_null_pointer(std::nullptr_t)
      |                                   ^
/usr/include/c++/10/ext/type_traits.h:157:5: note: previous declaration 'template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)'
  157 |     __is_null_pointer(_Type)
      |     ^~~~~~~~~~~~~~~~~
/usr/include/c++/10/ext/type_traits.h:162:26: error: 'nullptr_t' is not a member of 'std'
  162 |   __is_null_pointer(std::nullptr_t)
      |                          ^~~~~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:402:26: error: 'std::size_t' has not been declared
  402 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/10/type_traits:403:25: error: '_Size' was not declared in this scope
  403 |     struct is_array<_Tp[_Size]>
      |                         ^~~~~
/usr/include/c++/10/type_traits:403:31: error: template argument 1 is invalid
  403 |     struct is_array<_Tp[_Size]>
      |                               ^
/usr/include/c++/10/type_traits:508:42: error: 'nullptr_t' is not a member of 'std'
  508 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                          ^~~~~~~~~
/usr/include/c++/10/type_traits:508:51: error: template argument 1 is invalid
  508 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                                   ^
/usr/include/c++/10/type_traits:1351:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1351 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1351:57: error: template argument 1 is invalid
 1351 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                                         ^
/usr/include/c++/10/type_traits:1351:57: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1360:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1360 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1360:46: error: template argument 1 is invalid
 1360 |     : public integral_constant<std::size_t, 0> { };
      |                                              ^
/usr/include/c++/10/type_traits:1360:46: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1362:26: error: 'std::size_t' has not been declared
 1362 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/10/type_traits:1363:21: error: '_Size' was not declared in this scope
 1363 |     struct rank<_Tp[_Size]>
      |                     ^~~~~
/usr/include/c++/10/type_traits:1363:27: error: template argument 1 is invalid
 1363 |     struct rank<_Tp[_Size]>
      |                           ^
/usr/include/c++/10/type_traits:1364:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1364 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1364:65: error: template argument 1 is invalid
 1364 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/10/type_traits:1364:65: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1368:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1368 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1368:65: error: template argument 1 is invalid
 1368 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/10/type_traits:1368:65: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1373:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1373 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1373:46: error: template argument 1 is invalid
 1373 |     : public integral_constant<std::size_t, 0> { };
      |                                              ^
/usr/include/c++/10/type_traits:1373:46: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1375:42: error: 'std::size_t' has not been declared
 1375 |   template<typename _Tp, unsigned _Uint, std::size_t _Size>
      |                                          ^~~
/usr/include/c++/10/type_traits:1376:23: error: '_Size' was not declared in this scope
 1376 |     struct extent<_Tp[_Size], _Uint>
      |                       ^~~~~
/usr/include/c++/10/type_traits:1376:36: error: template argument 1 is invalid
 1376 |     struct extent<_Tp[_Size], _Uint>
      |                                    ^
/usr/include/c++/10/type_traits:1377:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1377 |     : public integral_constant<std::size_t,
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1378:24: error: '_Size' was not declared in this scope
 1378 |           _Uint == 0 ? _Size : extent<_Tp,
      |                        ^~~~~
/usr/include/c++/10/type_traits:1379:28: error: template argument 1 is invalid
 1379 |           _Uint - 1>::value>
      |                            ^
/usr/include/c++/10/type_traits:1379:28: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1384:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1384 |     : public integral_constant<std::size_t,
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/stl_pair.h:59,
                 from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/type_traits:1386:31: error: template argument 1 is invalid
 1386 |              _Uint - 1>::value>
      |                               ^
/usr/include/c++/10/type_traits:1386:31: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1975:26: error: 'std::size_t' has not been declared
 1975 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/10/type_traits:1976:30: error: '_Size' was not declared in this scope
 1976 |     struct remove_extent<_Tp[_Size]>
      |                              ^~~~~
/usr/include/c++/10/type_traits:1976:36: error: template argument 1 is invalid
 1976 |     struct remove_extent<_Tp[_Size]>
      |                                    ^
/usr/include/c++/10/type_traits:1988:26: error: 'std::size_t' has not been declared
 1988 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/10/type_traits:1989:35: error: '_Size' was not declared in this scope
 1989 |     struct remove_all_extents<_Tp[_Size]>
      |                                   ^~~~~
/usr/include/c++/10/type_traits:1989:41: error: template argument 1 is invalid
 1989 |     struct remove_all_extents<_Tp[_Size]>
      |                                         ^
/usr/include/c++/10/type_traits:2047:12: error: 'std::size_t' has not been declared
 2047 |   template<std::size_t _Len>
      |            ^~~
/usr/include/c++/10/type_traits:2052:23: error: '_Len' was not declared in this scope
 2052 |  unsigned char __data[_Len];
      |                       ^~~~
/usr/include/c++/10/type_traits:2067:12: error: 'std::size_t' has not been declared
 2067 |   template<std::size_t _Len, std::size_t _Align =
      |            ^~~
/usr/include/c++/10/type_traits:2067:30: error: 'std::size_t' has not been declared
 2067 |   template<std::size_t _Len, std::size_t _Align =
      |                              ^~~
/usr/include/c++/10/type_traits:2068:48: error: '_Len' was not declared in this scope
 2068 |     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                ^~~~
/usr/include/c++/10/type_traits:2068:52: error: template argument 1 is invalid
 2068 |     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                    ^
/usr/include/c++/10/type_traits:2073:23: error: '_Len' was not declared in this scope
 2073 |  unsigned char __data[_Len];
      |                       ^~~~
/usr/include/c++/10/type_traits:2074:37: error: '_Align' was not declared in this scope
 2074 |  struct __attribute__((__aligned__((_Align)))) { } __align;
      |                                     ^~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/bits/stl_pair.h:92:12: error: 'std::size_t' has not been declared
   92 |   template<std::size_t...>
      |            ^~~
/usr/include/c++/10/bits/stl_pair.h:449:36: error: 'std::size_t' has not been declared
  449 |       template<typename... _Args1, std::size_t... _Indexes1,
      |                                    ^~~
/usr/include/c++/10/bits/stl_pair.h:450:36: error: 'std::size_t' has not been declared
  450 |                typename... _Args2, std::size_t... _Indexes2>
      |                                    ^~~
/usr/include/c++/10/bits/stl_pair.h:453:27: error: '_Indexes1' was not declared in this scope
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                           ^~~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:453:36: error: expected parameter pack before '...'
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                    ^~~
/usr/include/c++/10/bits/stl_pair.h:453:39: error: template argument 1 is invalid
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                       ^
/usr/include/c++/10/bits/stl_pair.h:453:55: error: '_Indexes2' was not declared in this scope
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                                       ^~~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:453:64: error: expected parameter pack before '...'
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                                                ^~~
/usr/include/c++/10/bits/stl_pair.h:453:67: error: template argument 1 is invalid
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                                                   ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:65,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
  125 |   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
      |                                                                   ^~~~~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:65,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
  +++ |+#include <cstddef>
    1 | // Types used in iterator implementation -*- C++ -*-
In file included from /usr/include/c++/10/bits/stl_algobase.h:65,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from paint.cpp:8:
/usr/include/c++/10/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
  214 |       typedef ptrdiff_t