//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef pair <int, int> pii;
//#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (k) : Number of items strictly smaller than k .
// find_by_order(k) : K-th element in a set (counting from zero).
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb push_back
#define ppb pop_back
#define mkp make_pair
#define F first
#define S second
#define show(a) cerr << #a <<" -> "<< a <<"\n"
#define fo(a, b, c, d) for(int (a) = (b); (a) <= (c); (a) += (d))
#define foo(a, b, c ,d) for(int (a) = (b); (a) >= (c); (a) -= (d))
//#define int ll
const int N = 1e6 + 5;
int n, k;
ll a[N];
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> k;
for(int i = 1; i <= n; ++i) {
cin >> a[i];
}
if(n % k != 0) {
cout << -1;
return 0;
}
cout << n / k <<"\n";
for(int i = 1; i <= n; i += k) {
cout << a[i] <<" ";
for(int j = i; j <= i + k - 1; ++j) {
cout << j <<" ";
}
cout << "\n";
}
return 0;
}
/*
If you only do what you can do,
You will never be more than you are now!
------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------
We must all suffer from one of two pains: the pain of discipline or the pain of regret.
The difference is discipline weighs grams while regret weighs tons.
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
366 ms |
22636 KB |
n=1000000 |
2 |
Correct |
234 ms |
13520 KB |
n=666666 |
3 |
Correct |
129 ms |
7416 KB |
n=400000 |
4 |
Incorrect |
60 ms |
2680 KB |
Jury has the answer but participant has not |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |