답안 #428072

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
428072 2021-06-15T07:52:10 Z 반딧불(#7617) Posters on the wall (CPSPC17_posters) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

vector<ll> xVec, yVec;

struct xNode {
    struct yNode {
        ll globalSum, globalLazy;
        ll totalSum, totalLazy;
        yNode *lchild, *rchild;

        yNode(){
            globalSum = globalLazy = totalSum = totalLazy = 0;
            lchild = rchild = nullptr;
        }

        ~yNode(){
            if(lchild) delete lchild;
            if(rchild) delete rchild;
        }

        void update(int l, int r, int s, int e, ll bonus, ll len, bool same){
            if(l==s && r==e){
                if(same){
                    globalSum += 1 * (yVec[e] - yVec[s]);
                    globalLazy += 1;
                }
                totalSum += len * (yVec[e] - yVec[s]);
                totalLazy += len;
                return;
            }
            int m = (l+r)/2;
            if(s<m){
                if(!lchild) lchild = new yNode();
                lchild->update(l, m, s, min(m, e), bonus, len, same);
            }
            if(m<e){
                if(!rchild) rchild = new yNode();
                rchild->update(m, r, max(s, m), e, bonus, len, same);
            }
            if(same){
                globalSum = (lchild ? lchild->globalSum : 0) + (rchild ? rchild->globalSum : 0) + globalLazy * (yVec[r] - yVec[l]);
            }
            totalSum = (lchild ? lchild->totalSum : 0) + (rchild ? rchild->totalSum : 0) + totalLazy * (yVec[r] - yVec[l]);
        }
    };
    yNode *tree;
    xNode *lchild, *rchild;

    xNode(){
        tree = nullptr;
        lchild = rchild = nullptr;
    }

    ~xNode(){
        if(tree) delete tree;
        if(lchild) delete lchild;
        if(rchild) delete rchild;
    }

    void update(int xl, int xr, int yl, int yr, int xs, int xe, int ys, int ye){
        ll len = xVec[xe] - xVec[xs];
        if(xl != xs || xr != xe){
            int m = (xl+xr)/2;
            if(xs < m){
                if(!lchild) lchild = new xNode();
                lchild->update(xl, m, yl, yr, xs, min(m, xe), ys, ye);
            }
            if(m < xe){
                if(!rchild) rchild = new xNode();
                rchild->update(m, xr, yl, yr, max(xs, m), xe, ys, ye);
            }
        }
        if(!tree) tree = new yNode();
        tree->update(yl, yr, ys, ye, xVec[xr] - xVec[xl], len, xl==xs && xr==xe);
    }
} *tree;

ll query(xNode::yNode *i, int l, int r, int s, int e, ll lazySum, ll len, bool same){
    ll ret = 0;
    if(l==s && r==e){
        if(same){
            if(i) ret += i->totalSum;
            ret += lazySum * (yVec[r] - yVec[l]);
        }
        else{
            if(i) ret += i->globalSum * len;
            ret += lazySum * len * (yVec[r] - yVec[l]);
        }
        return ret;
    }
    lazySum = !i ? lazySum : (lazySum + (same ? i->totalLazy : i->globalLazy));
    int m = (l+r)/2;
    if(s<m) ret += query(i ? i->lchild : nullptr, l, m, s, min(m, e), lazySum, len, same);
    if(m<e) ret += query(i ? i->rchild : nullptr, m, r, max(s, m), e, lazySum, len, same);
    return ret;
}

ll query(xNode *i, int xl, int xr, int yl, int yr, int xs, int xe, int ys, int ye){
    ll len = xVec[xe] - xVec[xs];
    ll ret = query(i->tree, yl, yr, ys, ye, 0, len, xl==xs && xr==xe);
    if(xl!=xs || xr!=xe){
        int m = (xl+xr)/2;
        if(xs<m && i->lchild) ret += query(i->lchild, xl, m, yl, yr, xs, min(m, xe), ys, ye);
        if(m<xe && i->rchild) ret += query(i->rchild, m, xr, yl, yr, max(xs, m), xe, ys, ye);
    }
    return ret;
}

int r, c, n, q, m, N, M;
ll x1[50002], y1[50002], x2[50002], y2[50002];

ll query(int xs, int xe, int ys, int ye){
    return query(tree, 0, N-1, 0, M-1, xs, xe, ys, ye);
}

int main(){
    scanf("%d %d %d %d %d", &r, &c, &n, &q, &m);
    xVec.push_back(0), xVec.push_back(r);
    yVec.push_back(0), yVec.push_back(c);
    for(int i=1; i<=n; i++){
        scanf("%lld %lld %lld %lld", &x1[i], &y1[i], &x2[i], &y2[i]);
        if(x1[i] > x2[i]) swap(x1[i], x2[i]);
        if(y1[i] > y2[i]) swap(y1[i], y2[i]);
        xVec.push_back(x1[i]), xVec.push_back(x2[i]);
        yVec.push_back(y1[i]), yVec.push_back(y2[i]);
    }
    sort(xVec.begin(), xVec.end());
    xVec.erase(unique(xVec.begin(), xVec.end()), xVec.end());
    sort(yVec.begin(), yVec.end());
    yVec.erase(unique(yVec.begin(), yVec.end()), yVec.end());
    N = (int)xVec.size(), M = (int)yVec.size();

    tree = new xNode();
    for(int i=1; i<=n; i++){
        x1[i] = lower_bound(xVec.begin(), xVec.end(), x1[i]) - xVec.begin();
        x2[i] = lower_bound(xVec.begin(), xVec.end(), x2[i]) - xVec.begin();
        y1[i] = lower_bound(yVec.begin(), yVec.end(), y1[i]) - yVec.begin();
        y2[i] = lower_bound(yVec.begin(), yVec.end(), y2[i]) - yVec.begin();
        tree->update(0, N-1, 0, M-1, x1[i], x2[i], y1[i], y2[i]);
    }

    ll ans = 0;
    for(int i=1; i<=q; i++){
        ll qx1, qy1, qx2, qy2, v;
        scanf("%lld %lld %lld %lld %lld", &qx1, &qy1, &qx2, &qy2, &v);
        ans %= m, v %= m;
        qx1 = (qx1 + ans * v) % m;
        qx2 = (qx2 + ans * v) % m;
        qy1 = (qy1 + ans * v) % m;
        qy2 = (qy2 + ans * v) % m;
        if(qx1 > qx2) swap(qx1, qx2);
        if(qy1 > qy2) swap(qy1, qy2);

        int xl = upper_bound(xVec.begin(), xVec.end(), qx1) - xVec.begin() - 1;
        int xr = lower_bound(xVec.begin(), xVec.end(), qx2) - xVec.begin();
        int yl = upper_bound(yVec.begin(), yVec.end(), qy1) - yVec.begin() - 1;
        int yr = lower_bound(yVec.begin(), yVec.end(), qy2) - yVec.begin();

        bool xSingle = (xr-xl == 1);
        bool ySingle = (yr-yl == 1);

        ans = 0;
        if(xSingle && ySingle){
            ans = !!query(xl, xr, yl, yr) * (qx2 - qx1) * (qy2 - qy1);
        }
        else if(xSingle){
            ans = query(xl, xr, yl+1, yr-1) / (xVec[xr] - xVec[xl]) * (qx2 - qx1);
            ans += !!query(xl, xr, yl, yl+1) * (qx2 - qx1) * (yVec[yl+1] - qy1);
            ans += !!query(xl, xr, yr-1, yr) * (qx2 - qx1) * (qy2 - yVec[yr-1]);
        }
        else if(ySingle){
            ans = query(xl+1, xr-1, yl, yr) / (yVec[yr] - yVec[yl]) * (qy2 - qy1);
            ans += !!query(xl, xl+1, yl, yr) * (qy2 - qy1) * (xVec[xl+1] - qx1);
            ans += !!query(xr-1, xr, yl, yr) * (qy2 - qy1) * (qx2 - xVec[xr-1]);
        }
        else{
            ans += query(xl+1, xr-1, yl+1, yr-1); /// Center

            ans += query(xl+1, xr-1, yl, yl+1) / (yVec[yl+1] - yVec[yl]) * (yVec[yl+1] - qy1); /// Left
            ans += query(xl+1, xr-1, yr-1, yr) / (yVec[yr] - yVec[yr-1]) * (qy2 - yVec[yr-1]); /// Right
            ans += query(xl, xl+1, yl+1, yr-1) / (xVec[xl+1] - xVec[xl]) * (xVec[xl+1] - qx1); /// Down
            ans += query(xr-1, xr, yl+1, yr-1) / (xVec[xr] - xVec[xr-1]) * (qx2 - xVec[xr-1]); /// Up

            ans += !!query(xl, xl+1, yl, yl+1) * (xVec[xl+1] - qx1) * (yVec[yl+1] - qy1);
            ans += !!query(xl, xl+1, yr-1, yr) * (xVec[xl+1] - qx1) * (qy2 - yVec[yr-1]);
            ans += !!query(xr-1, xr, yl, yl+1) * (qx2 - xVec[xr-1]) * (yVec[yl+1] - qy1);
            ans += !!query(xr-1, xr, yr-1, yr) * (qx2 - xVec[xr-1]) * (qy2 - yVec[yr-1]);
        }

        printf("%lld\n", ans);
    }

    delete tree;
}

Compilation message

Main.cpp:114:23: error: 'll y1 [50002]' redeclared as different kind of entity
  114 | ll x1[50002], y1[50002], x2[50002], y2[50002];
      |                       ^
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
                 from /usr/include/c++/10/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from Main.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:221:1: note: previous declaration 'double y1(double)'
  221 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:125:51: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  125 |         scanf("%lld %lld %lld %lld", &x1[i], &y1[i], &x2[i], &y2[i]);
      |                                                   ^
Main.cpp:125:24: warning: format '%lld' expects argument of type 'long long int*', but argument 3 has type 'double (*)(double) noexcept' [-Wformat=]
  125 |         scanf("%lld %lld %lld %lld", &x1[i], &y1[i], &x2[i], &y2[i]);
      |                     ~~~^                     ~~~~~~
      |                        |                     |
      |                        long long int*        double (*)(double) noexcept
Main.cpp:127:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                ^
Main.cpp:127:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |            ~~~~~~^~~~~~~
Main.cpp:127:36: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                    ^
Main.cpp:127:44: error: no matching function for call to 'swap(double (&)(double) noexcept, ll&)'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from Main.cpp:1:
/usr/include/c++/10/sstream:849:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>&)'
  849 |     swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/10/sstream:849:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from Main.cpp:1:
/usr/include/c++/10/sstream:856:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(std::__cxx11::basic_istringstream<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_istringstream<_CharT, _Traits, _Allocator>&)'
  856 |     swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/10/sstream:856:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::basic_istringstream<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from Main.cpp:1:
/usr/include/c++/10/sstream:863:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(std::__cxx11::basic_ostringstream<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_ostringstream<_CharT, _Traits, _Allocator>&)'
  863 |     swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/10/sstream:863:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::basic_ostringstream<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from Main.cpp:1:
/usr/include/c++/10/sstream:870:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(std::__cxx11::basic_stringstream<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_stringstream<_CharT, _Traits, _Allocator>&)'
  870 |     swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/10/sstream:870:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110,
                 from Main.cpp:1:
/usr/include/c++/10/bits/regex.h:849:5: note: candidate: 'template<class _Ch_type, class _Rx_traits> void std::__cxx11::swap(std::__cxx11::basic_regex<_Ch_type, _Rx_traits>&, std::__cxx11::basic_regex<_Ch_type, _Rx_traits>&)'
  849 |     swap(basic_regex<_Ch_type, _Rx_traits>& __lhs,
      |     ^~~~
/usr/include/c++/10/bits/regex.h:849:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::basic_regex<_Ch_type, _Rx_traits>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/regex:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110,
                 from Main.cpp:1:
/usr/include/c++/10/bits/regex.h:2141:5: note: candidate: 'template<class _Bi_iter, class _Alloc> void std::__cxx11::swap(std::__cxx11::match_results<_BiIter, _Alloc>&, std::__cxx11::match_results<_BiIter, _Alloc>&)'
 2141 |     swap(match_results<_Bi_iter, _Alloc>& __lhs,
      |     ^~~~
/usr/include/c++/10/bits/regex.h:2141:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::match_results<_BiIter, _Alloc>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included 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 Main.cpp:1:
/usr/include/c++/10/bits/move.h:189:5: note: candidate: 'template<class _Tp> std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)'
  189 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/10/bits/move.h:189:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   deduced conflicting types for parameter '_Tp' ('double(double) noexcept' and 'll' {aka 'long long int'})
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included 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 Main.cpp:1:
/usr/include/c++/10/bits/move.h:213:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
  213 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~
/usr/include/c++/10/bits/move.h:213:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types '_Tp [_Nm]' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
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 Main.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:533:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)'
  533 |     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |     ^~~~
/usr/include/c++/10/bits/stl_pair.h:533:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
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 Main.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:541:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<(! std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)' (deleted)
  541 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
/usr/include/c++/10/bits/stl_pair.h:541:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/string:55,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from Main.cpp:1:
/usr/include/c++/10/bits/basic_string.h:6420:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> void std::swap(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 6420 |     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~
/usr/include/c++/10/bits/basic_string.h:6420:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/tuple:39,
                 from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/array:321:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> typename std::enable_if<typename std::__array_traits<_Tp, _Nm>::_Is_swappable::value>::type std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&)'
  321 |     swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
      |     ^~~~
/usr/include/c++/10/array:321:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::array<_Tp, _Nm>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/tuple:39,
                 from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/array:329:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> typename std::enable_if<(! typename std::__array_traits<_Tp, _Nm>::_Is_swappable::value)>::type std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&)' (deleted)
  329 |     swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete;
      |     ^~~~
/usr/include/c++/10/array:329:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::array<_Tp, _Nm>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/tuple:1629:5: note: candidate: 'template<class ... _Elements> typename std::enable_if<std::__and_<std::__is_swappable<_Elements>...>::value>::type std::swap(std::tuple<_Tps ...>&, std::tuple<_Tps ...>&)'
 1629 |     swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
      |     ^~~~
/usr/include/c++/10/tuple:1629:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::tuple<_Tps ...>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/functional:54,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/tuple:1637:5: note: candidate: 'template<class ... _Elements> typename std::enable_if<(! std::__and_<std::__is_swappable<_Elements>...>::value)>::type std::swap(std::tuple<_Tps ...>&, std::tuple<_Tps ...>&)' (deleted)
 1637 |     swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
      |     ^~~~
/usr/include/c++/10/tuple:1637:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::tuple<_Tps ...>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/functional:59,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/std_function.h:720:5: note: candidate: 'template<class _Res, class ... _Args> void std::swap(std::function<_Res(_ArgTypes ...)>&, std::function<_Res(_ArgTypes ...)>&)'
  720 |     swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) noexcept
      |     ^~~~
/usr/include/c++/10/bits/std_function.h:720:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::function<_Res(_ArgTypes ...)>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/bits/node_handle.h:39,
                 from /usr/include/c++/10/bits/hashtable.h:37,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/optional:1196:5: note: candidate: 'template<class _Tp> std::enable_if_t<(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>)> std::swap(std::optional<_Tp>&, std::optional<_Tp>&)'
 1196 |     swap(optional<_Tp>& __lhs, optional<_Tp>& __rhs)
      |     ^~~~
/usr/include/c++/10/optional:1196:5: note:   template argument deduction/substitution failed:
Main.cpp:127:44: note:   mismatched types 'std::optional<_Tp>' and 'double(double) noexcept'
  127 |         if(y1[i] > y2[i]) swap(y1[i], y2[i]);
      |                                            ^
In file included from /usr/include/c++/10/bits/node_handle.h:39,
                 from /usr/include/c++/10/bits/hashtable.h:37,
                 from /usr/include/c++/10/unordered_map:46,
                 from /usr/include/c++/10/functional:61,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/optional:1202:5: note: candidate: 'template<class _Tp> std::enable_if_t<(!(is_move_constructible_v<_Tp> && is_swap