# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
204508 |
2020-02-26T07:09:31 Z |
Saboon |
Teams (CEOI11_tea) |
C++14 |
|
349 ms |
15224 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 10;
pair<int,int> a[maxn];
bool mark[maxn];
int main(){
ios_base::sync_with_stdio(false);
int n;
cin >> n;
for (int i = 1; i <= n; i++){
int x;
cin >> x;
a[i] = {x, i};
}
sort(a + 1, a + n + 1);
int t = 0;
int now = n;
while (now >= 1){
if (a[now].first > now){
now --;
continue;
}
mark[now] = 1;
t ++;
now -= a[now].first;
}
cout << t << endl;
int last = 0;
for (int i = 1; i <= n; i++){
if (mark[i]){
cout << i - last << ' ';
for (int j = last + 1; j <= i; j++)
cout << a[j].second << ' ';
last = i;
cout << '\n';
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
376 KB |
Output is correct |
2 |
Correct |
5 ms |
376 KB |
Output is correct |
3 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
504 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
376 KB |
Output is correct |
2 |
Incorrect |
6 ms |
376 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
29 ms |
1528 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
1656 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
226 ms |
11896 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
327 ms |
15096 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
349 ms |
15224 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |