17372022-12-02 13:35:071478Zenehallgatáscpp11Time limit exceeded 35/50286ms5468 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{

    int n;
    cin >> n;

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

    int m;
    cin >> m;

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

    int a;

    for (int 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
base35/50
1Accepted0/03ms1812 KiB
2Time limit exceeded0/0286ms3356 KiB
3Accepted2/24ms2224 KiB
4Accepted2/24ms2464 KiB
5Accepted2/24ms2528 KiB
6Accepted3/34ms2672 KiB
7Accepted3/34ms2868 KiB
8Accepted3/34ms2992 KiB
9Accepted2/2194ms4356 KiB
10Time limit exceeded0/2252ms3056 KiB
11Time limit exceeded0/2254ms3112 KiB
12Time limit exceeded0/2263ms4580 KiB
13Time limit exceeded0/2241ms3404 KiB
14Time limit exceeded0/2254ms3536 KiB
15Time limit exceeded0/2250ms5108 KiB
16Accepted2/2192ms5176 KiB
17Accepted2/2188ms5300 KiB
18Accepted2/2187ms5380 KiB
19Accepted2/2187ms5456 KiB
20Accepted2/2182ms5464 KiB
21Accepted2/2184ms5468 KiB
22Accepted3/3185ms5460 KiB
23Time limit exceeded0/3237ms5380 KiB
24Accepted3/3186ms5464 KiB