# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
562251 | dattranxxx | Semiexpress (JOI17_semiexpress) | C++11 | 0 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void file() {
const string FILE_NAME = "FILE_NAME";
freopen((FILE_NAME + ".inp").c_str(), "r", stdin);
freopen((FILE_NAME + ".out").c_str(), "w", stdout);
}
const int N = 3000 + 5;
ll a[N], c[N];
int n, _, k, A, B, C, T;
int get(int i, ll t, ll D) {
// trong tg t thi den dc bn trong khoang [a[i] + 1, a[j] - 1]
if (t < 0) return 0;
int nxt = min(a[i] + t / D, a[i+1] - 1);
return nxt - a[i] + 1;
}
int main() {
cin.tie(0)->sync_with_stdio(0); cout.tie(0);
cin >> _ >> n >> k;
cin >> A >> B >> C;
cin >> T;
for (int i = 0; i < n; ++i)
cin >> a[i];
int res = 0;
for (int i = 0; i < n-1; ++i) {
int b = get(i, T - a[i] * B, A), d = get(i, T - a[i] * B, C);
res += b; c[i] = d - b;
}
sort(c, c + n, greater<int>());
k -= n;
for (int i = 0; i < k && c[i] > 0; ++i)
res += c[i];
cout << res;
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... |