#include <iostream>
#include <fstream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <list>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
ll n,k,a[1000005],m,i,j,p,q,t,u,v;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n>>k;
for(i=1;i<=n;i++)
{
cin>>a[i];
if(a[i]!=a[1])
t=1;
}
if(t==0)
{
if(n%k!=0)
cout<<-1<<endl;
else
{
cout<<n/k<<endl;
cout<<a[1]<<" ";
for(i=1;i<=n;i++)
{
cout<<i<<" ";
if(i%k==0)
{
cout<<endl;
if(i!=n)
cout<<a[1]<<" ";
}
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1657 ms |
36388 KB |
n=1000000 |
2 |
Correct |
812 ms |
22616 KB |
n=666666 |
3 |
Correct |
339 ms |
12908 KB |
n=400000 |
4 |
Incorrect |
60 ms |
6520 KB |
Jury has the answer but participant has not |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |