Submission #530136

# Submission time Handle Problem Language Result Execution time Memory
530136 2022-02-24T16:58:13 Z pedroslrey Teams (CEOI11_tea) C++17
0 / 100
261 ms 37308 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;

    vector<pair<int, int>> xs;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;

        xs.emplace_back(x, i);
    }

    sort(xs.rbegin(), xs.rend());

    vector<vector<int>> ans;
    for (int i = 0; i < n;) {
        ans.emplace_back();
        for (int j = i; j < i + xs[i].first; ++j)
            ans.back().push_back(xs[j].second);
        i += xs[i].first;
    }

    cout << ans.size() << endl;
    for (auto xs: ans) {
        cout << xs.size() << " ";
        for (int x: xs)
            cout << x+1 << " ";
        cout << endl;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 2376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 2508 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 185 ms 18468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 261 ms 25868 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 210 ms 37308 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -