Submission #245642

# Submission time Handle Problem Language Result Execution time Memory
245642 2020-07-07T03:02:00 Z HachiMinh Semiexpress (JOI17_semiexpress) C++17
0 / 100
5 ms 384 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,m,k,a,b,c,t,station[3007],ans;
vector<ll> HMS;
int main()
{
	cin>>n>>m>>k>>a>>b>>c>>t;
	for(ll i=0;i<m;i++)
	{
		cin>>station[i];
		station[i]--;
	}
	k-=m;
	station[m]=n;
	for(ll i=1;i<=m;i++)
	{
		ll time=t-station[i-1]*b;
		ll mid=station[i]-station[i-1];
		if(time<0) break;
		ll mxst=min(mid,time/a+1);
		ans+=mxst;
//		cout<<ans<<endl;
		mid-=mxst;
		time-=c*mxst;
		ll k1=k;
		while(k1--&&mid&&time>=0)
		{
			ll mxst=min(mid,time/a+1);
			HMS.push_back(mxst);
			mid-=mxst;
			time-=mxst*c;
		}
	}
	sort(HMS.begin(),HMS.end());
//	cout<<ans<<" "<<HMS.size()<<endl;
	for(ll i=1;i<=k&&HMS.size()-i>=0;i++)
	{
		ans+=HMS[HMS.size()-i];
//		cout<<ans<<endl;
	}
	cout<<ans-1;
}
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -