Submission #530177

#TimeUsernameProblemLanguageResultExecution timeMemory
530177pedroslreyTeams (CEOI11_tea)C++17
0 / 100
314 ms262148 KiB
#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.begin(), xs.end()); 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() << '\n'; for (auto xs: ans) { cout << xs.size() << " "; for (int x: xs) cout << x+1 << " "; cout << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...