122312024-12-10 10:25:45szasztundeZenehallgatáscpp11Runtime error 13/50240ms32000 KiB
#include <iostream>
//#include <fstream>
#include <vector>
using namespace std;
vector <int> a;
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.push_back(i);
        }
    }
    for(int i=1;i<=k;i++)
    {
        cin>>x;
        cout<<a[x%h-1]<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base13/50
1Accepted0/01ms320 KiB
2Runtime error0/050ms32000 KiB
3Runtime error0/261ms32000 KiB
4Accepted2/235ms16776 KiB
5Accepted2/27ms2556 KiB
6Accepted3/33ms760 KiB
7Accepted3/33ms568 KiB
8Accepted3/33ms508 KiB
9Runtime error0/261ms32000 KiB
10Runtime error0/250ms32000 KiB
11Runtime error0/261ms32000 KiB
12Runtime error0/250ms32000 KiB
13Runtime error0/252ms32000 KiB
14Runtime error0/264ms32000 KiB
15Runtime error0/265ms32000 KiB
16Runtime error0/257ms32000 KiB
17Runtime error0/271ms32000 KiB
18Runtime error0/279ms32000 KiB
19Runtime error0/265ms32000 KiB
20Time limit exceeded0/2225ms4560 KiB
21Time limit exceeded0/2240ms4424 KiB
22Time limit exceeded0/3239ms4512 KiB
23Time limit exceeded0/3228ms1964 KiB
24Time limit exceeded0/3208ms1704 KiB