104682024-04-03 07:42:59VargusZenehallgatáscpp17Time limit exceeded 0/50300ms13600 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    ll n, k;
    cin >> n >> k;
    vector <ll> a(n + 1), b(k + 1);
    for (ll i = 1; i <= n; ++i)
        cin >> a[i];

    
    for (ll i = 1; i <= k; ++i)
    {
        ll j = 1;
        cin >> b[i];
        while (b[i] > 0)
        {
            b[i] -= a[j];
            ++j;
            if (j > n)
                j = 1;
        }
        cout << j - 1  << " ";
    }

    return 0;
}
/*
3 2
2 4 3
6 10
*/
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1876 KiB
2Time limit exceeded0/0300ms3684 KiB
3Wrong answer0/2160ms3084 KiB
4Time limit exceeded0/2270ms3300 KiB
5Time limit exceeded0/2256ms3416 KiB
6Time limit exceeded0/3248ms3700 KiB
7Time limit exceeded0/3268ms3956 KiB
8Time limit exceeded0/3237ms3956 KiB
9Time limit exceeded0/2270ms5436 KiB
10Time limit exceeded0/2259ms6332 KiB
11Time limit exceeded0/2272ms6664 KiB
12Time limit exceeded0/2272ms7292 KiB
13Time limit exceeded0/2272ms8020 KiB
14Time limit exceeded0/2280ms8536 KiB
15Time limit exceeded0/2268ms9312 KiB
16Time limit exceeded0/2280ms10136 KiB
17Time limit exceeded0/2280ms10700 KiB
18Time limit exceeded0/2259ms11208 KiB
19Time limit exceeded0/2284ms11656 KiB
20Time limit exceeded0/2247ms12236 KiB
21Time limit exceeded0/2270ms12564 KiB
22Time limit exceeded0/3268ms13016 KiB
23Time limit exceeded0/3268ms13432 KiB
24Time limit exceeded0/3247ms13600 KiB