121972024-12-08 14:45:56KissCsongor777Zenehallgatáscpp17Time limit exceeded 2/50300ms852 KiB
#include <iostream>

using namespace std;

    int P[100001];
int main()
{
    int n, k, s=0, x,j;
    cin>>n>>k;
    for(int i=1; i<=n; i++)
    {
        P[i]=s;
        cin>>x;s+=x;
    }
    for(int i=1; i<=k; i++)
    {
        cin>>x;
        x=x%s;
        if(x!=0)
        {j=1;
        while(P[j]<x)j++;
        cout<<j-1<<" ";}
        else cout<<n;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Accepted0/01ms320 KiB
2Time limit exceeded0/0279ms824 KiB
3Wrong answer0/24ms320 KiB
4Accepted2/24ms320 KiB
5Wrong answer0/23ms320 KiB
6Wrong answer0/34ms500 KiB
7Wrong answer0/33ms320 KiB
8Wrong answer0/33ms320 KiB
9Time limit exceeded0/2300ms716 KiB
10Time limit exceeded0/2300ms796 KiB
11Time limit exceeded0/2300ms784 KiB
12Time limit exceeded0/2286ms824 KiB
13Time limit exceeded0/2291ms692 KiB
14Time limit exceeded0/2291ms696 KiB
15Time limit exceeded0/2300ms748 KiB
16Time limit exceeded0/2280ms824 KiB
17Time limit exceeded0/2284ms824 KiB
18Time limit exceeded0/2284ms684 KiB
19Time limit exceeded0/2300ms672 KiB
20Time limit exceeded0/2275ms820 KiB
21Time limit exceeded0/2286ms852 KiB
22Time limit exceeded0/3286ms824 KiB
23Time limit exceeded0/3300ms824 KiB
24Time limit exceeded0/3284ms824 KiB