#include <iostream>
#include <map>
#include <deque>
#include <vector>
#define int long long int
using namespace std;
const int maxN = 1e6 + 326;
int N, K;
signed main(){
cin >> N >> K;
int x;
cin >> x;
for(int i = 1; i <= N; i++) cin >> x;
if(N % K){
cout << -1 << endl;
return 0;
}
cout << N / K << endl;
for(int i = 1; i <= N; i += K){
cout << x << " ";
for(int j = i; j < i + K; j++) cout << j << " ";
cout << endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1828 ms |
17236 KB |
n=1000000 |
2 |
Correct |
948 ms |
12140 KB |
n=666666 |
3 |
Correct |
478 ms |
7276 KB |
n=400000 |
4 |
Incorrect |
153 ms |
2412 KB |
Jury has the answer but participant has not |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |