122332024-12-10 10:40:03szasztundeZenehallgatáscpp11Time limit exceeded 15/50248ms1504 KiB
#include <iostream>
#include <vector>
#include <algorithm>
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/0247ms1456 KiB
3Accepted2/23ms320 KiB
4Accepted2/24ms320 KiB
5Accepted2/23ms320 KiB
6Accepted3/33ms504 KiB
7Accepted3/33ms320 KiB
8Accepted3/33ms320 KiB
9Time limit exceeded0/2246ms1504 KiB
10Time limit exceeded0/2246ms1444 KiB
11Time limit exceeded0/2248ms1436 KiB
12Time limit exceeded0/2244ms1272 KiB
13Time limit exceeded0/2247ms1284 KiB
14Time limit exceeded0/2241ms1452 KiB
15Time limit exceeded0/2246ms1456 KiB
16Time limit exceeded0/2241ms1280 KiB
17Time limit exceeded0/2241ms1456 KiB
18Time limit exceeded0/2245ms1324 KiB
19Time limit exceeded0/2245ms1460 KiB
20Time limit exceeded0/2237ms1456 KiB
21Time limit exceeded0/2243ms1452 KiB
22Time limit exceeded0/3241ms1456 KiB
23Time limit exceeded0/3236ms1376 KiB
24Time limit exceeded0/3212ms1456 KiB