9412022-02-02 07:49:49zsebiZenehallgatáscpp11Time limit exceeded 0/50294ms10868 KiB
#include <iostream>
#include <vector>

#define ll long long
using namespace std;

//ifstream cin("zene.in");
//ofstream cout("zene.out");
vector<ll>x;
ll p,i,n,k,s,j;
int main()
{
    cin>>n>>k;
    x.resize(n+1);
    for(i=1;i<=n;++i)
    {
        cin>>x[i];
    }

    for(i=1;i<=k;++i)
    {
        cin>>p;
        s=0;
        j=1;
         while(s<p)
         {
             s+=x[j];
             if(s>=p)
             {
                 cout<<j<<" ";

             }
             j++;
             if(j>n)j=1;
         }
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/02ms1808 KiB
2Time limit exceeded0/0280ms2272 KiB
3Time limit exceeded0/2264ms1620 KiB
4Time limit exceeded0/2280ms1572 KiB
5Time limit exceeded0/2291ms1716 KiB
6Time limit exceeded0/3243ms1672 KiB
7Time limit exceeded0/3294ms1712 KiB
8Time limit exceeded0/3261ms1728 KiB
9Time limit exceeded0/2245ms3136 KiB
10Time limit exceeded0/2238ms3768 KiB
11Time limit exceeded0/2217ms3968 KiB
12Time limit exceeded0/2206ms4100 KiB
13Time limit exceeded0/2207ms4724 KiB
14Time limit exceeded0/2202ms5352 KiB
15Time limit exceeded0/2206ms5796 KiB
16Time limit exceeded0/2248ms6344 KiB
17Time limit exceeded0/2202ms6780 KiB
18Time limit exceeded0/2204ms7412 KiB
19Time limit exceeded0/2202ms7772 KiB
20Time limit exceeded0/2248ms8152 KiB
21Time limit exceeded0/2210ms8576 KiB
22Time limit exceeded0/3248ms8880 KiB
23Time limit exceeded0/3247ms10868 KiB
24Time limit exceeded0/3203ms9556 KiB