답안 #204507

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
204507 2020-02-26T07:07:50 Z Saboon Teams (CEOI11_tea) C++14
0 / 100
343 ms 22112 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';
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Integer 0 violates the range [1, 1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 504 KB Output is correct
2 Incorrect 6 ms 504 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 29 ms 1912 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 33 ms 2168 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 216 ms 15736 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 333 ms 20984 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 343 ms 22112 KB Output isn't correct
2 Halted 0 ms 0 KB -