# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44634 | 2018-04-04T04:53:06 Z | RayaBurong25_1 | Editor (BOI15_edi) | C++17 | 203 ms | 37864 KB |
#include <stdio.h> #include <map> typedef struct node node; struct node { std::map<std::pair<int, int>, int> last; }; node N[300005]; int P[300005]; int main() { int n; scanf("%d", &n); int i, x; std::map<std::pair<int, int>, int>::iterator it; P[0] = 0; for (i = 1; i <= n; i++) { scanf("%d", &x); if (x > 0) { P[i] = x; N[x].last[{0, -i}] = P[i - 1]; printf("%d\n", x); } else { it = N[P[i - 1]].last.lower_bound({x + 1, -i}); P[i] = it->second; N[it->second].last[{x, -i}] = P[i - 1]; printf("%d\n", it->second); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 14328 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 203 ms | 37864 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 142 ms | 37864 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 14328 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |