답안 #499352

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
499352 2021-12-28T04:42:14 Z SirCovidThe19th Semiexpress (JOI17_semiexpress) C++17
48 / 100
1 ms 360 KB
#include <bits/stdc++.h>
using namespace std; 

#define ll long long

int main(){
    int n, m, k; ll a, b, c, t, ans = 0;
    cin >> n >> m >> k >> a >> b >> c >> t;

    set<ll> S; priority_queue<tuple<ll, ll, ll>> pq;
    
    for (int i = 1; i <= m; i++){
        ll pos; cin >> pos;
        S.insert(pos); pq.push({2e9, (pos - 1) * b, pos});
    }
    while (!pq.empty() and k){
        ll dst, ti, pos; tie(dst, ti, pos) = pq.top(); pq.pop();
        if (ti > t) continue;

        if (dst == 2e9) dst = min((t - ti) / a, (pos == n) ? 0 : *S.upper_bound(pos) - pos - 1);
        ans += dst + 1; k--;

        pos += dst + 1; ti += (dst + 1) * c;
        dst = min((t - ti) / a, *S.lower_bound(pos) - pos - 1);
        if (dst >= 0) pq.push({dst, ti, pos});
    }
    cout<<ans - 1<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 292 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 292 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 288 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 0 ms 204 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 292 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 288 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 0 ms 204 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 1 ms 360 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Incorrect 1 ms 332 KB Output isn't correct
22 Halted 0 ms 0 KB -