65662023-12-12 08:33:21Huni136Zenehallgatáscpp17Time limit exceeded 0/50300ms16556 KiB
#include <iostream>
#include <map>
using namespace std;

map<int,int> vlmi;

int main()
{
    int prevveg=0;
    int n,x,kdb;
    cin>>n>>kdb;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        prevveg+=x;
        vlmi[prevveg]=i;
    }
    int k;
    auto seg=vlmi.end();
    prevveg++;
    for(int i=1;i<=kdb;i++)
    {
        cin>>k;
        k=k%(prevveg);
        auto it=vlmi.begin();
        while (it!=seg && it->first<k)
        {
            it++;
        }
        cout<<it->second<<" ";
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms2004 KiB
2Time limit exceeded0/0300ms6788 KiB
3Wrong answer0/28ms3272 KiB
4Wrong answer0/28ms3524 KiB
5Wrong answer0/28ms3388 KiB
6Wrong answer0/38ms3656 KiB
7Wrong answer0/38ms3640 KiB
8Wrong answer0/38ms3668 KiB
9Time limit exceeded0/2300ms8096 KiB
10Time limit exceeded0/2254ms8892 KiB
11Time limit exceeded0/2248ms9684 KiB
12Time limit exceeded0/2268ms10564 KiB
13Time limit exceeded0/2244ms11228 KiB
14Time limit exceeded0/2272ms11660 KiB
15Time limit exceeded0/2252ms12472 KiB
16Time limit exceeded0/2264ms12888 KiB
17Time limit exceeded0/2268ms13504 KiB
18Time limit exceeded0/2273ms14200 KiB
19Time limit exceeded0/2266ms14588 KiB
20Time limit exceeded0/2261ms14892 KiB
21Time limit exceeded0/2268ms15324 KiB
22Time limit exceeded0/3273ms15624 KiB
23Time limit exceeded0/3273ms16208 KiB
24Time limit exceeded0/3270ms16556 KiB