29092023-02-02 14:13:33UnluckYZenehallgatáscpp11Wrong answer 0/50112ms9420 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){


    int n, k; cin >> n >> k;
    vector<int> v;
    vector<pair<int, int>> t, mego;
    int mod = 0;

    for (int i = 0; i < n; i++){
        int x; cin >> x; v.push_back(x);
        mod += x;
    }

    for (int i = 0; i < k; i++){
        int x; cin >> x; t.push_back({x%mod, i});
    }

    sort(t.begin(), t.end());

    int most = 1, j = 0;

    for (int i = 0; i < n; i++){
        if (j == k) break;
        most += v[i];
        if (t[j].first < most){
            mego.push_back({t[j].second, i+1});
            j++;
        }
    } 

    sort(mego.begin(), mego.end());

    for (auto i : mego){
        cout << i.second << " ";
    }


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1680 KiB
2Wrong answer0/0112ms7320 KiB
3Wrong answer0/24ms2180 KiB
4Wrong answer0/23ms2404 KiB
5Wrong answer0/23ms2400 KiB
6Wrong answer0/34ms2528 KiB
7Wrong answer0/34ms2868 KiB
8Wrong answer0/33ms2940 KiB
9Wrong answer0/2112ms8520 KiB
10Wrong answer0/2112ms8472 KiB
11Wrong answer0/2112ms8468 KiB
12Wrong answer0/2111ms8724 KiB
13Wrong answer0/2112ms8692 KiB
14Wrong answer0/2108ms8816 KiB
15Wrong answer0/2108ms8760 KiB
16Wrong answer0/2108ms8756 KiB
17Wrong answer0/2112ms8760 KiB
18Wrong answer0/2105ms8752 KiB
19Wrong answer0/2105ms8912 KiB
20Wrong answer0/2104ms9024 KiB
21Wrong answer0/2103ms9052 KiB
22Wrong answer0/3104ms9076 KiB
23Wrong answer0/3104ms9280 KiB
24Wrong answer0/3103ms9420 KiB