122322024-12-10 10:38:30szasztundeZenehallgatáscpp11Time limit exceeded 15/50254ms1504 KiB
#include <iostream>
#include <vector>
//#include <fstream>
using namespace std;
vector <int> a;
int main()
{
    int n,k,x,t=0;
    //ifstream fin("be2.txt");
    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/0243ms1456 KiB
3Accepted2/23ms508 KiB
4Accepted2/23ms320 KiB
5Accepted2/23ms320 KiB
6Accepted3/33ms320 KiB
7Accepted3/33ms320 KiB
8Accepted3/33ms500 KiB
9Time limit exceeded0/2246ms1300 KiB
10Time limit exceeded0/2254ms1300 KiB
11Time limit exceeded0/2252ms1456 KiB
12Time limit exceeded0/2240ms1456 KiB
13Time limit exceeded0/2247ms1456 KiB
14Time limit exceeded0/2240ms1456 KiB
15Time limit exceeded0/2246ms1452 KiB
16Time limit exceeded0/2238ms1456 KiB
17Time limit exceeded0/2240ms1456 KiB
18Time limit exceeded0/2246ms1456 KiB
19Time limit exceeded0/2243ms1504 KiB
20Time limit exceeded0/2232ms1288 KiB
21Time limit exceeded0/2233ms1456 KiB
22Time limit exceeded0/3247ms1292 KiB
23Time limit exceeded0/3232ms1408 KiB
24Time limit exceeded0/3212ms1452 KiB