67542023-12-18 19:27:09szasztundeZenehallgatáscpp17Time limit exceeded 15/50300ms3340 KiB
#include <iostream>

using namespace std;
int a[100001]={0};
int main()
{
    int n,k,x;
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        a[i]=a[i-1]+a[i];
    }
    for(int i=1;i<=k;i++)
    {
        cin>>x;
        x=x%a[n];
        int j=1;
        while(a[j]<x) j++;
        cout<<j<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/03ms1876 KiB
2Time limit exceeded0/0300ms1724 KiB
3Accepted2/24ms2200 KiB
4Accepted2/24ms2256 KiB
5Accepted2/24ms2256 KiB
6Accepted3/34ms2388 KiB
7Accepted3/34ms2592 KiB
8Accepted3/34ms2672 KiB
9Time limit exceeded0/2243ms2404 KiB
10Time limit exceeded0/2266ms2572 KiB
11Time limit exceeded0/2261ms2588 KiB
12Time limit exceeded0/2261ms2596 KiB
13Time limit exceeded0/2261ms2768 KiB
14Time limit exceeded0/2282ms2716 KiB
15Time limit exceeded0/2300ms2908 KiB
16Time limit exceeded0/2254ms2924 KiB
17Time limit exceeded0/2257ms3104 KiB
18Time limit exceeded0/2266ms3152 KiB
19Time limit exceeded0/2238ms2928 KiB
20Time limit exceeded0/2273ms3268 KiB
21Time limit exceeded0/2270ms3244 KiB
22Time limit exceeded0/3282ms3340 KiB
23Time limit exceeded0/3238ms3104 KiB
24Time limit exceeded0/3250ms3152 KiB