# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
750129 | 2023-05-29T07:03:07 Z | mohammedMonem | Zalmoxis (BOI18_zalmoxis) | C++14 | 3 ms | 596 KB |
#include <bits/stdc++.h> void Run(); int main() { Run(); int n, k; std::cin >> n >> k; std::vector<int> s(n); for (auto &i: s) { std::cin >> i; } std::pair<int, int> cur = {std::min_element(s.begin(), s.end()) - s.begin(), std::min_element(s.begin(), s.end()) - s.begin()}; int curI = *std::min_element(s.begin(), s.end()); std::deque<int> ans = {curI}; while (curI < 30) { if (cur.second < n - 1 && s[cur.second + 1] == curI) { ans.push_front(curI); cur.second++, curI++; } else if (cur.first > 0 && s[cur.first - 1] == curI){ ans.push_back(curI); cur.first++, curI++; } else { ans.push_back(curI); curI++; } } std::reverse(ans.begin(), ans.end()); for (const auto &i: ans) { std::cout << i << ' '; } } void Run() { std::ios_base::sync_with_stdio(false); std::cin.tie(); std::cout.tie(); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
2 | Runtime error | 3 ms | 468 KB | Execution killed with signal 11 |
3 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
4 | Runtime error | 3 ms | 516 KB | Execution killed with signal 11 |
5 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
6 | Runtime error | 3 ms | 468 KB | Execution killed with signal 11 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 468 KB | Execution killed with signal 11 |
2 | Runtime error | 3 ms | 580 KB | Execution killed with signal 11 |
3 | Runtime error | 2 ms | 468 KB | Execution killed with signal 11 |
4 | Runtime error | 2 ms | 596 KB | Execution killed with signal 11 |
5 | Runtime error | 2 ms | 596 KB | Execution killed with signal 11 |
6 | Runtime error | 2 ms | 596 KB | Execution killed with signal 11 |
7 | Runtime error | 2 ms | 596 KB | Execution killed with signal 11 |
8 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
9 | Runtime error | 2 ms | 596 KB | Execution killed with signal 11 |
10 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
11 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
12 | Runtime error | 3 ms | 468 KB | Execution killed with signal 11 |
13 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
14 | Runtime error | 2 ms | 596 KB | Execution killed with signal 11 |