# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44639 | 2018-04-04T05:58:40 Z | RayaBurong25_1 | Editor (BOI15_edi) | C++17 | 3000 ms | 7340 KB |
#include <stdio.h> #include <vector> int Val[300005]; typedef struct node node; struct node { int level; int last; int next; }; node Last[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; int j; 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}); Last[i] = {0, i - 1, i - 1}; printf("%d\n", Val[i]); } else { // it = Last[i - 1].end(); // it--; // while (it->first <= x) it--; j = i - 1; while (Last[j].level <= x) j = Last[j].next; j = Last[j].last; Val[i] = Val[j]; // Last[i] = Last[it->second]; // Last[i].push_back({x, i - 1}); Last[i] = {x, i - 1, j}; printf("%d\n", Val[i]); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 4 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 548 KB | Output is correct |
4 | Correct | 2 ms | 548 KB | Output is correct |
5 | Correct | 9 ms | 572 KB | Output is correct |
6 | Correct | 2 ms | 572 KB | Output is correct |
7 | Correct | 4 ms | 884 KB | Output is correct |
8 | Correct | 2 ms | 884 KB | Output is correct |
9 | Correct | 3 ms | 884 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 85 ms | 7324 KB | Output is correct |
2 | Correct | 98 ms | 7340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 50 ms | 7340 KB | Output is correct |
2 | Correct | 56 ms | 7340 KB | Output is correct |
3 | Execution timed out | 3043 ms | 7340 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 4 ms | 484 KB | Output is correct |
3 | Correct | 2 ms | 548 KB | Output is correct |
4 | Correct | 2 ms | 548 KB | Output is correct |
5 | Correct | 9 ms | 572 KB | Output is correct |
6 | Correct | 2 ms | 572 KB | Output is correct |
7 | Correct | 4 ms | 884 KB | Output is correct |
8 | Correct | 2 ms | 884 KB | Output is correct |
9 | Correct | 3 ms | 884 KB | Output is correct |
10 | Correct | 85 ms | 7324 KB | Output is correct |
11 | Correct | 98 ms | 7340 KB | Output is correct |
12 | Correct | 50 ms | 7340 KB | Output is correct |
13 | Correct | 56 ms | 7340 KB | Output is correct |
14 | Execution timed out | 3043 ms | 7340 KB | Time limit exceeded |
15 | Halted | 0 ms | 0 KB | - |