116972024-11-06 15:09:11MCDaveZenehallgatáscpp17Time limit exceeded 15/50300ms1560 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, k, i, j, sum = 0, question;
    cin >> n >> k;
    vector<int> playlist(n);

    for (i = 0; i < n; i++)
    {
        cin >> playlist[i];
        sum += playlist[i];
    }

    for (i = 0; i < k; i++)
    {
        cin >> question;
        question %= sum;

        for (j = 0; j < n and question > 0; j++)
        {
            question -= playlist[j];
        }

        cout << j << ' ';
    }
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms500 KiB
2Time limit exceeded0/0284ms1436 KiB
3Accepted2/24ms320 KiB
4Accepted2/24ms320 KiB
5Accepted2/24ms320 KiB
6Accepted3/34ms320 KiB
7Accepted3/34ms320 KiB
8Accepted3/34ms320 KiB
9Time limit exceeded0/2298ms1440 KiB
10Time limit exceeded0/2298ms1560 KiB
11Time limit exceeded0/2298ms1304 KiB
12Time limit exceeded0/2291ms1336 KiB
13Time limit exceeded0/2280ms1432 KiB
14Time limit exceeded0/2279ms1316 KiB
15Time limit exceeded0/2298ms1436 KiB
16Time limit exceeded0/2284ms1336 KiB
17Time limit exceeded0/2286ms1332 KiB
18Time limit exceeded0/2286ms1172 KiB
19Time limit exceeded0/2300ms1172 KiB
20Time limit exceeded0/2279ms1080 KiB
21Time limit exceeded0/2282ms1184 KiB
22Time limit exceeded0/3282ms1080 KiB
23Time limit exceeded0/3300ms1048 KiB
24Time limit exceeded0/3284ms1180 KiB