#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define fastio ios_base::sync_with_stdio(false)
#define endl "\n"
const ll lmt=3e3;
ll n,m,k,a,b,c,t,s[lmt],ans;
int main(){
fastio;
cin>>n>>m>>k>>a>>b>>c>>t;
for(int i=1;i<=m;i++){
cin>>s[i];
}
vector<ll>big;
k-=m;
for(int i=1;i<=m;i++){
if(i==m && ((n-1)*b)<=t){
ans++;
continue;
}
ll last=(s[i]-1)*b;
if(last>t) continue;
ll seat=(t-last)/a;
ll seg=min(s[i+1]-1,s[i]+seat);
ans+=(seg-s[i]+1);
if(i==1) ans--;
seg++;
for(int j=1;j<=k && seg<s[i+1];j++){
ll tme=last+(seg-s[i])*c;
if(tme>t) break;
ll seat2=(t-tme)/a;
ll seg2=min(s[i+1]-1,seg+seat2);
seg2++;
big.push_back(seg2-seg);
seg=seg2;
}
}
sort(big.begin(),big.end());
for(int i=0;i<min(k,(ll)big.size());i++){
ans+=big[i];
}
cout<<ans<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
12 |
Correct |
1 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
364 KB |
Output is correct |
14 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
12 |
Correct |
1 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
364 KB |
Output is correct |
14 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |