245262026-02-12 17:19:56AkosVagyokEmborZenehallgatáspython3Runtime error 0/5017ms3240 KiB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector <int> zenek, st, seg;
int zsz, sszam, sum;
void be() {
    cin >> zsz>>sszam;
    zenek.resize(zsz+1);
    st.resize(sszam + 1);
    for (int i = 1; i <= zsz; i++) {
        cin >> zenek[i];
        sum += zenek[i];
        if (i != 1) {
            zenek[i] += zenek[i - 1];
        }
    }
    for (int i = 1; i <= sszam; i++) {
        cin >> st[i];        
    }
    int index = 0;
    seg.resize(sum + 1);
    for (int i = 1; i <= zsz; i++) {
        for (int j = 1; j <= zenek[i]; j++) {
            if (!seg[j]) {
                seg[j] = i;
            }
        }
    }
}
void nagy() {
    for (int k = 1; k <= sszam; k++) {
        int a;
        a = st[k] % sum;
        
    }
}



int main()
{
    be();
    nagy();

    
}

SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/014ms3240 KiB
2Runtime error0/016ms2864 KiB
3Runtime error0/216ms2864 KiB
4Runtime error0/214ms3064 KiB
5Runtime error0/216ms2972 KiB
6Runtime error0/316ms2868 KiB
7Runtime error0/316ms3044 KiB
8Runtime error0/314ms2928 KiB
9Runtime error0/216ms2868 KiB
10Runtime error0/217ms2912 KiB
11Runtime error0/217ms2868 KiB
12Runtime error0/217ms2868 KiB
13Runtime error0/217ms2868 KiB
14Runtime error0/216ms3044 KiB
15Runtime error0/214ms2836 KiB
16Runtime error0/216ms3036 KiB
17Runtime error0/216ms2868 KiB
18Runtime error0/216ms2868 KiB
19Runtime error0/216ms3128 KiB
20Runtime error0/216ms3040 KiB
21Runtime error0/216ms2952 KiB
22Runtime error0/314ms2836 KiB
23Runtime error0/316ms3036 KiB
24Runtime error0/314ms3032 KiB