# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
158104 | ZwariowanyMarcin | Semiexpress (JOI17_semiexpress) | C++14 | 550 ms | 67028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define mp make_pair
#define pb push_back
#define ld long double
#define ss(x) (int) x.size()
#define FOR(i, j, n) for(int i = j; i <= n; ++i)
#define fi first
#define se second
#define cat(x) cerr << #x << " = " << x << endl;
#define ios cin.tie(0); ios_base::sync_with_stdio(0)
using namespace std;
int n, m, k;
int a, b, c;
ll T;
int s[3005];
ll ans = 0;
multiset <ll> secik;
int main() {
scanf("%d %d %d", &n, &m, &k);
k = k - m;
scanf("%d %d %d", &a, &b, &c);
scanf("%lld", &T);
FOR(i, 1, m)
scanf("%d", &s[i]);
FOR(i, 1, m) {
ll cash = (ll) (s[i] - 1) * b;
if(cash <= T && i > 1)
ans += 1;
if(i == m)
break;
ll ile = s[i + 1] - s[i] - 1;
ll happy = min(ile, max(1LL * 0, (T - cash) / a));
ile -= happy;
ans += happy;
ll people = happy;
FOR(j, 1, k) {
ll all = cash + (people + 1) * c;
happy = min(ile, max(1LL * 0, (T - all) / a + (all <= T)));
//cout << i << " " << j << " " << happy << " " << ile << " " << people << endl;
secik.insert(happy);
ile -= happy;
people += happy;
}
}
//cout << ans << endl;
while(k--) {
ll e = *(--secik.end());
ans += e;
secik.erase(--secik.end());
}
printf("%lld\n", ans);
return 0;
}
컴파일 시 표준 에러 (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... |