83672024-01-15 01:18:00TuruTamasIntervallumok (45 pont)cpp17Wrong answer 0/4545ms10700 KiB
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
ifstream in_file("minta/be1.txt");
#define input in_file
#define INTHENAMEOFGOD
#else
#define input cin
#define INTHENAMEOFGOD \
    ios::sync_with_stdio(0); \
    cin.tie(0); \
    cout.tie(0);
#endif
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef array<ll, 2> pii;

ll N;
vi A;
vector<pair<vi, ll>> vp;

int main() {
    INTHENAMEOFGOD
    input >> N;
    A.resize(N);
    for (ll n = 0; n < N; n++) {
        input >> A[n];
    }
    for (ll i = 2; i <= N/2; i++) {
        if ((N/i)*i != N) {
            continue;
        }
        ll H = 0, kezd;
        vi O;
        for (ll k = 0; k < N; k += i) {
            O.push_back(A[k]);
            if (k > 0)
                H += A[k-1]-kezd;

            kezd = A[k];
        }
        vp.emplace_back(O, H);
    }
    cout << vp.size()+1 << "\n";
    for (auto [v, l] : vp) {
        cout << v.size() << " " << l << "\n";
        for (ll val : v)
            cout << val << "\n";
    }
    cout << 1 << " " << A.back()-A[0] << "\n" << A[0] << endl;
}
SubtaskSumTestVerdictTimeMemory
base0/45
1Wrong answer0/03ms1828 KiB
2Wrong answer0/03ms2224 KiB
3Wrong answer0/13ms2360 KiB
4Wrong answer0/13ms2576 KiB
5Wrong answer0/13ms2848 KiB
6Wrong answer0/16ms3240 KiB
7Wrong answer0/132ms7400 KiB
8Wrong answer0/23ms3076 KiB
9Wrong answer0/219ms5852 KiB
10Wrong answer0/219ms6080 KiB
11Wrong answer0/219ms6288 KiB
12Wrong answer0/219ms6608 KiB
13Wrong answer0/219ms6456 KiB
14Wrong answer0/24ms4288 KiB
15Wrong answer0/26ms4684 KiB
16Wrong answer0/27ms4868 KiB
17Wrong answer0/29ms5232 KiB
18Wrong answer0/29ms5216 KiB
19Wrong answer0/243ms10164 KiB
20Wrong answer0/243ms10164 KiB
21Wrong answer0/243ms10164 KiB
22Wrong answer0/243ms10388 KiB
23Wrong answer0/243ms10464 KiB
24Wrong answer0/230ms8432 KiB
25Wrong answer0/229ms8236 KiB
26Wrong answer0/229ms8236 KiB
27Wrong answer0/245ms10700 KiB