# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
672660 | 2022-12-17T10:32:16 Z | haxorman | Teams (CEOI11_tea) | C++14 | 274 ms | 20868 KB |
#include <bits/stdc++.h> using namespace std; const int mxN = 1e6 + 7; pair<int,int> arr[mxN]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> arr[i].first; arr[i].second = i + 1; } sort(arr, arr + n, greater<pair<int,int>>()); vector<vector<int>> ans; for (int i = 0; i < n;) { if (arr[i].first > n - i) { sort(ans.begin(), ans.end()); ans[0].push_back(arr[i].second); ++i; } else { ans.push_back({arr[i].second}); int tmp = i + 1; while (ans.back().size() < arr[i].first) { ans.back().push_back(arr[tmp++].second); } i = tmp; } } cout << ans.size() << "\n"; for (auto vec : ans) { cout << vec.size() << ' '; for (auto x : vec) { cout << x << ' '; } cout << "\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 26 ms | 1892 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 2004 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 191 ms | 14880 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 258 ms | 19356 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 274 ms | 20868 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |