79092024-01-11 20:20:33CsongiZenehallgatáscpp17Wrong answer 0/5050ms5360 KiB
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main()
{
    long long n, i, k, a, ido;
    vector<int>x;
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >>k;
    for (i = 1; i <= n; ++i)
    {
        cin >> a;
        ido += a;
        x.push_back(ido);
    }
    for (i = 1; i <= k; ++i)
    {
        cin >> a;
        a = a % x[n - 1];
        cout << lower_bound(x.begin(), x.end(), a) - x.begin()+1<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1824 KiB
2Wrong answer0/041ms3288 KiB
3Wrong answer0/23ms2248 KiB
4Wrong answer0/23ms2332 KiB
5Wrong answer0/23ms2540 KiB
6Wrong answer0/33ms2544 KiB
7Wrong answer0/33ms2800 KiB
8Wrong answer0/33ms2748 KiB
9Wrong answer0/239ms4016 KiB
10Wrong answer0/239ms4348 KiB
11Wrong answer0/243ms4560 KiB
12Wrong answer0/239ms4504 KiB
13Wrong answer0/239ms4508 KiB
14Wrong answer0/239ms4644 KiB
15Wrong answer0/239ms4848 KiB
16Wrong answer0/250ms4928 KiB
17Wrong answer0/237ms5040 KiB
18Wrong answer0/237ms4932 KiB
19Wrong answer0/237ms4940 KiB
20Wrong answer0/237ms4940 KiB
21Wrong answer0/237ms4936 KiB
22Wrong answer0/337ms5136 KiB
23Wrong answer0/337ms5212 KiB
24Wrong answer0/337ms5360 KiB