Submission #1310080

#TimeUsernameProblemLanguageResultExecution timeMemory
1310080bluecatBank (IZhO14_bank)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include "bits/stdc++.h"
using namespace std;
using ll   = long long;
using ld   = long double;
using ui   = unsigned int;
using ul   = unsigned long long;
using i128 = __int128;
using pii  = pair<int, int>;
using pll  = pair<ll, ll>;
using t3i  = tuple<int, int, int>;
using t3l  = tuple<ll, ll, ll>;
using vi   = vector<int>;
using vl   = vector<long long>;
using arr  = array<int, 4>;
using node = pair<int, arr>;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, q; cin >> n >> q;
    vector<int> a(n), b(q);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < q; i++) cin >> b[i];
    vector<int> d(1<<q,-1), p(1<<q);
    d[0] = 0;
    for (int m = 0; m < (1<<q); m++)
        for (int i = 0; i < q; i++) if ((m>>i)&1 && d[m^(1<<i)]!=-1)
        {
            if (p[m^(1<<i)]+b[i]==a[d[m^(1<<i)]]) d[m] = d[m^(1<<i)]+1, p[m] = 0;
            else if (p[m^(1<<i)]+b[i]<a[d[m^(1<<i)]]) d[m] = d[m^(1<<i)], p[m] = p[m^(1<<i)]+b[i];
        }
    int res = 0;
    for (int m = 0; m < (1<<q); m++) res |= d[m]==n;
    cout << (res?"YES\n":"NO\n");
}

Compilation message (stderr)

In file included from /usr/include/c++/13/string:43,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from bank.cpp:3:
/usr/include/c++/13/bits/allocator.h: In destructor 'constexpr std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to 'always_inline' 'constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = int]': target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
  133 |       struct _Vector_impl
      |              ^~~~~~~~~~~~