# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
706646 | Baytoro | Semiexpress (JOI17_semiexpress) | C++17 | 38 ms | 33260 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr first
#define sc second
#define endl '\n'
#define ll long long
#define int long long
void fopn(string name){
freopen((name+".in").c_str(),"r",stdin);
freopen((name+".out").c_str(),"w",stdout);
}
const ll INF=1e18,mod=998244353,N=2e5+5;
int s[N],ans=0;
priority_queue<int> pq;
void solve(){
int n,m,k,a,b,c,t;
cin>>n>>m>>k>>a>>b>>c>>t;
for(int i=0;i<m;i++) cin>>s[i];
if((n-1)*b<=t) ans++;
for(int i=0;i<m-1;i++){
int x=(s[i]-1)*b;
if(x>t) break;
int y=(t-x)/a;
int range=min(s[i+1]-1,s[i]+y);
ans+=(range-s[i]+1);
if(i==0) ans--;
for(int j=0;j<k && range<s[i+1]-1;j++){
int tmp=x+(range-s[i]+1)*c;
if(tmp>t) break;
int q=(t-tmp)/a;
int r=min(s[i+1]-1,range+1+q);
pq.push(r-range);
range=r;
}
}
for(int i=m;i<k && !pq.empty();i++){
ans+=pq.top();
pq.pop();
}
cout<<ans;
}
main(){
//fopn("cbarn");
ios;
int T=1;
//cin>>T;
while(T--){
solve();
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |