# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44637 | RayaBurong25_1 | Editor (BOI15_edi) | C++17 | 3106 ms | 524288 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <map>
int Val[300005];
std::map<int, std::pair<int, int> > Last[300005];
int main()
{
int N;
scanf("%d", &N);
int i, x;
std::map<int, std::pair<int, int> >::iterator it;
for (i = 1; i <= N; i++)
{
scanf("%d", &x);
if (x > 0)
{
Val[i] = x;
Last[i] = Last[i - 1];
Last[i][i] = {0, i - 1};
printf("%d\n", Val[i]);
}
else
{
it = Last[i - 1].end();
it--;
while (it->second.first <= x) it--;
Val[i] = Val[it->second.second];
Last[i] = Last[it->second.second];
Last[i][i] = {x, i - 1};
printf("%d\n", Val[i]);
}
}
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |