# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44636 | 2018-04-04T05:32:49 Z | RayaBurong25_1 | Editor (BOI15_edi) | C++17 | 200 ms | 45848 KB |
#include <stdio.h> #include <map> int Val[300005]; std::map<int, int> Last[300005]; int main() { int N; scanf("%d", &N); int i, x; std::map<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][0] = i - 1; printf("%d\n", Val[i]); } else { it = Last[i - 1].upper_bound(x); Val[i] = Val[it->second]; Last[i] = Last[it->second]; Last[i][x] = i - 1; printf("%d\n", Val[i]); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 14456 KB | Output is correct |
2 | Incorrect | 16 ms | 15084 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 173 ms | 45848 KB | Output is correct |
2 | Correct | 200 ms | 45848 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 107 ms | 45848 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 14456 KB | Output is correct |
2 | Incorrect | 16 ms | 15084 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |