# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
975274 | 2024-05-04T16:32:20 Z | canadavid1 | Editor (BOI15_edi) | C++14 | 3000 ms | 2292 KB |
#include <iostream> #include <vector> #include <queue> #include <set> int main() { int N; std::cin >> N; std::vector<int> a(N); for(auto& i : a) std::cin >> i; std::vector<int> which; std::vector<bool> undone; // for(auto i : a) std::cerr << i << "\t"; std::cerr << "\n"; for(auto op : a) { undone.push_back(0); which.push_back(-1); // for(auto i : undone) std::cerr << i << "\t"; std::cerr << "\n"; // for(auto i : which) std::cerr << i << "\t"; std::cerr << "\n"; if (op < 0) { op = -op; int wh = which.size()-2; while(-a[wh] >= op || undone[wh]) {wh--;} // this is slow which.back() = wh; auto s = wh; while(s > -1) {undone[s] = !undone[s]; s = which[s];} // pointer sequence but eh // this is slow } int state = 0; for(int i = 0; i < undone.size(); i++) if(!undone[i] && a[i] > 0) state = a[i]; // this is slow std::cout << state << "\n"; } } /* 0 1 2 3 4 5 1 2 -1 -2 -3 -2 A U A A A U A A U A U A A A U U A A 1 2 3 2 */
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 18 ms | 516 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 1 ms | 436 KB | Output is correct |
5 | Correct | 25 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 24 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 20 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3059 ms | 2292 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3046 ms | 2112 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 18 ms | 516 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 1 ms | 436 KB | Output is correct |
5 | Correct | 25 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 24 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 20 ms | 348 KB | Output is correct |
10 | Execution timed out | 3059 ms | 2292 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |