# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44638 | 2018-04-04T05:42:24 Z | RayaBurong25_1 | Editor (BOI15_edi) | C++17 | 3000 ms | 524288 KB |
#include <stdio.h> #include <vector> int Val[300005]; std::vector<std::pair<int, int> > Last[300005]; int main() { int N; scanf("%d", &N); int i, x; std::vector<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].push_back({0, i - 1}); printf("%d\n", Val[i]); } else { it = Last[i - 1].end(); it--; while (it->first <= x) it--; Val[i] = Val[it->second]; Last[i] = Last[it->second]; Last[i].push_back({x, i - 1}); printf("%d\n", Val[i]); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 7288 KB | Output is correct |
2 | Correct | 122 ms | 113252 KB | Output is correct |
3 | Correct | 7 ms | 113252 KB | Output is correct |
4 | Correct | 7 ms | 113252 KB | Output is correct |
5 | Correct | 73 ms | 113252 KB | Output is correct |
6 | Correct | 7 ms | 113252 KB | Output is correct |
7 | Correct | 14 ms | 113252 KB | Output is correct |
8 | Correct | 7 ms | 113252 KB | Output is correct |
9 | Correct | 81 ms | 113252 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3107 ms | 524288 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3111 ms | 524288 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 7288 KB | Output is correct |
2 | Correct | 122 ms | 113252 KB | Output is correct |
3 | Correct | 7 ms | 113252 KB | Output is correct |
4 | Correct | 7 ms | 113252 KB | Output is correct |
5 | Correct | 73 ms | 113252 KB | Output is correct |
6 | Correct | 7 ms | 113252 KB | Output is correct |
7 | Correct | 14 ms | 113252 KB | Output is correct |
8 | Correct | 7 ms | 113252 KB | Output is correct |
9 | Correct | 81 ms | 113252 KB | Output is correct |
10 | Execution timed out | 3107 ms | 524288 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |