답안 #114096

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
114096 2019-05-30T08:20:57 Z popovicirobert Semiexpress (JOI17_semiexpress) C++14
18 / 100
2 ms 384 KB
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44

using namespace std;

const ll INF = 1e18;

int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int i, n, m, k, a, b, c;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n >> m >> k >> a >> b >> c;
    // b < c < a

    ll t;
    cin >> t;

    vector <int> st(m + 1);
    for(i = 1; i <= m; i++) {
        cin >> st[i];
    }

    k -= m;
    int ans = 0, cnt = 0;

    for(i = 1; i < m; i++) {
        ll cur = 1LL * (st[i] - 1) * b;
        if(cur > t) {
            break;
        }

        ll x = st[i];

        while(x < st[i + 1]) {
            ll y = (x + (t - cur) / a);

            ans += min(y, 1LL * st[i + 1] - 1) - x;

            if(y >= st[i + 1] - 1) {
                break;
            }

            if(cnt < k) {
                cur += (y + 1 - x) * c;

                if(cur > t) {
                    break;
                }

                cnt++;
                ans++;
                x = y + 1;
            }
            else {
                break;
            }
        }

        if(1LL * (st[i + 1] - 1) * b <= t) {
            ans++;
        }
    }

    cout << ans;

    //cin.close();
    //cout.close();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 2 ms 384 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 384 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Incorrect 2 ms 384 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 2 ms 384 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 2 ms 384 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Incorrect 2 ms 384 KB Output isn't correct
16 Halted 0 ms 0 KB -