122212024-12-09 15:55:13szasztundeZenehallgatáscpp17Time limit exceeded 15/50259ms1508 KiB
#include <iostream>
#include <vector>
using namespace std;
vector <int> a;
int main()
{
    int n,k,x,t=0;
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        t=t+x;
        a.push_back(t);
    }
    int h=a[n-1];
    for(int i=1;i<=k;i++)
    {
        cin>>x;
        x=x%h;
        cout<<(lower_bound(a.begin(),a.end(),x)-a.begin())+1<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms320 KiB
2Time limit exceeded0/0254ms1456 KiB
3Accepted2/23ms320 KiB
4Accepted2/23ms320 KiB
5Accepted2/23ms320 KiB
6Accepted3/33ms320 KiB
7Accepted3/33ms320 KiB
8Accepted3/33ms320 KiB
9Time limit exceeded0/2252ms1276 KiB
10Time limit exceeded0/2259ms1412 KiB
11Time limit exceeded0/2252ms1300 KiB
12Time limit exceeded0/2256ms1456 KiB
13Time limit exceeded0/2254ms1404 KiB
14Time limit exceeded0/2247ms1284 KiB
15Time limit exceeded0/2247ms1368 KiB
16Time limit exceeded0/2254ms1452 KiB
17Time limit exceeded0/2254ms1460 KiB
18Time limit exceeded0/2246ms1508 KiB
19Time limit exceeded0/2246ms1456 KiB
20Time limit exceeded0/2250ms1288 KiB
21Time limit exceeded0/2250ms1468 KiB
22Time limit exceeded0/3243ms1456 KiB
23Time limit exceeded0/3241ms1344 KiB
24Time limit exceeded0/3218ms1464 KiB