58042023-10-02 16:57:04AblablablaVállalkozócpp17Wrong answer 2/4034ms5260 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    vector<int> orak(n, 0);
    for(int i = 0; i < n; i++){
        cin >> orak[i];
    }

    vector<int> megbizas(m, 0);
    for(int i = 0; i < m; i++){
        cin >> megbizas[i];
    }

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

    int valasz = 0;
    int nap = 1;
    int aznap = 0;
    for(int i = 0; i < m; i++){
        if(aznap == orak[nap]){
            nap++;
        }

        if(megbizas[i] >= nap){
            aznap++;
            valasz++;
        }
    }

    cout << valasz << "\n";
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/03ms1812 KiB
2Wrong answer0/034ms2704 KiB
3Wrong answer0/23ms2216 KiB
4Accepted2/23ms2428 KiB
5Wrong answer0/23ms2636 KiB
6Wrong answer0/23ms2900 KiB
7Wrong answer0/24ms3128 KiB
8Wrong answer0/23ms3320 KiB
9Wrong answer0/24ms3572 KiB
10Wrong answer0/23ms3496 KiB
11Wrong answer0/24ms3500 KiB
12Wrong answer0/24ms3604 KiB
13Wrong answer0/24ms3700 KiB
14Wrong answer0/24ms3692 KiB
15Wrong answer0/210ms3920 KiB
16Wrong answer0/210ms3912 KiB
17Wrong answer0/214ms3980 KiB
18Wrong answer0/210ms4180 KiB
19Wrong answer0/213ms4444 KiB
20Wrong answer0/217ms4664 KiB
21Wrong answer0/224ms4748 KiB
22Wrong answer0/234ms5260 KiB