Submission #1307799

#TimeUsernameProblemLanguageResultExecution timeMemory
1307799exoworldgdSouvenirs (IOI25_souvenirs)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("Ofast,unroll-loops,inline,fast-math,omit-frame-pointer") #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt,tune=native,fma") #include <bits/stdc++.h> #include "souvenirs.h" #define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0) using namespace std; using ll=long long; const int N=1e5+5; int n,cnt[N]; ll cost[N]; void rec(int idx,ll budget){ if(idx>=n||cost[idx]^-1)return; auto res=transaction(budget-1); if(res.first.empty())return; int cur=res.first.front(); for(auto e:res.first)cnt[e]++; if(res.first.size()>1){ ll rem=budget-1-res.second,per=rem/res.first.size()+1; for(int i=res.first.size()-1;i>0;i--)(~cost[res.first[i]]?0:(rec(res.first[i],per),0)),res.second+=cost[res.first[i]]; } cost[cur]=budget-1-res.second,rec(cur+1,cost[cur]); } void buy_souvenirs(int N,ll P){ n=N; for(int i=0;i<n;i++)cost[i]=-1,cnt[i]=0; cost[0]=P,rec(1,P); for(int i=0;i<n;i++)while(cnt[i]<i)cnt[i]++,transaction(cost[i]); }

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 souvenirs.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
      |              ^~~~~~~~~~~~