Submission #530491

#TimeUsernameProblemLanguageResultExecution timeMemory
530491fadi57Semiexpress (JOI17_semiexpress)C++14
0 / 100
0 ms204 KiB
#include<bits/stdc++.h> using namespace std; const int mx=100006; const int mx2=2e5+9; typedef long long ll; const int mod=998244353 ; const long long inf=1e8+10; ll n,m,k;ll s[mx]; int main(){ cin>>n>>m>>k; ll a,b,c;cin>>a>>b>>c; ll t;cin>>t; for(int i=0;i<m;i++){ cin>>s[i]; } priority_queue<ll>q; ll ans=0; for(int i=0;i<m-1;i++){ ll tim=(s[i]-1)*b; ll steps=(t-tim)/a; ll range=min(s[i]+steps,s[i+1]-1); ans+=(range-s[i]+1); cout<<range<<endl; range++; for(int j=1;j<=k;j++){ ll tim2=tim+(range-s[i])*c; if(tim2>t){break;} ll steps2=(t-tim2)/(a); ll range2=min(range+steps2,s[i+1]-1); q.push(range2-range+1); range=range2+1; } } for(int i=0;i<k-m;i++){ if(!q.empty()){ ans+=q.top(); q.pop(); } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...