# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
651817 | lunchbox | Semiexpress (JOI17_semiexpress) | C++17 | 0 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
author: lunchbox
problem link: https://oj.uz/problem/view/JOI17_semiexpress
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n, m, k; cin >> n >> m >> k;
LL a, b, c; cin >> a >> b >> c;
long long t; cin >> t;
vector<LL> s(m), p(m - 1); for (LL& x : s) cin >> x;
priority_queue<pair<LL, int>> pq;
LL ans = 0;
for (int i = 0; i < m - 1; i++) {
if (b * (s[i] - 1) > t) {
cout << "?\n";
continue;
}
LL u = min(s[i + 1] - 1, s[i] + (t - b * (s[i] - 1)) / a);
ans += u - s[i] + 1;
p[i] = u + 1;
if (p[i] < s[i + 1] && b * (s[i] - 1) + c * (p[i] - s[i]) <= t) {
LL v = min(s[i + 1] - 1, p[i] + (t - b * (s[i] - 1) - c * (p[i] - s[i])) / a);
pq.push({v - p[i] + 1, i});
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |