Submission #484848

# Submission time Handle Problem Language Result Execution time Memory
484848 2021-11-05T15:56:51 Z Ronin13 Gift (IZhO18_nicegift) C++14
0 / 100
236 ms 14680 KB
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pb push_back
#define f first
#define s second
using namespace std;

void solve(){
    ll n,k;cin>>n>>k;
    ll a;
    for(int i=1;i<=n;i++)cin>>a;
    ll y=__gcd(n,k);
    ll x=k/y;
    ll m=a/x;
    cout<<x<<"\n";
    for(int i=0;i<n;i+=y){
        cout<<m<<" ";
        for(int j=0;j<k;j++){
            cout<<(i+j)%n+1<<' ';
        }
        cout<<"\n";
    }
}

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    int test=1;//cin>>test;
    while(test--){
        solve();
        cout<<"\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Not all heaps are empty in the end
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Not all heaps are empty in the end
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Not all heaps are empty in the end
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 236 ms 14680 KB Not all heaps are empty in the end
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Not all heaps are empty in the end
2 Halted 0 ms 0 KB -