47762023-03-31 12:08:00Error42Zenelejátszó (35 pont)cpp17Accepted 35/3548ms7604 KiB
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<int> t(n);
    for (int& x : t)
        cin >> x;

    vector<int> diff(n);
    diff[0] = t[0];
    for (int i = 1; i < n; i++)
        diff[i] = t[i] - t[i - 1];

    sort(diff.begin(), diff.end());

    vector<int> ans = { 1 };

    for (int i = 0; i < n; i++)
        if (i == n - 1 || diff[i + 1] != diff[i])
            ans.push_back(i + 2);

    cout << ans.size() << "\n";
    for (int const& x : ans)
        cout << x << " ";
    cout << "\n";
}
SubtaskSumTestVerdictTimeMemory
base35/35
1Accepted0/03ms1828 KiB
2Accepted0/04ms2468 KiB
3Accepted2/22ms2136 KiB
4Accepted2/23ms2268 KiB
5Accepted2/23ms2640 KiB
6Accepted2/23ms2856 KiB
7Accepted2/23ms3184 KiB
8Accepted2/23ms3396 KiB
9Accepted2/28ms3968 KiB
10Accepted2/216ms4428 KiB
11Accepted2/210ms3916 KiB
12Accepted2/232ms6396 KiB
13Accepted2/232ms6608 KiB
14Accepted1/137ms6576 KiB
15Accepted2/241ms6744 KiB
16Accepted2/248ms7308 KiB
17Accepted2/248ms7416 KiB
18Accepted2/248ms7604 KiB
19Accepted2/248ms7516 KiB
20Accepted2/228ms5960 KiB