20702022-12-16 12:50:59gkataZenehallgatáscpp17Time limit exceeded 34/50280ms4988 KiB
#include <iostream>
//#include <fstream>
#include <vector>
#include <algorithm>

using namespace std;

//ifstream cin("zene.in");
//ofstream cout("zene.out");

vector <int>x;
vector <int>y;

int n,i,k,a,s;

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

    for(i=1;i<=n;++i)
    {
        cin>>a;
        s+=a;
        x.push_back(s);
    }

    for(i=1;i<=k;++i)
    {
        cin>>a;
        a=a%x[n-1];

        cout<<lower_bound(x.begin(),x.end(),a)-x.begin()+1<<" ";
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base34/50
1Accepted0/03ms1772 KiB
2Time limit exceeded0/0280ms3160 KiB
3Accepted2/24ms2212 KiB
4Accepted2/24ms2436 KiB
5Accepted2/24ms2488 KiB
6Accepted3/34ms2488 KiB
7Accepted3/34ms2612 KiB
8Accepted3/34ms2820 KiB
9Accepted2/2194ms4020 KiB
10Accepted2/2195ms4016 KiB
11Accepted2/2194ms4140 KiB
12Accepted2/2193ms4352 KiB
13Accepted2/2188ms4428 KiB
14Accepted2/2190ms4420 KiB
15Time limit exceeded0/2202ms4440 KiB
16Time limit exceeded0/2217ms4580 KiB
17Time limit exceeded0/2209ms4764 KiB
18Time limit exceeded0/2204ms4876 KiB
19Time limit exceeded0/2246ms4740 KiB
20Accepted2/2181ms4832 KiB
21Accepted2/2192ms4900 KiB
22Time limit exceeded0/3210ms4904 KiB
23Accepted3/3200ms4988 KiB
24Time limit exceeded0/3261ms3592 KiB