120832024-12-01 17:02:20ruffbrigiZenehallgatáscpp17Time limit exceeded 15/50300ms2116 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,k;
    cin>>n;
    cin>>k;
    long long t[n],p[k];
    cin>>t[0];
    for(int i=1;i<=n-1;i++)
    {
        cin>>t[i];
        t[i]+=t[i-1];
    }
    for(int j=0;j<=k-1;j++)
    {
        cin>>p[j];
        p[j]=p[j]%t[n-1];
    }
    for(int j=0;j<=k-1;j++)
    {
        if(p[j]==0) cout<<n<<" ";
        else
        {
            int i=0;
            while(t[i]<p[j])
            {
                i++;
            }
           cout<<i+1<<" ";
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms320 KiB
2Time limit exceeded0/0287ms1848 KiB
3Accepted2/22ms320 KiB
4Accepted2/22ms320 KiB
5Accepted2/22ms320 KiB
6Accepted3/32ms320 KiB
7Accepted3/32ms320 KiB
8Accepted3/32ms320 KiB
9Time limit exceeded0/2298ms1812 KiB
10Time limit exceeded0/2300ms1848 KiB
11Time limit exceeded0/2300ms1964 KiB
12Time limit exceeded0/2280ms1848 KiB
13Time limit exceeded0/2300ms1848 KiB
14Time limit exceeded0/2298ms1836 KiB
15Time limit exceeded0/2298ms1892 KiB
16Time limit exceeded0/2282ms1848 KiB
17Time limit exceeded0/2277ms1848 KiB
18Time limit exceeded0/2300ms1800 KiB
19Time limit exceeded0/2300ms1964 KiB
20Time limit exceeded0/2286ms1848 KiB
21Time limit exceeded0/2282ms1844 KiB
22Time limit exceeded0/3300ms2116 KiB
23Time limit exceeded0/3300ms1848 KiB
24Time limit exceeded0/3291ms1848 KiB