Submission #1111349

# Submission time Handle Problem Language Result Execution time Memory
1111349 2024-11-12T07:20:44 Z b1hn_4n Teams (CEOI11_tea) C++17
0 / 100
202 ms 72580 KB
#include <bits/stdc++.h>
using namespace std;
#define ll			long long  
#define ld			long double
#define all(x)		x.begin(), x.end()
#define pii			pair<int, int>
#define fi			first
#define se			second
#define pb			emplace_back

template <class T>
inline bool maximize(T &a, const T &b) {return (a < b ? (a = b, 1) : 0);}
template <class T>
inline bool minimize(T &a, const T &b) {return (a > b ? (a = b, 1) : 0);}

const int N = 1e6 + 5;

int n, m;
pii arr[N];
vector<int> comp[N];

signed main(){	
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	cin >> n;
	for (int i = 1; i <= n; ++i){
		cin >> arr[i].fi;
		arr[i].se = i;
	}
	
	sort(arr+1, arr+n+1);
	reverse(arr+1, arr+n+1);
	int i = 1;
	while (i <= n){
		++m;
		for (int j = i; j <= i + arr[i].fi - 1; ++j)
			comp[m].push_back(arr[j].se);
		i += arr[i].fi;
	}
	
	cout << m << '\n';
	for (int i = 1; i <= m; ++i){
		cout << comp[i].size() << ' ';
		for (int id : comp[i]) cout << id << ' ';
		cout << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 25168 KB Output is correct
2 Incorrect 5 ms 25168 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 20]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 25168 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 7 ms 25260 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 200]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 25168 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 4999]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 25168 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 21 ms 26144 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 80005]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 26252 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 153 ms 39904 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 750013]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 187 ms 72264 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 202 ms 72580 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -