211312026-01-12 12:29:25sklausZenehallgatáscpp17Wrong answer 0/50248ms1452 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,k,m,p;
    cin>>n>>k;
    int t[n];
    for(int i=0; i<n; i++)
    {cin>>p;
        m+=p;
        t[i]=m;
    }
    for(int i=0; i<k; i++)
    {
        cin>>p;
        int y=p%m;
        int *ptr=lower_bound(t,t+n,y);
        int j=ptr-t;
        cout << j+1<< " ";
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Time limit exceeded0/0238ms1332 KiB
3Wrong answer0/23ms316 KiB
4Wrong answer0/23ms316 KiB
5Wrong answer0/23ms316 KiB
6Wrong answer0/33ms316 KiB
7Wrong answer0/33ms316 KiB
8Wrong answer0/33ms316 KiB
9Time limit exceeded0/2248ms820 KiB
10Time limit exceeded0/2248ms1372 KiB
11Time limit exceeded0/2238ms820 KiB
12Time limit exceeded0/2231ms1332 KiB
13Time limit exceeded0/2232ms1332 KiB
14Time limit exceeded0/2231ms812 KiB
15Time limit exceeded0/2246ms1376 KiB
16Time limit exceeded0/2236ms1260 KiB
17Time limit exceeded0/2244ms1368 KiB
18Time limit exceeded0/2231ms828 KiB
19Time limit exceeded0/2231ms1332 KiB
20Time limit exceeded0/2229ms828 KiB
21Time limit exceeded0/2229ms1452 KiB
22Time limit exceeded0/3229ms1332 KiB
23Time limit exceeded0/3233ms812 KiB
24Time limit exceeded0/3203ms820 KiB