67242023-12-18 10:29:04zsebiZenehallgatáscpp17Time limit exceeded 21/50273ms5860 KiB
// zenehallgatas.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <queue>

#define ll long long 
using namespace std;


ll n, k;
int main()
{
    cin >> n >> k;
    vector<ll>x(n);
    for (int i = 1; i <= n; ++i)
    {
        cin >>x[i-1];
        if (i - 1)
            x[i - 1] += x[i - 2];
    }
    for (int i = 1; i <= k; ++i)
    {
        ll a;
        cin >> a;
        a %= x[n - 1];
        cout << lower_bound(x.begin(), x.end(), a) - x.begin()+1 << " ";
    }
    return 0;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base21/50
1Accepted0/03ms1816 KiB
2Time limit exceeded0/0202ms3404 KiB
3Accepted2/24ms2272 KiB
4Accepted2/24ms2312 KiB
5Accepted2/24ms2448 KiB
6Accepted3/34ms2648 KiB
7Accepted3/34ms2856 KiB
8Accepted3/34ms3100 KiB
9Time limit exceeded0/2231ms4788 KiB
10Time limit exceeded0/2259ms3560 KiB
11Time limit exceeded0/2266ms3888 KiB
12Time limit exceeded0/2229ms5288 KiB
13Accepted2/2200ms5496 KiB
14Accepted2/2200ms5340 KiB
15Accepted2/2200ms5340 KiB
16Time limit exceeded0/2266ms4108 KiB
17Time limit exceeded0/2263ms4104 KiB
18Time limit exceeded0/2273ms4196 KiB
19Time limit exceeded0/2259ms5516 KiB
20Time limit exceeded0/2250ms4584 KiB
21Time limit exceeded0/2226ms5860 KiB
22Time limit exceeded0/3266ms4536 KiB
23Time limit exceeded0/3268ms4472 KiB
24Time limit exceeded0/3243ms5744 KiB