# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44635 | 2018-04-04T05:17:04 Z | RayaBurong25_1 | Editor (BOI15_edi) | C++17 | 152 ms | 40216 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][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 | 12 ms | 14456 KB | Output is correct |
2 | Incorrect | 16 ms | 15336 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 147 ms | 38736 KB | Output is correct |
2 | Correct | 152 ms | 40216 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 119 ms | 40216 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 14456 KB | Output is correct |
2 | Incorrect | 16 ms | 15336 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |