# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
773256 |
2023-07-04T17:51:50 Z |
NK_ |
Teams (CEOI11_tea) |
C++17 |
|
453 ms |
79604 KB |
// Success consists of going from failure to failure without loss of enthusiasm
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define sz(x) int(x.size())
template<class T> using V = vector<T>;
int main() {
cin.tie(0)->sync_with_stdio(0);
// smallest L (MN <= L <= N) such that there are
// N % L values less than or equal N % L
// if x = N % L => L is a divisor of (N - x)
// minimum divisor of (N - x) such that
// it is greater than or equal to MN
int N; cin >> N;
V<int> A(N); for(auto& x : A) cin >> x;
int mn = *max_element(begin(A), end(A));
V<pair<int, int>> B; for(int i = 0; i < N; i++) B.push_back(make_pair(A[i], i));
sort(begin(B), end(B));
map<int, int> C; for(auto x : A) C[x]++;
int amt = 0; V<int> pos(N);
for (int x = 0; x < N; x++) {
amt += C[x];
if (amt >= x) pos[x] = 1;
}
for (int L = mn; L <= N; L++) {
int x = N % L; if (pos[x]) {
V<V<int>> S = {};
if (x) {
S.push_back({});
for(int i = 0; i < x; i++) {
S.back().push_back(B.back().second);
B.pop_back();
}
}
for(int t = 0; t < (N-x)/L; t++) {
S.push_back({});
for(int i = 0; i < L; i++) {
S.back().push_back(B.back().second);
B.pop_back();
}
}
// cout << L << nl;
cout << sz(S) << nl;
for(auto v : S) {
cout << sz(v) << " ";
for(auto c : v) cout << c << " ";
cout << nl;
}
break;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Integer parameter [name=k_j] equals to 0, violates the range [1, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Integer parameter [name=k_j] equals to 0, violates the range [1, 100] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
712 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
712 KB |
Integer parameter [name=k_j] equals to 0, violates the range [1, 5000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
31 ms |
6788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
40 ms |
7356 KB |
Integer parameter [name=k_j] equals to 0, violates the range [1, 90003] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
322 ms |
58880 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
449 ms |
77712 KB |
Integer parameter [name=k_j] equals to 0, violates the range [1, 1000000] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
453 ms |
79604 KB |
Integer parameter [name=k_j] equals to 0, violates the range [1, 1000000] |
2 |
Halted |
0 ms |
0 KB |
- |