#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ui unsigned int
#define ld long double
#define pl pair<long long int, long long int>
#define boost ios_base::sync_with_stdio(NULL);cin.tie(0);cout.tie(0);
#define ff first
#define ss second
using namespace std;
const ll maxn = 1e6 + 101;
// const ll inf = 1e17 + 9;
// const ll mod = 1e9 + 7;
// const double eps = 1e-10;
// const ll num = 4294967295;
void solve()
{
ll n, k;
cin >> n >> k;
ll a[n + 1];
for(ll i = 1; i <= n; i++){
cin >> a[i];
}
if(n % k == 0){
cout << n / k << "\n";
ll ans = 0, cnt = n / k;
while(cnt--){
for(ll j = 1; j <= k; j++){
cout << ans + j << " ";
}
cout << a[1] << "\n";
ans += n / k;
}
}
else
cout << "-1";
}
int main()
{
boost;
ll tt = 1;
//cin >> tt;
for(ll i = 1; i <= tt; i++)
{
//cout << "Case " << i << ":\n";
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Same heap occurs twice |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Same heap occurs twice |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Same heap occurs twice |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
265 ms |
27856 KB |
Expected int32, but "1000000000000" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Same heap occurs twice |
2 |
Halted |
0 ms |
0 KB |
- |