Submission #750153

# Submission time Handle Problem Language Result Execution time Memory
750153 2023-05-29T07:15:37 Z mohammedMonem Zalmoxis (BOI18_zalmoxis) C++14
0 / 100
58 ms 4280 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;
    }
    int minI = 0;
    for (int i = 0; i < n; ++i) {
        minI = s[i] < s[minI] ? i : minI;
    }
    std::pair<int, int> cur = {minI, minI};
    int curI = s[minI];
    std::deque<int> ans = {curI};
    while (curI < 30) {
        if (cur.second < n - 1 && s[cur.second + 1] == curI) {
            ans.push_back(curI);
            cur.second++, curI++;
        }
        else if (cur.first > 0 && s[cur.first - 1] == curI){
            ans.push_front(curI);
            cur.first--, curI++;
        }
        else {
            ans.push_back(curI);
            curI++;
        }
    }
    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
}
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 4180 KB Unexpected end of file - int32 expected
2 Incorrect 51 ms 4180 KB Unexpected end of file - int32 expected
3 Incorrect 50 ms 4180 KB Unexpected end of file - int32 expected
4 Incorrect 52 ms 4180 KB Unexpected end of file - int32 expected
5 Incorrect 54 ms 4280 KB Unexpected end of file - int32 expected
6 Incorrect 51 ms 4180 KB Unexpected end of file - int32 expected
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 4180 KB Unexpected end of file - int32 expected
2 Incorrect 54 ms 4180 KB Unexpected end of file - int32 expected
3 Incorrect 50 ms 4180 KB Unexpected end of file - int32 expected
4 Incorrect 54 ms 4180 KB Unexpected end of file - int32 expected
5 Incorrect 53 ms 4180 KB Unexpected end of file - int32 expected
6 Incorrect 53 ms 4180 KB Unexpected end of file - int32 expected
7 Incorrect 58 ms 4180 KB Unexpected end of file - int32 expected
8 Incorrect 51 ms 4224 KB Unexpected end of file - int32 expected
9 Incorrect 41 ms 3412 KB Unexpected end of file - int32 expected
10 Incorrect 18 ms 1492 KB Unexpected end of file - int32 expected
11 Incorrect 27 ms 2260 KB Unexpected end of file - int32 expected
12 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
13 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
14 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected