Submission #1297046

#TimeUsernameProblemLanguageResultExecution timeMemory
1297046exoworldgdKitchen (BOI19_kitchen)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("O5,unroll-loops,inline,fast-math") #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt") #include<bits/stdc++.h> #define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0) #define int long long using namespace std; const int N=305,M=305,K=305,MX=90005; int n,m,k,a[N],b[M],sum=0,mn=MX; bitset<MX> dp[K]; signed main(void) { exoworldgd; cin >> n >> m >> k; for (int i = 0; i < n; i++){ cin >> a[i]; if (a[i]<k) return cout<<"Impossible",0; sum += a[i]; } for (int i =0; i< m; i++) cin >> b[i]; sort(b,b+m), dp[0][0]=1; for (int i=0; i<m; i++) for (int j = min(m,k); j >= 1; j--) dp[j]|=(dp[j-1]<<b[i]); for (int i=k; i <=m; i++){ for (int j =sum; j <MX; j++){ if (!dp[min(i,k)][j]) continue; if (j >=sum){ int cap=0; for (int l=m-1; l>= m-i &&l >=0; l--) cap+=b[l]; if (cap >= j)mn = min(mn,cap-sum); } } } cout << (mn==MX ? "Impossible":to_string(mn)); }

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 kitchen.cpp:3:
/usr/include/c++/13/bits/allocator.h: In destructor 'constexpr std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/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 = char]': target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/string:54:
/usr/include/c++/13/bits/basic_string.h:181:14: note: called from here
  181 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~