답안 #530504

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
530504 2022-02-25T15:25:40 Z fadi57 Semiexpress (JOI17_semiexpress) C++14
0 / 100
1 ms 204 KB
#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);
         if(tim>t){break;}
          ans+=(range-s[i]+1);
      //  cout<<range<<endl;
        range++;
        for(int j=1;j<=k&&range<s[i+1]-1;j++){

           ll tim2=tim+(range-s[i])*c;

           if(tim2>t){break;}

           ll steps2=(t-tim2)/(a);

           ll range2=min(range+steps2+1,s[i+1]-1);
            q.push(range2-range);
           // cout<<range2<<" ";
           // range=range2+1;

        }
     //cout<<endl;

       }
 for(int i=0;i<k-m;i++){

    if(!q.empty()){
        ans+=q.top();
        q.pop();
    }
 }

cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -