122202024-12-09 15:26:03szasztundeZenehallgatáscpp17Runtime error 15/50261ms32000 KiB
#include <iostream>
//#include <fstream>
using namespace std;
int a[100000001]={0};
int main()
{
    int n,k,h=0,x;
    //ifstream fin("be2.txt");
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        for(int j=1;j<=x;j++)
        {
            h++;
            a[h]=i;
        }
    }
    for(int i=1;i<=k;i++)
    {
        cin>>x;
        cout<<a[x%h]<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms320 KiB
2Runtime error0/035ms32000 KiB
3Accepted2/221ms19764 KiB
4Accepted2/210ms10040 KiB
5Accepted2/24ms2360 KiB
6Accepted3/33ms580 KiB
7Accepted3/33ms320 KiB
8Accepted3/33ms320 KiB
9Runtime error0/229ms32000 KiB
10Runtime error0/235ms32000 KiB
11Runtime error0/229ms32000 KiB
12Runtime error0/230ms32000 KiB
13Runtime error0/239ms32000 KiB
14Runtime error0/241ms32000 KiB
15Runtime error0/243ms32000 KiB
16Runtime error0/241ms32000 KiB
17Runtime error0/246ms32000 KiB
18Time limit exceeded0/2259ms20536 KiB
19Time limit exceeded0/2261ms20536 KiB
20Time limit exceeded0/2237ms2980 KiB
21Time limit exceeded0/2229ms3128 KiB
22Time limit exceeded0/3231ms3076 KiB
23Time limit exceeded0/3231ms1744 KiB
24Time limit exceeded0/3231ms1592 KiB