Submission #1264996

#TimeUsernameProblemLanguageResultExecution timeMemory
1264996imarnFestival (IOI25_festival)C++20
Compilation error
0 ms0 KiB
#include "festival.h" #include<bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC target("avx2") #define ll long long #define ld long double #define pii pair<int,int> #define pll pair<ll,ll> #define plx pair<ll,int> #define f first #define s second #define pb push_back #define all(x) x.begin(),x.end() #define vi vector<int> #define vvi vector<vi> #define ub(x,i) upper_bound(all(x),i)-x.begin() #define lb(x,i) lower_bound(all(x),i)-x.begin() #define sz(x) (ll)x.size() #define cd complex<double> #define t3 tuple<ll,ll,ll> using namespace std; const int mxn=2e5+5; int n; std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) { priority_queue<pair<pair<double,pll>,pll>,vector<pair<double,pll>>,greater<pair<double,pll>>>qr; n=P.size();priority_queue<pll,vector<pll>,greater<pll>>ql; for(int i=0;i<n;i++)ql.push({P[i],i}); while(!ql.empty()&&ql.top().f<=A){ auto [p,t]=ql.top();ql.pop(); if(T[t]==1)qr.push({1e18,{p,t}}); else qr.push({p*T[t]/(T[t]-1),{p,t}}); }ll cur=A; vector<int>ans; while(!qr.empty()){ auto [p,t]=qr.top().s;qr.pop(); if(cur<p)continue; ans.pb(t);cur=(cur-p)*T[t]; while(!ql.empty()&&ql.top().f<=cur){ auto [pp,tt]=ql.top();ql.pop(); if(T[tt]==1)qr.push({1e18,{pp,tt}}); else qr.push({pp*T[tt]/(T[tt]-1),{pp,tt}}); } } return ans; } /*int main(){ vector<int> x=max_coupons(13, {4, 500, 8, 14},{1, 3, 3, 4}); for(auto it : x)cout<<it<<" "; }*/

Compilation message (stderr)

In file included from /usr/include/c++/11/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:86,
                 from festival.cpp:2:
/usr/include/c++/11/bits/stl_queue.h: In instantiation of 'class std::priority_queue<std::pair<std::pair<double, std::pair<long long int, long long int> >, std::pair<long long int, long long int> >, std::vector<std::pair<double, std::pair<long long int, long long int> > >, std::greater<std::pair<double, std::pair<long long int, long long int> > > >':
festival.cpp:25:98:   required from here
/usr/include/c++/11/bits/stl_queue.h:480:67: error: static assertion failed: value_type must be the same as the underlying container
  480 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/11/bits/stl_queue.h:480:67: note: 'std::integral_constant<bool, false>::value' evaluates to false