17332022-12-02 11:24:00bzsofiaZenehallgatáscpp11Time limit exceeded 38/50287ms5612 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

long long i, n, m, ido, poz;

int main()
{
    cin>>n>>m;

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

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

    for (i=1; i<=m; ++i)
    {
        cin>>ido;

        ido=ido%zene[n];

        cout<<lower_bound(zene.begin(), zene.end(), ido)-zene.begin()<<" ";
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/03ms1688 KiB
2Time limit exceeded0/0286ms3280 KiB
3Accepted2/24ms2160 KiB
4Accepted2/24ms2288 KiB
5Accepted2/24ms2492 KiB
6Accepted3/34ms2700 KiB
7Accepted3/34ms2928 KiB
8Accepted3/34ms3136 KiB
9Time limit exceeded0/2287ms4500 KiB
10Time limit exceeded0/2277ms3416 KiB
11Accepted2/2194ms4796 KiB
12Accepted2/2192ms4800 KiB
13Accepted2/2194ms4712 KiB
14Accepted2/2190ms4924 KiB
15Time limit exceeded0/2256ms3816 KiB
16Time limit exceeded0/2256ms3820 KiB
17Accepted2/2189ms5196 KiB
18Accepted2/2190ms5408 KiB
19Accepted2/2185ms5448 KiB
20Time limit exceeded0/2208ms5528 KiB
21Time limit exceeded0/2239ms5612 KiB
22Accepted3/3187ms5524 KiB
23Accepted3/3182ms5520 KiB
24Accepted3/3184ms5524 KiB