17452022-12-02 13:48:391478Toronyépítés (1,1,3,3)cpp11Wrong answer 0/5017ms18420 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

long long i, n, m, a;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> m;

    vector<long long> prefixSum(n + 1);

    for (i = 1; i <= n; ++i)
    {
        cin >> prefixSum[i];
        prefixSum[i] += prefixSum[i - 1];
    }

    for (i = 1; i <= m; ++i)
    {
        cin >> a;

        a = a % prefixSum[n];

        cout << lower_bound(prefixSum.begin() + 1, prefixSum.end(), a) - prefixSum.begin() << " ";
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1824 KiB
2Wrong answer0/02ms2080 KiB
3Wrong answer0/32ms2268 KiB
4Wrong answer0/32ms2424 KiB
5Wrong answer0/42ms2628 KiB
6Wrong answer0/42ms2836 KiB
7Wrong answer0/417ms18420 KiB
8Wrong answer0/44ms4964 KiB
9Wrong answer0/42ms3184 KiB
10Wrong answer0/42ms3112 KiB
11Wrong answer0/44ms6016 KiB
12Wrong answer0/416ms18240 KiB
13Wrong answer0/414ms16548 KiB
14Wrong answer0/47ms8528 KiB
15Wrong answer0/22ms3340 KiB
16Wrong answer0/22ms3352 KiB