# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
264038 | 2020-08-14T04:51:01 Z | 반딧불(#5094) | Teams (CEOI11_tea) | C++17 | 395 ms | 23120 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; vector<pair<int, int> > v; int teamCnt; vector<int> vec; bool able(int sz){ if(sz * teamCnt < n) return false; return true; } int main(){ scanf("%d", &n); for(int i=1; i<=n; i++){ int x; scanf("%d", &x); v.push_back({x, i}); } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); for(int i=0; i<n; ){ if(i + v[i].first <= n){ teamCnt++; i = i + v[i].first; } else break; } printf("%d\n", teamCnt); int l = v[0].first, r = n, ans = v[0].first; while(l <= r){ int m = (l+r)>>1; if(able(m)){ ans = m; r = m-1; } else l = m+1; } for(int i=1; i<=teamCnt; i++){ vec.clear(); for(int j=(i-1)*ans; j<i*ans && j<n; j++){ vec.push_back(v[j].second); } printf("%d ", (int)vec.size()); for(auto &x: vec) printf("%d ", x); puts(""); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Integer parameter [name=s_i] equals to 0, violates the range [1, 20] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer parameter [name=s_i] equals to 0, violates the range [1, 200] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 30 ms | 1652 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 32 ms | 1652 KB | Output is correct |
2 | Incorrect | 27 ms | 1528 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 269 ms | 11472 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 377 ms | 16104 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 395 ms | 19024 KB | Output is correct |
2 | Correct | 302 ms | 23120 KB | Output is correct |
3 | Incorrect | 359 ms | 15184 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |