Submission #645679

# Submission time Handle Problem Language Result Execution time Memory
645679 2022-09-27T16:06:36 Z Smailik_ Gift (IZhO18_nicegift) C++14
0 / 100
259 ms 27744 KB
#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();
    }
}  
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Same heap occurs twice
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Same heap occurs twice
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Same heap occurs twice
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 259 ms 27744 KB Expected int32, but "1000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Same heap occurs twice
2 Halted 0 ms 0 KB -