17412022-12-02 13:39:451478Zenehallgatáscpp11Time limit exceeded 30/50273ms5640 KiB
#include <bits/stdc++.h>

using namespace std;

long long n, m, i, a;

int main()
{

    cin >> n;
    cin >> m;

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

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

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

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/50
1Accepted0/03ms1808 KiB
2Accepted0/0193ms3360 KiB
3Accepted2/24ms2216 KiB
4Accepted2/24ms2420 KiB
5Accepted2/24ms2492 KiB
6Accepted3/34ms2624 KiB
7Accepted3/34ms2828 KiB
8Accepted3/34ms3184 KiB
9Accepted2/2192ms4604 KiB
10Time limit exceeded0/2244ms4680 KiB
11Time limit exceeded0/2266ms3576 KiB
12Accepted2/2193ms4896 KiB
13Time limit exceeded0/2228ms3800 KiB
14Time limit exceeded0/2261ms3852 KiB
15Accepted2/2193ms5436 KiB
16Accepted2/2187ms5424 KiB
17Accepted2/2189ms5572 KiB
18Time limit exceeded0/2273ms4156 KiB
19Time limit exceeded0/2241ms4156 KiB
20Time limit exceeded0/2266ms4216 KiB
21Accepted2/2185ms5636 KiB
22Accepted3/3182ms5640 KiB
23Time limit exceeded0/3245ms5632 KiB
24Time limit exceeded0/3236ms5548 KiB