Submission #645677

#TimeUsernameProblemLanguageResultExecution timeMemory
645677Smailik_Gift (IZhO18_nicegift)C++14
0 / 100
254 ms40776 KiB
#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; } } } int main() { boost; ll tt = 1; //cin >> tt; for(ll i = 1; i <= tt; i++) { //cout << "Case " << i << ":\n"; solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...