# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164183 | 2019-11-18T12:49:06 Z | luciocf | Teams (CEOI11_tea) | C++14 | 389 ms | 42744 KB |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6+10; pair<int, int> a[maxn]; vector<int> team[maxn]; int main(void) { int n; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &a[i].first); a[i].second = i; } sort(a+1, a+n+1); int ans = 0; for (int i = n; i >= 1; ) { ans++; int j; for (j = i; j >= 1 && (i-j+1 <= a[i].first || a[j].first > j); j--) team[ans].push_back(a[j].second); i = j; } printf("%d\n", ans); for (int i = 1; i <= ans; i++) { printf("%d", team[i].size()); for (auto x: team[i]) printf(" %d", x); printf("\n"); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 23800 KB | Output is correct |
2 | Correct | 24 ms | 23928 KB | Output is correct |
3 | Incorrect | 25 ms | 23800 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 23800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 23800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 23876 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 23892 KB | Output is correct |
2 | Incorrect | 25 ms | 23928 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 63 ms | 25464 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 53 ms | 25592 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 274 ms | 38408 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 372 ms | 42744 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 389 ms | 42628 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |