47732023-03-31 12:03:14Error42Zenelejátszó (35 pont)cpp17Wrong answer 33/3550ms7428 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 = 1; 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
base33/35
1Accepted0/03ms1828 KiB
2Accepted0/04ms2436 KiB
3Accepted2/22ms2108 KiB
4Accepted2/23ms2224 KiB
5Accepted2/23ms2580 KiB
6Accepted2/23ms2792 KiB
7Accepted2/23ms3116 KiB
8Accepted2/23ms3080 KiB
9Wrong answer0/28ms3884 KiB
10Accepted2/217ms4636 KiB
11Accepted2/210ms3948 KiB
12Accepted2/232ms6016 KiB
13Accepted2/232ms6020 KiB
14Accepted1/137ms6060 KiB
15Accepted2/241ms6324 KiB
16Accepted2/248ms6892 KiB
17Accepted2/250ms7024 KiB
18Accepted2/248ms7236 KiB
19Accepted2/248ms7428 KiB
20Accepted2/228ms5920 KiB