正文
增加 10 行删除 10 行
26 行未改动2728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717226 行未改动int work(int i, int x, int t) {// 在 s[i]->s[i+1] 中// 在 x 处下车了// 用 t 个时间,最远能走几步return min(t / A, a[i + 1] - 1 - x);}signed main() {cin >> n >> n >> k >> A >> B >> C >> t;k -= n;for (int i = 1; i <= n; ++ i ) cin >> a[i];priority_queue<tuple<int, int, int, int>> q;for (int i = 1; i < n; ++ i )if ((a[i] - 1) * B <= t) {int nxt = work(i, a[i], t - (a[i] - 1) * B);int to = work(i, a[i] + nxt + 1, t - (a[i] - 1) * B - (nxt + 1) * C);q.emplace(to, i, a[i] + nxt + 1, (a[i] - 1) * B + (nxt + 1) * C);res += nxt + 1;}while (q.size()) {auto top = q.top();q.pop();int to = get<0>(top);int i = get<1>(top);int pos = get<2>(top);int dis = get<3>(top);if (dis > t) continue;res += to + 1;k -- ;if (!k) break;q.emplace(work(i, pos + to + 1, t - dis - (to + 1) * C), i, pos + to + 1, dis + (to + 1) * C);}cout << res + ((a[n] - 1) * B <= t) - 1;return 0;}```26 行未改动2728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717226 行未改动int work(int i, int x, int t) {// 在 s[i]->s[i+1] 中// 在 x 处下车了// 用 t 个时间,最远能走几步return min(t / A, a[i + 1] - 1 - x);}signed main() {cin >> n >> n >> k >> A >> B >> C >> t;k -= n;for (int i = 1; i <= n; ++ i ) cin >> a[i];priority_queue<tuple<int, int, int, int>> q;for (int i = 1; i < n; ++ i )if ((a[i] - 1) * B <= t) {int nxt = work(i, a[i], t - (a[i] - 1) * B);int to = work(i, a[i] + nxt + 1, t - (a[i] - 1) * B - (nxt + 1) * C);q.emplace(to, i, a[i] + nxt + 1, (a[i] - 1) * B + (nxt + 1) * C);res += nxt + 1;}while (q.size()) {auto top = q.top();q.pop();int to = get<0>(top);int i = get<1>(top);int pos = get<2>(top);int dis = get<3>(top);if (dis > t) continue;res += to + 1;k -- ;if (!k) break;q.emplace(work(i, pos + to + 1, t - dis - (to + 1) * C), i, pos + to + 1, dis + (to + 1) * C);}cout << res + ((a[n] - 1) * B <= t) - 1;return 0;}```