답안 #309184

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
309184 2020-10-02T20:27:09 Z Vimmer 버섯 세기 (IOI20_mushrooms) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "mushrooms.h"
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define N 100005
#define PB push_back
#define sz(x) int(x.size())
#define F first
#define M ll(1e9 + 7)
#define S second
#define all(x) x.begin(), x.end()
#define endl '\n'

//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
//typedef tree <int, null_type, less_equal <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int val[N], kol, sum = 0;
//
//int use_machine(vector <int> &pr)
//{
//    if (kol < 4) {for (auto it : pr) cout << it << " "; cout << endl; }
//
//    set <int> se; se.clear();
//
//    sum += sz(pr);
//
//    if (sz(pr) < 2) exit(0);
//
//    kol++;
//
//    int ans = 0;
//
//    for (int i = 1; i < sz(pr); i++)
//        if (val[pr[i]] != val[pr[i - 1]]) ans++;
//
//
//    return ans;
//}

int skok = 103;

int ask(vector <int> &m) { return use_machine(m);}
int ask(set <int> &se) {vector <int> m; m.clear(); for (auto it : se) m.PB(it); return use_machine(m);}

ll mlt(ll x, ll y) {return (x * y) % M;}
ll sm(ll x, ll y) {return (x + y) % M;}

vector <int> tr, tl;

int es_minus_3(set <int> &se)
{
    int ans = sz(tr);

    while (sz(se) > 0)
    {
        int i = 0;

        vector <int> m; m.clear();

        if (sz(tr) > sz(tl))
        {
            while (i < sz(tr) && sz(se) > 0)
            {
                m.PB(tr[i++]);

                m.PB(*se.begin());

                se.erase(se.begin());
            }

            int val = ask(m);

            int koler = (sz(m) / 2) - (val / 2);

            if (val % 2) {koler--; tl.PB(m.back());}
              else tr.PB(m.back());

            ans += koler;
        }
        else
        {
            while (i < sz(tl) && sz(se) > 0)
            {
                m.PB(tl[i++]);

                m.PB(*se.begin());

                se.erase(se.begin());
            }

            int val = ask(m);

            int koler = val / 2;

            if (val % 2) {tr.PB(m.back()); koler++;}
              else tl.PB(m.back());

            ans += koler;
        }
    }

    return ans;
}

void dec(set <int> &se) {se.erase(se.begin());}

int count_mushrooms(int n)
{
    tr.PB(0);

    vector <int> m; m.clear();

    m.PB(0);

    set <int> se; se.clear();

    for (int i = 1; i < n; i++) se.insert(i);

    if (n > 300)
    {
        vector <int> m = {0, *se.begin()};

        dec(se);

        if (ask(m) == 0)
        {
            tr.PB(m.back());

            m.resize(4);

            m[0] = 0;

            m[2] = tr[1];

            m[1] = *se.begin();

            dec(se);

            m[3] = *se.begin();

            dec(se);

            int val = ask(m);

            if (val == 0) {tr.PB(m[1]); tr.PB(m[3]);} else
            if (val == 1) {tr.PB(m[1]); tl.PB(m[3]);} else
            if (val == 2) {tr.PB(m[3]); tl.PB(m[1]);} else
            if (val == 3) {tl.PB(m[1]); tl.PB(m[3]);}

            while (max(sz(tl), sz(tr)) < 3)
                {
                    m.resize(4);

                    m[0] = 0;

                    m[2] = tr[1];

                    m[1] = *se.begin();

                    dec(se);

                    m[3] = *se.begin();

                    dec(se);

                    val = ask(m);

                    if (val == 0) {tr.PB(m[1]); tr.PB(m[3]);} else
                    if (val == 1) {tr.PB(m[1]); tl.PB(m[3]);} else
                    if (val == 2) {tr.PB(m[3]); tl.PB(m[1]);} else
                    if (val == 3) {tl.PB(m[1]); tl.PB(m[3]);}
                }
        }
        else
        {
            tl.PB(m[1]);

            m[1] = *se.begin();

            dec(se);

            if (ask(m) != 0)
            {
                tl.PB(m[1]);

                m.clear();

                m.PB(tl[0]);

                m.PB(*se.begin());

                dec(se);

                m.PB(tl[1]);

                m.PB(*se.begin());

                dec(se);

                int val = ask(m);

                if (val == 0) {tl.PB(m[1]); tl.PB(m[3]);}
                if (val == 1) {tl.PB(m[1]); tr.PB(m[3]);}
                if (val == 2) {tl.PB(m[3]); tr.PB(m[1]);}
                if (val == 3) {tr.PB(m[1]); tr.PB(m[3]);}

                while (max(sz(tl), sz(tr)) < 3)
                {
                    m[1] = *se.begin(); dec(se);

                    m[3] = *se.begin(); dec(se);

                    val = ask(m);

                    if (val == 0) {tl.PB(m[1]); tl.PB(m[3]);}
                    if (val == 1) {tl.PB(m[1]); tr.PB(m[3]);}
                    if (val == 2) {tl.PB(m[3]); tr.PB(m[1]);}
                    if (val == 3) {tr.PB(m[1]); tr.PB(m[3]);}
                }
            }
            else
            {
                tr.PB(m.back());

                m.resize(4);

                m[0] = 0;

                m[2] = tr[1];

                m[1] = *se.begin();

                dec(se);

                m[3] = *se.begin();

                dec(se);

                int val = ask(m);

                if (val == 0) {tr.PB(m[1]); tr.PB(m[3]);} else
                if (val == 1) {tr.PB(m[1]); tl.PB(m[3]);} else
                if (val == 2) {tr.PB(m[3]); tl.PB(m[1]);} else
                if (val == 3) {tl.PB(m[1]); tl.PB(m[3]);}

                while (max(sz(tl), sz(tr)) < 3)
                {
                    m.resize(4);

                    m[0] = 0;

                    m[2] = tr[1];

                    m[1] = *se.begin();

                    dec(se);

                    m[3] = *se.begin();

                    dec(se);

                    val = ask(m);

                    if (val == 0) {tr.PB(m[1]); tr.PB(m[3]);} else
                    if (val == 1) {tr.PB(m[1]); tl.PB(m[3]);} else
                    if (val == 2) {tr.PB(m[3]); tl.PB(m[1]);} else
                    if (val == 3) {tl.PB(m[1]); tl.PB(m[3]);}
                }
            }
        }
        while (max(sz(tl), sz(tr)) < skok)
        {
            m.resize(6);

            m[1] = *se.begin(); dec(se);
            m[3] = *se.begin(); dec(se);
            m[5] = *se.begin(); dec(se);

            if (sz(tl) > sz(tr))
            {
                m[0] = tl[0];

                m[2] = tl[1];

                m[4] = tl[2];

                int val = ask(m);

                if (val % 2 == 0) tr.PB(m[5]);
                  else tl.PB(m[5]);

                if (val == 0 || val == 1) {tl.PB(m[1]); tl.PB(m[3]);}

                if ((val == 4 || val == 5)) {tr.PB(m[1]); tr.PB(m[3]);}

                if (val == 2 || val == 3)
                {
                    if (sz(tr) >= 2)
                    {
                        vector <int> p = {tr[0], m[1], tr[1], m[0], m[3], m[2], *se.begin(), m[4], 0}; dec(se);

                        p[8] = *se.begin(); dec(se);

                        int val = ask(p);

                        if (p % 2) tr.PB(p[8]);
                          else tl.PB(p[8]);

                        if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
                        else
                        if (p <= 4) {tr.PB(p[1]); tl.PB(p[3]); tr.PB(p[6]);}
                        else if (p <= 6) {tl.PB(p[1]); tr.PB(p[3]); tl.PB(p[6]);}
                          else {tl.PB(p[1]); tr.PB(p[3]); tr.PB(p[6]);}

                        continue;
                    }

                    vector <int> p; p.resize(4);

                    for (int i = 0; i < 4; i++) p[i] = m[i];

                    val = ask(p);

                    if (val == 0) {tl.PB(m[1]); tl.PB(m[3]);}

                    if (val == 1) {tl.PB(m[1]); tr.PB(m[3]);}

                    if (val == 2) {tr.PB(m[1]); tl.PB(m[3]);}

                    if (val == 3) {tr.PB(m[1]); tr.PB(m[3]);}
                }
            }
            else
            {
                m[0] = tr[0];

                m[2] = tr[1];

                m[4] = tr[2];

                int val = ask(m);

                if (val % 2) tl.PB(m[5]);
                  else tr.PB(m[5]);

                if (val == 0 || val == 1) {tr.PB(m[1]); tr.PB(m[3]);}

                if ((val == 4 || val == 5)) {tl.PB(m[1]); tl.PB(m[3]);}

                if (val == 2 || val == 3)
                {
                    if (sz(tl) >= 2)
                    {
                        vector <int> p = {tl[0], m[1], tl[1], m[0], m[3], m[2], *se.begin(), m[4], 0}; dec(se);

                        p[8] = *se.begin(); dec(se);

                        int val = ask(p);

                        if (p % 2) tl.PB(p[8]);
                          else tr.PB(p[8]);

                        if (p <= 2) {tl.PB(p[1]); tr.PB(p[3]); tr.PB(p[6]);}
                        else
                        if (p <= 4) {tl.PB(p[1]); tr.PB(p[3]); tl.PB(p[6]);}
                        else if (p <= 6) {tr.PB(p[1]); tl.PB(p[3]); tr.PB(p[6]);}
                          else {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}

                        continue;
                    }

                    vector <int> p; p.resize(4);

                    for (int i = 0; i < 4; i++) p[i] = m[i];

                    val = ask(p);

                    if (val == 0) {tr.PB(m[1]); tr.PB(m[3]);}

                    if (val == 1) {tr.PB(m[1]); tl.PB(m[3]);}

                    if (val == 2) {tl.PB(m[1]); tr.PB(m[3]);}

                    if (val == 3) {tl.PB(m[1]); tl.PB(m[3]);}
                }
            }
        }
    }
    return es_minus_3(se);
}

//int main()
//{
//    iostream::sync_with_stdio(0); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//
//    freopen("1.in", "r", stdin); //freopen("fcolor.out", "w", stdout);
//
//    int n;
//
//    cin >> n;
//
//    int num = 0;
//
//    for (int i = 0; i < n; i++) {cin >> val[i]; if (val[i] == 0) num++;}
//
//    cout << num << endl;
//    cout << count_mushrooms(n) << endl;
//
//    cout << kol << " " << sum << endl;
//}

Compilation message

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:316:31: error: no match for 'operator%' (operand types are 'std::vector<int>' and 'int')
  316 |                         if (p % 2) tr.PB(p[8]);
      |                             ~ ^ ~
      |                             |   |
      |                             |   int
      |                             std::vector<int>
In file included from /usr/include/c++/9/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   'std::vector<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/c++/9/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   'std::vector<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/c++/9/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/c++/9/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   'std::vector<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/c++/9/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)'
  409 |     _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/valarray_after.h:409:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/valarray:1189:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const std::valarray<_Tp>&, const std::valarray<_Tp>&)'
 1189 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/valarray:1189:1: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   'std::vector<int>' is not derived from 'const std::valarray<_Tp>'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/valarray:1189:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const std::valarray<_Tp>&, const typename std::valarray<_Tp>::value_type&)'
 1189 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/valarray:1189:1: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   'std::vector<int>' is not derived from 'const std::valarray<_Tp>'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
                 from mushrooms.cpp:1:
/usr/include/c++/9/valarray:1189:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename std::valarray<_Tp>::value_type&, const std::valarray<_Tp>&)'
 1189 | _DEFINE_BINARY_OPERATOR(%, __modulus)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/valarray:1189:1: note:   template argument deduction/substitution failed:
mushrooms.cpp:316:33: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
  316 |                         if (p % 2) tr.PB(p[8]);
      |                                 ^
mushrooms.cpp:319:31: error: no match for 'operator<=' (operand types are 'std::vector<int>' and 'int')
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                             ~ ^~ ~
      |                             |    |
      |                             |    int
      |                             std::vector<int>
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1059:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<=(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&)'
 1059 |     operator<=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1059:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1160:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<=(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&)'
 1160 |     operator<=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1160:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1234:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<=(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1234 |     operator<=(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1234:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1308:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&)'
 1308 |     operator<=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1308:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1382:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1382 |     operator<=(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1382:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1460:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&)'
 1460 |     operator<=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1460:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/regex.h:1538:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1538 |     operator<=(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/9/bits/regex.h:1538:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/stl_pair.h:473:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)'
  473 |     operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_pair.h:473:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::pair<_T1, _T2>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h:349:5: note: candidate: 'template<class _Iterator> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)'
  349 |     operator<=(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:349:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h:387:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
  387 |     operator<=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:387:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h:1175:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
 1175 |     operator<=(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:1175:5: note:   template argument deduction/substitution failed:
mushrooms.cpp:319:34: note:   'std::vector<int>' is not derived from 'const std::move_iterator<_IteratorL>'
  319 |                         if (p <= 2) {tr.PB(p[1]); tl.PB(p[3]); tl.PB(p[6]);}
      |                                  ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from mushrooms.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h:1181:5: note: candidate: 'template<class _Iterator> bool std::operator<=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_Iterato