17392022-12-02 13:37:221478Zenehallgatáscpp11Time limit exceeded 36/50282ms5968 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{

    long long n;
    cin >> n;

    vector<long long> prefixSum(n + 1);

    long long m;
    cin >> m;

    for (long long i = 1; i <= n; i++)
    {
        cin >> prefixSum[i];
        prefixSum[i] += prefixSum[i - 1];
    }

    long long a;

    for (long long i = 1; i <= m; i++)
    {
        cin >> a;
        a = a % prefixSum[n];
        cout << lower_bound(prefixSum.begin() + 1, prefixSum.end(), a) - prefixSum.begin() << " ";
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base36/50
1Accepted0/03ms1812 KiB
2Time limit exceeded0/0282ms3408 KiB
3Accepted2/24ms2212 KiB
4Accepted2/24ms2452 KiB
5Accepted2/24ms2660 KiB
6Accepted3/34ms2824 KiB
7Accepted3/34ms3032 KiB
8Accepted3/34ms3380 KiB
9Accepted2/2195ms4536 KiB
10Time limit exceeded0/2259ms4668 KiB
11Time limit exceeded0/2254ms3548 KiB
12Time limit exceeded0/2254ms3752 KiB
13Accepted2/2193ms5264 KiB
14Accepted2/2190ms5472 KiB
15Time limit exceeded0/2268ms4244 KiB
16Time limit exceeded0/2277ms5544 KiB
17Time limit exceeded0/2254ms4248 KiB
18Accepted2/2188ms5548 KiB
19Accepted2/2186ms5672 KiB
20Time limit exceeded0/2243ms5768 KiB
21Accepted2/2184ms5844 KiB
22Accepted3/3182ms5932 KiB
23Accepted3/3184ms5844 KiB
24Accepted3/3187ms5968 KiB