답안 #530491

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
530491 2022-02-25T14:44:02 Z fadi57 Semiexpress (JOI17_semiexpress) C++14
0 / 100
0 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);

          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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -