# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
39383 | 14kg | 코알라 (JOI13_koala) | C++11 | 2000 ms | 5888 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <algorithm>
#include <queue>
using namespace std;
int S, E, J, n;
long long P;
pair<int, long long> in[100001];
priority_queue<pair<long long, int> > Q;
int main() {
int t;
pair<long long, int> path;
scanf("%d %d %d %lld %d", &S, &E, &J, &P, &n);
for (int i = 1; i <= n; i++) scanf("%d %lld", &in[i].first, &in[i].second);
sort(in + 1, in + n + 1);
Q.push({ 0,S });
for (int i = 1; i <= n; i++) {
while (Q.top().second < in[i].first) {
if (0); // Q.top().first==path.first
else {
path = Q.top(), Q.pop();
t = (in[i].first - path.second) / J;
if (path.second + J*t < in[i].first) t++;
Q.push({ path.first - P*(long long)t, path.second + J*t });
}
}
Q.push({ Q.top().first + in[i].second, in[i].first });
}
while (Q.top().second < E) Q.pop();
printf("%lld", Q.top().first);
}
컴파일 시 표준 에러 (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... |